samedi 26 juillet 2014

services web Amazon - déploiement Rails app avec Capistrano - Permission denied (publickey) - Stack Overflow


I'm trying to deploy one application, when I run cap deploy:check all looks like fine but when I try to deploy it then I get the below error:


Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/app/releases/20140327233712; true"
servers: ["IP"]
[IP] executing command
command finished in 676ms
Command git ls-remote git@bitbucket.org:user/app.git staging returned status code pid 5458 exit 128

I've generated the Key in my server (ssh-keygen -t rsa -C "lorem..") and then I've added this key in bitbucket, but I still have problems with the permissions.


EDIT:


In the deploy.rb file I'm using the key that AWS generated when I created the new instance and I saved it to my local machine: ssh_options[:keys] = ["/Users/user/Documents/app.pem"] then I generated the key in my server and I added it to Bitbucktet ("home/ubuntu/.ssh/id_rsa.pub"), so I think that I need add the key of my local("app.pem") machine to Bitbucket but when I try to do it I get and error in Bitbucket: Invalid SSH key (ssh-keygen).




Make sure the user that the capistrano process is connecting to Bitbucket as has access to the private key you generated and is passing it when attempting to connect to Bitbucket.


The error you get: Permission denied (publickey) is due to a mismatch between the private key capistrano is using to connect with and the public key you have stored in Bitbucket.



I'm trying to deploy one application, when I run cap deploy:check all looks like fine but when I try to deploy it then I get the below error:


Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/app/releases/20140327233712; true"
servers: ["IP"]
[IP] executing command
command finished in 676ms
Command git ls-remote git@bitbucket.org:user/app.git staging returned status code pid 5458 exit 128

I've generated the Key in my server (ssh-keygen -t rsa -C "lorem..") and then I've added this key in bitbucket, but I still have problems with the permissions.


EDIT:


In the deploy.rb file I'm using the key that AWS generated when I created the new instance and I saved it to my local machine: ssh_options[:keys] = ["/Users/user/Documents/app.pem"] then I generated the key in my server and I added it to Bitbucktet ("home/ubuntu/.ssh/id_rsa.pub"), so I think that I need add the key of my local("app.pem") machine to Bitbucket but when I try to do it I get and error in Bitbucket: Invalid SSH key (ssh-keygen).



Make sure the user that the capistrano process is connecting to Bitbucket as has access to the private key you generated and is passing it when attempting to connect to Bitbucket.


The error you get: Permission denied (publickey) is due to a mismatch between the private key capistrano is using to connect with and the public key you have stored in Bitbucket.


0 commentaires:

Enregistrer un commentaire