3

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.

Matt Martin
  • 513
  • 2
  • 7
  • 18

3 Answers3

0

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.

nhahtdh
  • 55,989
  • 15
  • 126
  • 162
0

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.

iltempo
  • 15,718
  • 8
  • 61
  • 72
  • I have **/.ssh/authorized_keys** but no **known_hosts** file. Are these files the same thing or am I missing something here? – Matt Martin Mar 02 '12 at 22:11
  • It's not the same. authorized_keys contains a list of public ssh keys that are allowed to connect without providing a password. known_hosts is a file that tracks name/ip address pairs of all servers that have been connected to vis ssh. This prevents dns spoofing. If the ip address changes from a hostname ssh is throwing an error the same you see in your log. Can you try to connect from your server to your server pls? Run _ssh user@server.dreamhost.com_ on the server. Does it work? – iltempo Mar 03 '12 at 10:43
0

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.)
Brian Piercy
  • 631
  • 1
  • 7
  • 22