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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31298464/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:11:05  来源:igfitidea点击:

Error reading response length from authentication socket

gitruby-on-rails-4capistrano3

提问by Mezbah

In my ruby on rails project, I am using capistrano , unicorn, postgresql and nginx for deploying my project. when I run cap production git:checkI am getting this error:

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

Error reading response length from authentication socket.

log trace:

日志跟踪:

INFO [13522bc0] Running /usr/bin/env mkdir -p /tmp/deploy_test/ as [email protected]
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 [email protected]
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 [email protected]:mezbahalam/deploy_test.git as [email protected]
DEBUG [8355617a] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/deploy_test/git-ssh.sh /usr/bin/env git ls-remote --heads [email protected]: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).

I read some postsbut I can't figureout any solution.

我读了一些帖子,但我想不出任何解决方案。

回答by Olivier Buffon

TL;DR

TL; 博士

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

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

See: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/for more details.

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



I went through the same issue in the past and this post helped me a lot to fix it: http://www.antleon.com/2014/04/rails-capistrano-deployment-ssh-error-reading-response-length-from-authentication-socket/

我过去遇到过同样的问题,这篇文章帮我解决了很多问题:http: //www.antleon.com/2014/04/rails-capistrano-deployment-ssh-error-reading-response-length-从身份验证套接字/

Hope it helps.

希望能帮助到你。

回答by will_in_wi

I'm not sure why this occurs, but I've seen it on a number of my deploys and they continue to work perfectly. I think this error can be ignored.

我不确定为什么会发生这种情况,但我已经在我的许多部署中看到了它,并且它们继续完美地工作。我认为这个错误可以忽略。

回答by Will Sheppard

When this happened to me, it was because the ssh-agent wasn't running anymore. I restarted it and checked there was a key listed when I ran ssh-add -L

当这发生在我身上时,那是因为 ssh-agent 不再运行了。我重新启动它并检查我运行时是否列出了一个密钥ssh-add -L