{"action":"created","issue":{"url":"https://api.github.com/repos/composer/composer/issues/4934","repository_url":"https://api.github.com/repos/composer/composer","labels_url":"https://api.github.com/repos/composer/composer/issues/4934/labels{/name}","comments_url":"https://api.github.com/repos/composer/composer/issues/4934/comments","events_url":"https://api.github.com/repos/composer/composer/issues/4934/events","html_url":"https://github.com/composer/composer/issues/4934","id":134892705,"number":4934,"title":"Composer fails to contact rate limit endpoint on Github Enterprise","user":{"login":"mirfilip","id":1812341,"avatar_url":"https://avatars.githubusercontent.com/u/1812341?v=3","gravatar_id":"","url":"https://api.github.com/users/mirfilip","html_url":"https://github.com/mirfilip","followers_url":"https://api.github.com/users/mirfilip/followers","following_url":"https://api.github.com/users/mirfilip/following{/other_user}","gists_url":"https://api.github.com/users/mirfilip/gists{/gist_id}","starred_url":"https://api.github.com/users/mirfilip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirfilip/subscriptions","organizations_url":"https://api.github.com/users/mirfilip/orgs","repos_url":"https://api.github.com/users/mirfilip/repos","events_url":"https://api.github.com/users/mirfilip/events{/privacy}","received_events_url":"https://api.github.com/users/mirfilip/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/composer/composer/labels/Support","name":"Support","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-02-19T15:30:16Z","updated_at":"2016-02-24T12:33:49Z","closed_at":null,"body":"# Environment\r\n- Running the newest composer available:\r\n```\r\n$ composer self-update\r\nYou are already using composer version 9e623f50e7c883a1108352dd61c3d77a65e41130.\r\n```\r\n- I have a project with a `composer.json` like:\r\n```\r\n(...)\r\n\"repositories\": [\r\n    {\r\n      \"type\": \"vcs\",\r\n      \"url\": \"https://my.github.enterprise.org/vendor/package\"\r\n    }\r\n  ],\r\n\"require\": {\r\n    \"vendor/package\": \"*\",\r\n},\r\n\"config\": {\r\n    \"preferred-install\": \"dist\",\r\n    \"github-domains\": [\r\n      \"my.github.enterprise.org\"\r\n    ]\r\n  }\r\n```\r\nThe config is made up but reflects the situation. \r\n- I have a working Github Enterprise instance at https://my.github.enterprise.org. I can access both its API and the project site https://my.github.enterprise.org/vendor/package.\r\n\r\n- I have no `composer.lock` to simplify the scenario.\r\n- My `~/.composer/auth.json` looks like:\r\n```\r\n{\r\n    \"github-oauth\": {\r\n        \"github.com\": \"XXXXX\"\r\n    }\r\n}\r\n```\r\nwith the permissions: `-rw-------  1 me  staff   119B Feb 19 15:58 /Users/me/.composer/auth.json`\r\n\r\n# The problem\r\nWhen I do `composer install` I am hitting GHE rate limit and I'm asked to add a token:\r\n```\r\nLoading composer repositories with package information\r\n\r\nCould not fetch https://my.github.enterprise.org/api/v3/repos/vendor/package, please create a GitHub OAuth token to go over the API rate limit\r\nHead to https://my.github.enterprise.org/settings/tokens/new?scopes=repo&description=Composer+on+me+2016-02-19+1618\r\nto retrieve a token. It will be stored in \"/Users/me/.composer/auth.json\" for future use by Composer.\r\nToken (hidden):\r\n```\r\nI already have a token generated. When I paste it and hit enter, it asks me again for it, as if the token is wrong. After second try it crashes out with:\r\n```\r\n[Composer\\Downloader\\TransportException]\r\n  The \"https://my.github.enterprise.org/api/v3/rate_limit\" file could not be downloaded (HTTP/1.1 404 Not Found)\r\n```\r\n\r\nI am sure the token is valid though. I know that because when I manually edit my `auth.json` and make it look like:\r\n```\r\n{\r\n    \"github-oauth\": {\r\n        \"github.com\": \"XXXXX\",\r\n        \"my.github.enterprise.org\": \"MyValidTokenHere\"\r\n\r\n    }\r\n}\r\n```\r\nand then do `composer install`, it works fine then. I'm also able to manually \"ping\" the GHE endpoints, no 404s."},"comment":{"url":"https://api.github.com/repos/composer/composer/issues/comments/188230229","html_url":"https://github.com/composer/composer/issues/4934#issuecomment-188230229","issue_url":"https://api.github.com/repos/composer/composer/issues/4934","id":188230229,"user":{"login":"alcohol","id":21414,"avatar_url":"https://avatars.githubusercontent.com/u/21414?v=3","gravatar_id":"","url":"https://api.github.com/users/alcohol","html_url":"https://github.com/alcohol","followers_url":"https://api.github.com/users/alcohol/followers","following_url":"https://api.github.com/users/alcohol/following{/other_user}","gists_url":"https://api.github.com/users/alcohol/gists{/gist_id}","starred_url":"https://api.github.com/users/alcohol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alcohol/subscriptions","organizations_url":"https://api.github.com/users/alcohol/orgs","repos_url":"https://api.github.com/users/alcohol/repos","events_url":"https://api.github.com/users/alcohol/events{/privacy}","received_events_url":"https://api.github.com/users/alcohol/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T12:33:48Z","updated_at":"2016-02-24T12:33:48Z","body":"I don't have a paid account so that is a no-go."}}