J K
J K

Reputation: 495

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

Upvotes: 6

Views: 7786

Answers (4)

Juarez Lustosa
Juarez Lustosa

Reputation: 831

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

Upvotes: 3

J K
J K

Reputation: 495

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!

Upvotes: 1

Nic
Nic

Reputation: 13761

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).

Upvotes: 5

Mizuho
Mizuho

Reputation: 90

Could you try deleting the local repository and re-cloning it?

Upvotes: -3

Related Questions