composer: [Composer\Downloader\TransportException]

Composer update fails & has worked fine up until yesterday (18th Feb 2014). Composer install still works

> php composer.phar update
[Composer\Downloader\TransportException]
  The "https://api.github.com/authorizations" file could not be downloaded (HTTP/1.1 422 Unprocessable Entity)

Note: Install works fine

> php composer.phar diagnose
Checking platform settings: FAIL

The xdebug extension is loaded, this can slow down Composer a little.
Disabling it when using Composer is recommended, but should not cause issues beyond slowness.
Checking git settings: OK
Checking http connectivity: OK
Checking composer.json: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking composer version: OK

In the Github channel on IRC, they said composer is sending the wrong parameters?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 37 (7 by maintainers)

Most upvoted comments

Yup, I finally figured it out. It’s just due to the fact that github does not allow duplicate token names nowadays, so it failed to create it if you already had one created from the same hostname. Anyway now it’s fixed by fetching existing tokens before creating one.

Ok, I was able to fix the issue for me at least. What I did was to go to the App settings page on github (https://github.com/settings/applications) and from there I remove the personal access tokens that composer had set on my computer. After this was done, I tried to run composer install again and this time I did not get the error message.

Update: I had some other issue before this, and I deleted ~/.composer/ so I guess this was the root cause for my problem.

The way I got round it for the moment, until this is resolved properly…

Clone the private repository manually onto the local disk, and list the private repositories in the composer.json file. i.e.

    // ...
    "repositories": [
        {
            "type": "vcs",
            "url": "/local/private/repo"
        },
        {
            "type": "vcs",
            "url": "/local/private/repo2"
        }
    ]
    // ...

It is not ideal, but allows one to continue working until fixed.

Hope that helps