从身份验证套接字读取响应长度出错

时间:2015-07-08 16:28:53

标签: git ruby-on-rails-4 capistrano3

在我的ruby on rails项目中,我使用capistrano,unicorn,postgresql和nginx来部署我的项目。当我运行cap production git:check时,我收到此错误:

Error reading response length from authentication socket.

日志跟踪:

INFO [13522bc0] Running /usr/bin/env mkdir -p /tmp/deploy_test/ as mezbah@192.168.137.130
DEBUG [13522bc0] Command: /usr/bin/env mkdir -p /tmp/deploy_test/
INFO [13522bc0] Finished in 0.291 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/deploy_test/git-ssh.sh 0.0%
INFO Uploading /tmp/deploy_test/git-ssh.sh 100.0%
INFO [3b379ef0] Running /usr/bin/env chmod +x /tmp/deploy_test/git-ssh.sh as mezbah@192.168.137.130
DEBUG [3b379ef0] Command: /usr/bin/env chmod +x /tmp/deploy_test/git-ssh.sh
INFO [3b379ef0] Finished in 0.067 seconds with exit status 0 (successful).
INFO [8355617a] Running /usr/bin/env git ls-remote --heads git@github.com:mezbahalam/deploy_test.git as mezbah@192.168.137.130
DEBUG [8355617a] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/deploy_test/git-ssh.sh /usr/bin/env git ls-remote --heads git@github.com:mezbahalam/deploy_test.git )
DEBUG [8355617a]    Error reading response length from authentication socket.
DEBUG [8355617a]    6399a4a331342141ed3bbf3afb58f58828f96c76    refs/heads/master
INFO [8355617a] Finished in 9.683 seconds with exit status 0 (successful).

我读了一些posts,但我无法找到任何解决方案。

3 个答案:

答案 0 :(得分:16)

<强> TL; DR

# start/restart ssh-agent
eval "$(ssh-agent -s)"

# add the desired ssh-key
ssh-add ~/.ssh/id_rsa

有关详细信息,请参阅:https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

我过去经历过同样的问题,这篇文章帮助我解决了很多问题: http://www.antleon.com/2014/04/rails-capistrano-deployment-ssh-error-reading-response-length-from-authentication-socket/

希望它有所帮助。

答案 1 :(得分:2)

我不确定为什么会这样,但我已经在我的一些部署中看到它并且它们继续完美地工作。我认为这个错误可以忽略。

答案 2 :(得分:0)

当我遇到这种情况时,那是因为ssh-agent不再运行了。我重新启动它并检查当我运行ssh-add -L

时列出了一个键