gitgithubdeploymentcapistranonitrousio

Nitrous.io: Deploying with capistrano results in "ERROR: Repository not found" despite being able to view remote, push/pull, etc


I am setting up a Nitrous.io box and can't use capistrano to deploy my code from github to the staging server. The remote is set up and I've added the nitrous public ssh key to the server (I can ssh in from the Nitrous terminal) and to my github account, but when I try to deploy I get:

The deploy has failed with an error: #<SSHKit::Runner::ExecuteError: Exception while executing on host http01-staging.myapp.com: git exit status: 1                                  
git stdout: Nothing written                                                                                                                                                            
git stderr: Error reading response length from authentication socket.                                                                                                                  
ERROR: Repository not found.                                                                                                                                                           
fatal: Could not read from remote repository.                                                                                                                                          

Please make sure you have the correct access rights                                                                                                                                    
and the repository exists.                                                                                                                                                             
error: Could not fetch origin 

The repository certainly exists, and I've already successfully pushed and pulled branches to/from it with this Nitrous box. Is there something I'm missing here?


Solution

  • The answer was that I had to run the following commands from the Nitrous.io terminal:

    eval `ssh-agent`
    ssh-add
    

    Not sure why I was able to complete the other actions (ssh into server, pull from/push to GitHub) without having done this.