简体   繁体   中英

Rails, Capistrano, and Dreamhost — Key Verification Failure

I'm trying to setup my Rails app on Dreamhost and I'm at the stage of trying to get Capistrano setup.

I have a git server setup on the same server as where I'm deploying. I have my SSH keys setup (I think) -- at least I can SSH in no problem.

Both 'cap deploy:setup' and 'cap deploy:check' run without error.

But then when I try to run 'cap deploy:migrations' I get the following:

* executing `deploy:migrations'
* executing `deploy:update_code'
 updating the cached checkout on all servers
 executing locally: "git ls-remote user@server.dreamhost.com:git/project.git master"
 command finished in 1065ms
* executing "if [ -d /home/user/domain.com/shared/cached-copy ]; then cd /home/user/domain.com/shared/cached-copy && git fetch  origin && git fetch --tags  origin && git reset  --hard 406475489f2934554f5b80cf17e44576ba7ee02f && git clean  -d -x -f; else git clone user@domain.dreamhost.com:git/project.git /home/user/domain.com/shared/cached-copy && cd /home/user/domain.com/shared/cached-copy && git checkout -b deploy 406475489f2934554f5b80cf17e44576ba7ee02f; fi"
servers: ["server.dreamhost.com"]
[server.dreamhost.com] executing command
** [server.dreamhost.com :: out] Cloning into /home/user/domain.com/shared/cached-copy...

Here's where the problem is:

** [server.dreamhost.com :: err] Host key verification failed.
** [server.dreamhost.com :: err] fatal: The remote end hung up unexpectedly
command finished in 157ms
failed: "sh -c 'if [ -d /home/user/domain.com/shared/cached-copy ]; then cd /home/user/domain.com/shared/cached-copy && git fetch  origin && git fetch --tags  origin && git reset  --hard 406475489f2934554f5b80cf17e44576ba7ee02f && git clean  -d -x -f; else git clone user@server.dreamhost.com:git/project.git /home/user/domain.com/shared/cached-copy && cd /home/user/domain.com/shared

I've erased my keys and created new ones (again, SSH'ing into the server works fine) to no avail. This is probably a really basic misunderstanding on my part, but I can't figure it out.

1) SSH into Dreamhost

2) > ssh bitbucket.org

You will see something like:

The authenticity of host 'bitbucket.org (131.103.20.168)' can't be established.
RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40.
Are you sure you want to continue connecting (yes/no)?

3) Type in "yes"

Warning: Permanently added 'bitbucket.org,131.103.20.168' (RSA) to the list of known hosts.

Now bitbucket.org is correctly added to .known_hosts .

Please remove /home/user/.ssh/known_hosts on the dreamhost server and try again. The server is accessing itself when clonding from user@server.dreamhost.com:git/project.git .

It the IP of this server changed you will run into that kind of problems.

I have an identical setup & have been stymied at the same point in the deployment. In order to finish the investigation, I will add the following details:

on dreamhost server (home/user/.ssh/): authorized_keys and id_rsa.

ssh user@server.dreamhost.com = no problem, but I was asked to verify key authenticity.

cap deploy:setup = no problems.
cap deploy:check = no problems.
cap deploy:migrations = failure (host key verification.)

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM