I have a SVN (svn+ssh) on an EC2 server that I am trying to run cap
deploy:update as part of the post-commit hook.
I am using pubkey authentication. My deployment user is named
'dasdeploy'. This user exists on my SVN server, and can ssh into all
my ec2 instances (and from my ec2 instances back to my svn server)
without password prompt (so the dasdeploy rsa.pub is in
authorized_hosts on all servers).
When I ssh into my svn server and run the post-commit hook, everything
works fine. When I do an SVN commit as this user, and the hook
executes (as this user) I get the following error:
D, [2010-12-28T03:43:11.524258 #3278] DEBUG --
net.ssh.authentication.session[3fdec15d31f0]: beginning authentication
of `dasdeploy'
D, [2010-12-28T03:43:11.524438 #3278] DEBUG --
tcpsocket[3fdec15e34c4]: queueing packet nr 4 type 5 len 28
D, [2010-12-28T03:43:11.524532 #3278] DEBUG --
tcpsocket[3fdec15e34c4]: sent 52 bytes
D, [2010-12-28T03:43:11.561024 #3278] DEBUG --
tcpsocket[3fdec15e34c4]: read 52 bytes
D, [2010-12-28T03:43:11.561203 #3278] DEBUG --
tcpsocket[3fdec15e34c4]: received packet nr 4 type 6 len 28
D, [2010-12-28T03:43:11.561364 #3278] DEBUG --
net.ssh.authentication.session[3fdec15d31f0]: trying publickey
D, [2010-12-28T03:43:11.561512 #3278] DEBUG --
net.ssh.authentication.agent[3fdec15d1d50]: connecting to ssh-agent
E, [2010-12-28T03:43:11.561686 #3278] ERROR --
net.ssh.authentication.agent[3fdec15d1d50]: could not connect to ssh-
agent
E, [2010-12-28T03:43:11.561891 #3278] ERROR --
net.ssh.authentication.session[3fdec15d31f0]: all authorization
methods failed (tried publickey)
connection failed for: domU-12-31-39-0F-2A-15.compute-1.internal
(Net::SSH::AuthenticationFailed: dasdeploy)
Here is my deploy.rb:
ssh_options[:keys] = "#{ENV['HOME']}/.ssh/dasdeploy_rsa"
ssh_options[:verbose] = :debug
ssh_options[:auth_methods] = "publickey"
ssh_options[:forward_agent] = true
ssh_options[:config]=false
default_run_options[:pty] = true
Here is the debug on the successful run:
D, [2010-12-28T03:14:32.344108 #2848] DEBUG --
net.ssh.authentication.session[3fa54a0c9584]: beginning authentication
of `dasdeploy'
D, [2010-12-28T03:14:32.344285 #2848] DEBUG --
tcpsocket[3fa54a0d9ccc]: queueing packet nr 4 type 5 len 28
D, [2010-12-28T03:14:32.344390 #2848] DEBUG --
tcpsocket[3fa54a0d9ccc]: sent 52 bytes
D, [2010-12-28T03:14:32.380870 #2848] DEBUG --
tcpsocket[3fa54a0d9ccc]: read 52 bytes
D, [2010-12-28T03:14:32.381043 #2848] DEBUG --
tcpsocket[3fa54a0d9ccc]: received packet nr 4 type 6 len 28
D, [2010-12-28T03:14:32.381192 #2848] DEBUG --
net.ssh.authentication.session[3fa54a0c9584]: trying publickey
D, [2010-12-28T03:14:32.381332 #2848] DEBUG --
net.ssh.authentication.agent[3fa54a0c815c]: connecting to ssh-agent
E, [2010-12-28T03:14:32.381523 #2848] ERROR --
net.ssh.authentication.agent[3fa54a0c815c]: could not connect to ssh-
agent
D, [2010-12-28T03:14:32.381922 #2848] DEBUG --
net.ssh.authentication.methods.publickey[3fa54a0c81d4]: trying
publickey
So how can the exact same script, running by the exact same user fail?
Its like when SVN executes post-commit it is not using (or finding) my
dasdeploy_rsa file.
The only thing I can think of, is when im running the post-commit hook
manually, that I have the bash/shell environment setup. I am running
ubuntu 10.10 server, and i've noticed ssh-add dasdeploy_rsa fails (ssh-
add fails as well). So thats why i explicitly added
'ssh_options[:keys] = "#{ENV['HOME']}/.ssh/dasdeploy_rsa"' and
'ssh_options[:config]=false' to ignore .ssh/config all together.
anyone have any ideas? i've spent way too many hours on this fairly
easy problem....
--
* You received this message because you are subscribed to the Google Groups
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/capistrano?hl=en