{"action":"created","issue":{"url":"https://api.github.com/repos/composer/composer/issues/3830","labels_url":"https://api.github.com/repos/composer/composer/issues/3830/labels{/name}","comments_url":"https://api.github.com/repos/composer/composer/issues/3830/comments","events_url":"https://api.github.com/repos/composer/composer/issues/3830/events","html_url":"https://github.com/composer/composer/issues/3830","id":60325312,"number":3830,"title":"composer install prompts for Basic Auth Username/Password with configured credentials","user":{"login":"CHH","id":16783,"avatar_url":"https://avatars.githubusercontent.com/u/16783?v=3","gravatar_id":"","url":"https://api.github.com/users/CHH","html_url":"https://github.com/CHH","followers_url":"https://api.github.com/users/CHH/followers","following_url":"https://api.github.com/users/CHH/following{/other_user}","gists_url":"https://api.github.com/users/CHH/gists{/gist_id}","starred_url":"https://api.github.com/users/CHH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CHH/subscriptions","organizations_url":"https://api.github.com/users/CHH/orgs","repos_url":"https://api.github.com/users/CHH/repos","events_url":"https://api.github.com/users/CHH/events{/privacy}","received_events_url":"https://api.github.com/users/CHH/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-03-09T10:41:25Z","updated_at":"2015-03-28T19:30:33Z","closed_at":null,"body":"I'm installing a private package and I'm authenticating with basic auth. I'm storing the credentials in a global `auth.json` in the COMPOSER_HOME.\r\n\r\nWhen running `php composer.phar install --no-interaction --no-dev --no-ansi --optimize-autoloader` I get the strange error in my deploy script:\r\n\r\n```\r\n[RuntimeException]                                                           \r\n  Failed to execute git clone --no-checkout 'REDACTED' 'REDACTED' && cd 'REDACTED' && git remot  \r\n  e add composer 'http://git.redacted.com' && git fetch composer                                                     \r\n  fatal: could not read Username for 'http://git.redacted.com': No such   \r\n  device or address\r\n```\r\n\r\nThat error message obviously happens because the deploy script hasn't access to `/dev/tty` and thus cannot prompt for the credentials.\r\n\r\nThe real issue though is, that it's prompting for credentials in the first place, although `store-auths` is set to `false` and `--no-interaction` is passed on the CLI.\r\n\r\nThe regression must have happened after version `2015-02-27_12-27-56-c7b0628`. That version doesn't exhibit that behavior."},"comment":{"url":"https://api.github.com/repos/composer/composer/issues/comments/87289952","html_url":"https://github.com/composer/composer/issues/3830#issuecomment-87289952","issue_url":"https://api.github.com/repos/composer/composer/issues/3830","id":87289952,"user":{"login":"frederikbosch","id":1552577,"avatar_url":"https://avatars.githubusercontent.com/u/1552577?v=3","gravatar_id":"","url":"https://api.github.com/users/frederikbosch","html_url":"https://github.com/frederikbosch","followers_url":"https://api.github.com/users/frederikbosch/followers","following_url":"https://api.github.com/users/frederikbosch/following{/other_user}","gists_url":"https://api.github.com/users/frederikbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/frederikbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frederikbosch/subscriptions","organizations_url":"https://api.github.com/users/frederikbosch/orgs","repos_url":"https://api.github.com/users/frederikbosch/repos","events_url":"https://api.github.com/users/frederikbosch/events{/privacy}","received_events_url":"https://api.github.com/users/frederikbosch/received_events","type":"User","site_admin":false},"created_at":"2015-03-28T19:30:33Z","updated_at":"2015-03-28T19:30:33Z","body":"As f7h pointed out, #3813 is the pain. More specific, this call was introduced in that pull request.\r\n\r\n```php\r\n$process = new Process($command, $cwd, array_replace($_ENV, $_SERVER, array('LANGUAGE' => 'C')), null, static::getTimeout());\r\n```\r\n\r\nThat line prevents GitUtil::cleanEnv() from being effective. The third parameters is not only adding environment settings (through proc_open inside symfony/process), it seems that it is having a monopoly on the environment settings. Hence, the ```putenv``` commands inside GitUtil are being neglected. A quick fix would be to replace it with the following.\r\n\r\n```php\r\n$process = new Process($command, $cwd, array_replace($_ENV, $_SERVER, array('LANGUAGE' => 'C', 'GIT_ASKPASS' => 'echo')), null, static::getTimeout());\r\n```\r\n\r\nBut that is just a quick fix. There are more ```putenv``` calls inside ```GitUtil::cleanEnv```. Moreover, there is also ```SvnUtil::cleanEnv```.\r\n\r\n@Seldaek The question is: how do you want this to be solved? My suggestion is to revert #3813: it is simply introducing more bugs than it is fixing problems. Moreover: that specific language setting could [also be solved in other ways](http://askubuntu.com/questions/320661/change-gits-language-to-english-without-changing-the-locale) - outside composer.\r\n\r\nWe then have the opportunity to think how to solve these problems correctly. If you'd ask me: remove the static cleanEnv calls and add a method called setEnv inside the process executor."}}