Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git repository not recognized during rails deploy with capistrano

I'm trying to figure out why I'm getting an error from my remote git repository when I try to deploy my rails app. It's telling me that it's not a git repository, yet I can push and pull from it without issue. However I recently had issues with git not being found by bash, but it was simply a path variable issue that cropped up when I installed macports (I think). It's now fixed. Thanks in advance for any help you might be able to provide! The error output is below:

my-MacBook-Pro:project myUser$ cap deploy:update
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote [email protected]/usr/local/git_root/project.git master"
fatal: '[email protected]/usr/local/git_root/project.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
*** [deploy:update_code] rolling back
  * executing "rm -rf /usr/local/www/sites/project.example.ca/releases/20120403193900; true"
    servers: ["project.example.ca"]
    [project.example.ca] executing command
    [project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-1.9.2-p290@project' -c 'rm -rf /usr/local/www/sites/project.example.ca/releases/20120403193900; true'
    command finished in 639ms
Command git ls-remote [email protected]/usr/local/git_root/project.git master returned status code pid 1815 exit 128
like image 937
J K Avatar asked Apr 03 '12 20:04

J K


3 Answers

Looks like you've got a malformed Git URL:

git ls-remote [email protected]/usr/local/git_root/project.git master

Should be:

git ls-remote [email protected]:/usr/local/git_root/project.git master

They follow SCP protocol (see the git-clone manpage for more).

like image 85
Nic Avatar answered Oct 14 '22 00:10

Nic


Your key must be available to ssh-agent

I had same problem. Solved with "ssh-add yourkey" , where yourkey is the path do id_rsa, and you can check with: ssh-add -L, if ok will return your public key

like image 20
Juarez Lustosa Avatar answered Oct 14 '22 01:10

Juarez Lustosa


Turns out the problem was that the repository address WAS malformed as the user above suggested. However, the problem was resolved by adding an 'ssh:' prefix to the repository address. Thanks for the suggestions!

like image 1
J K Avatar answered Oct 14 '22 01:10

J K