使用capistrano3在部署时写入身份验证套接字时出错

时间:2014-04-30 06:43:48

标签: git capistrano capistrano3

当我使用capistrano 3进行部署时,我有一个错误,但它并不致命,最终部署成功。

我的错误讯息是: 写入身份验证套接字时出错

此错误消息已显示3次。

像这样:

DEBUG [ac3445fe] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/my-project/git-ssh.sh /usr/bin/env git ls-remote -h git@github.com:me/my-project.git )
DEBUG [ac3445fe]    Error writing to authentication socket.
DEBUG [ac3445fe]    b9e8e722970ec7980e2062f481e7147bde7e7363    refs/heads/branch1
DEBUG [ac3445fe]    1a23c87450e24a83aa97c4765750c60d683ecf36    refs/heads/master
DEBUG [ac3445fe]    fc070f0e7c0b44bb0ae519beced3e00cb0dbc6cb    refs/heads/branch2
DEBUG [ac3445fe]    2936c7921bdae0003d845dde142bf8b11f29f0a3    refs/heads/branch3
DEBUG [ac3445fe]    Error writing to authentication socket.
DEBUG [ac3445fe] Finished in 7.479 seconds with exit status 0 (successful).

和此:

DEBUG [2c4bb65f] Command: cd /var/www/my-project/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/my-project/git-ssh.sh /usr/bin/env git remote update )
DEBUG [2c4bb65f]    Fetching origin
DEBUG [2c4bb65f]    Fetching origin
DEBUG [2c4bb65f]    Error writing to authentication socket.

我可以处理这个错误,但如果我能解决它,会更好:)

1 个答案:

答案 0 :(得分:1)

这似乎是ssh-agent的问题。你有没有正确地开始ssh-agent?尝试:

ssh-agent bash
ssh-add /path/to/your/private_key
run-your-command-again

如果此方法有效,请确保您的操作系统正确启动ssh-agent,并在桌面会话启动时直接添加您的密钥。这将使您的生活更轻松,因为每次打开新终端时,您都不必一次又一次地重复上述操作。当然你可以将这些行添加到.bashrc但如果你用密码保护你的密钥,则每次打开一个新shell时都需要输入密码。