A
A
Anton2016-04-12 18:17:38
git
Anton, 2016-04-12 18:17:38

How to "feed" a github token for a private repository?

Hello.
There is a private repository under my contribution, in one project I created a token with default settings without any problems, fed it with composer update, and forgot about it. Today it was necessary to do the same, but with the second repository, but it does not accept the previous token, it asks to create a new one, I was surprised, but I created it (later I tried to tick all the boxes when creating the token - this did not help the case).
In the end, he writes this:

Resolving dependencies through SAT
Dependency resolution completed in 46.814 seconds
Analyzed 9248 packages to resolve dependencies
Analyzed 244105 rules to resolve dependencies
  - Installing <vendor>/<package_name> (dev-master <hash>)
Downloading https://api.github.com/repos/<vendor>/<package_name>/zipball/<hash>
    Downloading: 100%
Could not fetch https://codeload.github.com/<vendor>/<package_name>/zipball/<hash>/legacy.zip/<hash>?access_token=<токен_который_работает_в_первом_проекте>, please create a GitHub OAuth token to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=<desc>
to retrieve a token. It will be stored in "/var/www/<project_name>/auth.json" for future use by Composer.
Token (hidden):

If you pass him an old or new token, this message is repeated, but if you do not specify a token at all, then he writes:
Token (hidden):
No token given, aborting.
You can also add it manually later by using "composer config github-oauth.github.com <token>"

Failed: [RuntimeException] 0: Could not delete /var/www/<project_name>/vendor/<vendor>/<package_name>/<hash>:
    Failed to download gdmforex/internal-api-client from dist: Could not delete /var/www/<project_name>/vendor/<vendor>/<package_name>/<hash>:
    Now trying to download from source
  - Installing <vendor>/<package_name> (dev-master <hash>)

  [RuntimeException]
  Could not delete /var/www/<project_name>/vendor/<vendor>/<package_name>/<hash>:

In the file that he cannot delete (then he tried to execute both from under sudo and from under sudo -u), there is only one line "Not found"
composer config github-oauth.github.com - he also tried to execute this command with his hands, the result is the same same.
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2016-04-13
@brud

Apparently, the problem is in one of the latest composer updates - after sudo composer self-update -rthat everything works like clockwork.

D
Dmitry Krivoshein, 2016-10-20
@kdes70

i found the answer here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question