Search code examples
gitamazon-ec2capistrano3ruby-on-rails-4.1ruby-2.1

git authentication error in capistrano 3.2.1


i have added the server_users rsa.pub key to git,the error i'm getting is as

Running /usr/bin/env git ls-remote -h http://git.example.com/nishant/pro-gasket.git on 52.24.70.121
DEBUG[c40f8fa6] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/pro-gasket/git-ssh.sh /usr/bin/env git ls-remote -h http://git.example.com/nishant/pro-gasket.git )
DEBUG[c40f8fa6]     fatal: Authentication failed for 'http://git.example.com/nishant/pro-gasket.git/'
DEBUG[c40f8fa6]     
DEBUG[c40f8fa6] Finished in 1.549 seconds with exit status 128 (failed).
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 52.24.70.121: exit
/home/codebajra/.rvm/gems/ruby-2.1.3@pro-gasket/gems/capistrano-3.2.1/lib/capistrano/tasks/git.rake:28:in `exit'  

git version in server is 1.9.1


Solution

  • since server uses ssh to connect to github, so use the repourl for ssh one.