Welcome Guest | Login

Capistrano Deployment Problem

Hello,

I just set up my first hostingrails.com account to check things out.

After setting up svn, I noticed that it is always asking me to input my password twice to check out the repos.

This double-password appears to be breaking cap deploy functions. Example:

  * executing "svn checkout -q  -r10 svn+ssh://[[etc]]"
   servers: ["jeremedia.com"]
Password: *****
   [jeremedia.com] executing command
** [err] Host key verification failed.
** [err] svn: Connection closed unexpectedly
Any assistance would be appreciated!

-jeremy


2007-10-17 03:32 AM

To be clear, the same svn checkout command cap is trying will succeed if copy-pasted into another terminal and run as a straight svn checkout, but only after entering the password twice. Cap doesn't/can't try twice and fails.

2007-10-17 03:37 AM

Jeremedia -

Could you quickly verify if you got your Capitrano setup properly, the deploy/rb file ?
Our tutorial link below will be helpful with this.
http://www.hostingrails.com/forums/wiki_thread/5

2007-10-17 04:34 AM

I actually followed these instructions:
http://www.hostingrails.com/forums/wiki_thread/46

All of Capistrano's non-SVN functions work without problem. Capistrano simply can't check out a working copy of the app via SVN. Cap's checkout fails every time with:

** [err] Host key verification failed.

2007-10-17 09:48 AM

The issue seems to be caused because of the ssh session saved at your local end. You can refer http://www.hostingrails.com/forums/deployment_troubleshooting_thread/556, to get a better idea. The work around for the same is to get rid of known_hosts file from your local machine. do try out the same and  do let us know if the issue is resolved.

2007-10-17 10:28 AM

Regards,
Rahul
I had already tried that, to no success.

I can SSH into the server no problem. The problem is the double-request of the password when doing an SVN checkout.

The password is requested twice even when checking out a copy on the server, when connected via SSH. The password is requested, I input the password, it is requested again, I input again, and the checkout completes.

This double-request is independent of Capistrano, but it is what is breaking Capistrano's process.

Much thanks for the help!

2007-10-17 10:47 AM

Hello,

It seems that Capistrano checks the SVN twice, once to find the latest version number when it is on the local development machine, and next to checkout the latest version from the repository on the remote server machine.

I suggest you to ssh into the server and do a temp checkout first. And then the same on your local development machine.

$ svn co http://path.to.svn/svn/trunk/
$ rm -rf trunk

You can then just leave the deploy.rb script as:

set :repository, "http://path.to.svn/svn/#{application}/trunk"

Also do try removing the ssh keys and adding them again.

2007-10-17 11:41 AM

Regards,
Rahul
I'm having the same problem... even if I delete the known_hosts file locally, on cap deploy:cold, the system has the following request - if I say yes, the known_hosts file is created again:

The authenticity of host 'my.host_name.com (12.34.56.8)' can't be established.
RSA key fingerprint is 62:6b:5b:87:33:12:35:26:49:44:73:4c:88:53:4b:ce.
Are you sure you want to continue connecting (yes/no)?

2007-10-23 10:12 PM

Also, I'm wondering if someone would give more detail about how exactly to do this:

(From Rahul's post above):

I suggest you to ssh into the server and do a temp checkout first. And then the same on your local development machine.

$ svn co http://path.to.svn/svn/trunk/
$ rm -rf trunk

If I check out the app using:
$ svn co http://path.to.svn/svn/trunk/
and then do this:
$ rm -rf trunk

What's the point of that?  It just checks out the code and then deletes it... what does that do for me?

Thanks for the help.

2007-10-23 10:20 PM

Hello  Dkanders,

Can you give it a try...

2007-10-23 11:22 PM

Regards,
Rahul
I ran into this today as well.  The tutorial on hostingrails is incomplete.

Add this to your deploy.rb file:

# Won't work on windows otherwise, see
# http://groups.google.com/group/capistrano/browse_thread/thread/13b029f75b61c09d
default_run_options[:pty] = true

and give it a try...

2007-10-24 01:04 AM

Hello Wsargent,

Thanks for the piece of information. We do really appreciate your help and please do share similar fixes in our forums so that it will be helpful for others.

2007-10-24 01:12 AM

Regards,
Rahul
That worked for me too... thanks Wsargent!!!

2007-10-24 09:01 AM

Fixed if for me too.

Admin: Could you make this a sticky or update the capistrano tutorial please as its taken me two hours to find this fix.

Thanks, Jeremy

2007-11-11 03:35 PM

Fixed it for me too (using Capistrano 2.1 from Windows).
It makes sense to update the (otherwise good) tutorial.

2007-11-21 02:41 PM

The tutorial is a wiki so anyone can edit it - but I went ahead and added the line.  Thanks guys.

2007-11-21 05:42 PM

I had the exact same problems as in this thread, but im running from a Mac OSX 10.4 computer. So that fix didnt work for me. Anyone else have this problem on OSX?

2008-01-21 05:36 PM

Hi,

Could you try adding the below into your deploy.rb to check it back again ?

ssh_options[:paranoid] = false

2008-01-21 06:18 PM

tried making paranoid false and that didnt work either...

2008-01-22 03:04 AM

Am I correct in thinking that if I can connect to my server from my computer by typing ssh myusername@mydomain.com and I don't have to enter my password, then my ssh keys are working properly?


Just trying to work through this step by step.

2008-01-22 03:10 AM

Yes... that indicates that ssh keys are working fine.

2008-01-22 03:54 AM

Regards,
Rahul
I am having this exact problem, on OSX Tiger. On my OSX Leopard machine, it seems to work OK. I've tried all of the above.

-Chad

2008-01-29 10:00 AM

Hi - Are you able to  login to the server successfully via ssh using the keys ?

2008-01-29 12:22 PM

HostingRails Support
yes, and also without them. It should also be noted that we have several hosting plans with you, and they all are doing the same thing. When I try to cap deploy with my OSX 10.4 machine, I get

** [err] Host key verification failed.
** [err] svn: Connection closed unexpectedly

But, with my OSX 10.5 machine, I can deploy just fine (I don't know if the version of OS even matters, I just thought I'd mention it). I've tried using keys and not using keys as well, always with the same result.

2008-01-29 12:26 PM

Hello. I can't deploy using cap either, as noted in my previous post. Im running on a 10.4 machine and no matter what i tried i couldnt get it to work. I was getting the same errors, but my ssh was working. I would love to understand why this isn't working, but what I wanted more was to get my app out there. After hours of frustration I came across the plugin...
http://trac.extendviget.com/lab/wiki/CapistranoRsyncWithRemoteCache


I found in a post that it worked for people having the same problem as us. It worked for me, but i would still like to know why it didnt work in the first place....

2008-01-29 05:26 PM

Hi.

Now I'm getting the following, no matter which machine I try to deploy with, no matter if I do ssh_options[:paranoid] = false, and no matter if i config deploy.rb with my ssh key info or not:

** [err] ssh_exchange_identification: Connection closed by remote host
** [err] svn: Connection closed unexpectedly

I'm opening up a ticket.

2008-02-06 10:46 AM

I had the same problem, and resolved it this way:

Since I'm also hosting my subversion repository at hostingrails.com, and capistrano executes the checkout command on the deployment server, I need my repository set to:
file:///home/username/svn/....

and NOT:
svn+ssh://user@username/home/username/svn...

That path only works from my development machine.

2008-07-06 07:22 PM

Thanks! Adding:

ssh_options[:paranoid] = false
default_run_options[:pty] = true

to my deploy.rb worked great in solving this problem!

2008-08-26 03:41 PM

oskarlissheimboethius.com
I had the same problem with Capistrano prompting me for my password even though my SSH keys were correctly figured.

I finally figured out the solution and decided to blog about it here: http://www.fromjavatoruby.com/2008/10/capistrano-subversion-password.html

2008-10-31 03:26 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.