0

I have an Ubuntu server which can successfully deploy a Rails project to. I have created a new project, and would like to deploy this to the same server. But i am having a problem with accessing the bitbucket repo the code is stored on during the Capistrano deployment.

DEBUG [60fbbd0f] Command: /usr/bin/env chmod +x /tmp/<project_name>/git-ssh.sh
INFO [60fbbd0f] Finished in 0.098 seconds with exit status 0 (successful).
INFO [b7870f98] Running /usr/bin/env git ls-remote --heads git@bitbucket.org:rmac/<project_name>.git as www-data@88.xxx.xxx.xxx
DEBUG [b7870f98] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/<project_name>/git-ssh.sh /usr/bin/env git ls-remote --heads git@bitbucket.org:rmac/<project_name>.git )
DEBUG [b7870f98]    conq: repository does not exist.
DEBUG [b7870f98]    fatal: Could not read from remote repository.
DEBUG [b7870f98]    
DEBUG [b7870f98]    Please make sure you have the correct access rights
DEBUG [b7870f98]    and the repository exists. 

I have tried this

SSHKit::Runner::ExecuteError

and other answers but to no avail. I have checked my server processes and ssh agent is running. I find it difficult to understand seeing as my other project deploys to the server no problems. I am using the same machine, the same deployment keys, the same bitbucket account.

Any ideas?

Thanks

Community
  • 1
  • 1
rico_mac
  • 888
  • 8
  • 22
  • Have you tried https://github.com/capistrano-plugins/capistrano-ssh-doctor ? – will_in_wi May 24 '16 at 11:15
  • I had noticed this but seeing as it is two years old, I assume it wont have much to offer. – rico_mac May 24 '16 at 11:18
  • It's still pretty useful. At least, I'd suggest trying it before I tried to walk you through debugging this. – will_in_wi May 24 '16 at 11:18
  • ok thanks man will give it a whirl now and report back – rico_mac May 24 '16 at 11:19
  • @will_in_wi yeah it hasn't told me anything new. the only thing I know for sure now is that ssh kit is running for sure. rest is the same as before. It trips on this ssh:remote:repo_access – rico_mac May 24 '16 at 11:23
  • Are you depending on ssh-agent forwarding or deploy keys? If the latter, confirm that the key is added to the project. If the former, try to log into the server manually using ssh -A and git clone the project. – will_in_wi May 24 '16 at 11:25
  • @will_in_wi ok so i am working with the former. and tried to clone the repo and received this... no such identity: /home/sites/.ssh/bitbucket_rsa: No such file or directory – rico_mac May 24 '16 at 11:28
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/112783/discussion-between-will-in-wi-and-rico-mac). – will_in_wi May 24 '16 at 11:55

1 Answers1

1

(Answer figured out in chat)

Since ssh-agent is being used, use ssh -A destination_server and git clone to confirm that ssh-agent is working.

Since another project is deploying, confirm that the Bitbucket repo URL is correct. (this ended up being the answer)

will_in_wi
  • 2,623
  • 1
  • 16
  • 21