【问题标题】:Capistrano fails authenticate with gitCapistrano 无法通过 git 进行身份验证
【发布时间】:2016-10-19 20:05:28
【问题描述】:

在尝试使用 capistrano 部署网站时,我收到以下消息:

  INFO ---------------------------------------------------------------------------
  INFO START 2016-10-19 21:56:37 +0200 cap staging deploy
  INFO ---------------------------------------------------------------------------
  INFO [95790a6d] Running /usr/bin/env mkdir -p /tmp as mysite@staging.mysite.com
 DEBUG [95790a6d] Command: /usr/bin/env mkdir -p /tmp
  INFO [95790a6d] Finished in 0.407 seconds with exit status 0 (successful).
 DEBUG Uploading /tmp/git-ssh-mysite-staging-username.sh 0.0%
  INFO Uploading /tmp/git-ssh-mysite-staging-username.sh 100.0%
  INFO [0cd82d0b] Running /usr/bin/env chmod 700 /tmp/git-ssh-mysite-staging-username.sh as mysite@staging.mysite.com
 DEBUG [0cd82d0b] Command: /usr/bin/env chmod 700 /tmp/git-ssh-mysite-staging-username.sh
  INFO [0cd82d0b] Finished in 0.029 seconds with exit status 0 (successful).
  INFO [0265a2c7] Running /usr/bin/env git ls-remote --heads git@bitbucket.org:username/mysite.git as mysite@staging.mysite.com
 DEBUG [0265a2c7] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-mysite-staging-username.sh" ; /usr/bin/env git ls-remote --heads git@bitbucket.org:username/mysite.git )
 DEBUG [0265a2c7]       conq: repository access denied.
 DEBUG [0265a2c7]       fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

但是,当我以同一用户身份手动运行此命令时,一切正常:

$ export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-mysite-staging-username.sh" ; /usr/bin/env git ls-remote --heads git@bitbucket.org:username/mysite.git
928c1e393778f25869f14958151c4ea1dc7d68b6    refs/heads/master

我已验证我的公钥是存储库的 bitbucket 部署密钥。这以前工作得很好。有什么办法可以进一步调试吗?

【问题讨论】:

    标签: git capistrano bitbucket


    【解决方案1】:

    我找到了解决方案here。显然ssh-agent 需要运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-01
      • 2014-01-05
      • 1970-01-01
      • 1970-01-01
      • 2015-09-15
      • 2017-08-31
      • 1970-01-01
      • 2018-12-28
      相关资源
      最近更新 更多