-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composer hangs when cloning SSH repository with enabled ControlMaster #4180
Comments
Eureka, I've been having this problem for ages never occurred to me it might be down to SSH connection multiplexing. This would explain why I don't see it very often and a SIGINT and re run always works. |
I'm glad I'm not the only one ;) As a workaround I'm using a script that does a |
This has been a bug in SSH for a while with control persist. |
Thanks for the pointer. Since this does not seem to be a composer bug, maybe this should be added to the troubleshooting section in the docs? |
Odd, I use roughly the same settings but I have never had any trouble with it.
|
@alcohol maybe you dont use a ssh version which is affected by the bug (see bugreport) |
On my server
Yay for homebrew
|
By the sounds of things it was never fixed in SSH they just added the @alcohol I'm using 6.6 and can reproduce the problem, the difference is I use a time out of 10 minutes rather than your much longer 2 hours. I think I'll bump mine up for GitHub. Console output on my machine: https://gist.github.com/cs278/7e60c231159bc2249cd8 Steps to reproduce are basically: cd "$(mktemp -d)"
ssh -O exit git@github.com
composer require --prefer-source psr/log '*' |
When running SSH without an existing socket a new instance is forked holding open stderr, this causes Composer to hang waiting for output from that stream. Increase the timeout so there is less chance of running Composer when there is no socket open. See: composer/composer#4180
Eh your steps to reproduce doesn't really work for me...
Edit: never mind, had to add a github.com entry to my .ssh config;
|
@alcohol you should also force composer to use the ssh url when cloning the repo. If it clones over https, it will of course not be impacted. and by default, SSH is the last protocol: https://getcomposer.org/doc/06-config.md#github-protocols and composer/src/Composer/Config.php Line 30 in 8466129
|
I see. So I guess his internal server doesn't support the git and https protocol, hence the ssh fallback. |
I have the issue with private repos. I have my environment set up to point GIT_SSH to a wrapper that spawns a control master if the socket isn't available. Then calls ssh. |
Closing as it's not clear what we can do to help. |
This is a really strange bug.
I'm using the ControlMaster setting of SSH to speed up connections to our Git server:
I can manually access the Server with SSH and clone repositories without a problem.
But when I use composer and the master file does not exist, composer just stops working on this command:
When I look at the process tree, I see this:
When I open a connection to the SSH server before running composer and the master file already exists the composer command runs without problems.
The text was updated successfully, but these errors were encountered: