I've inherited a project and am comfortable with the development side of things, but have poor sysops, and the Capistrano deploy is failing. For a project that has been deployed before by the previous dev:
cap deploy:check
runs fine, resulting in
You appear to have all necessary dependencies installed
But when I try to deploy, I get
...
ERROR: Repository not found.
...
I have:
At the moment, when agent forwarding off, the SSH into github from the server is returning the info for the previous dev, who still has access to the github repo.
Hi xxxxxx! You've successfully authenticated, but GitHub does not provide shell access.
When agent forwarding is on, I show as being the authenticated user.
Any tips on resolving this? More than happy for a decent URL that goes through troubleshooting this.
OK, figured it out by a process of elimination. It was the following line in 'deploy.rb'
set :deploy_via, "remote_cache"
When this is commented out it deploys fine. If I uncomment it, it breaks again with the same error. So that certainly seems to be the problem.
I have no idea why this would be happening. But for now, I'll close this.
I know I am way late to the game but I just ran into this issue with a project that I moved from Github to Bitbucket. I was able to checkout, update, push/pull from the repo on Bitbucket without issue however my initial cap deploy broke after moving to Bitbucket.
The short answer is that the remote cache on your server needs to be deleted. SSH into your server, and remove the entire cached-copy
dir found inside the shared
directory created by capistrano. The location of your shared and releases directory may not be the same as mine but this is all I had to do:
rm -rf www/shared/cached-copy
After this I was able to deploy without issue.
Hope that helps someone else that may run into this issue.
For troubleshooting tips--especially because you are deploying from a GitHub repo--I suggest reviewing the GitHub guide to Deploying with Capistrano . That guide also links to another you should review on managing deploy keys .
default_run_options[:pty]
may be missing or incorrect in config/deploy.rb
. This could cause the "successful auth, but no shell access for you" error.
Regarding the script still using the previous developer's credentials, the system account the capistrano script logs in with on the server (eg set :user, "deployer"
) may have the previous developer's private key in ~/.ssh
which the script may expect to use. If this is the case, you should reconfigure the script to use SSH agent forwarding according to the guides which would have the script start using your keys.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.