I just upgraded my Rails project from Capistrano 1 to 2 and realised
that the tasks using "run" are failing. I then RTFM and tried to
break it down to the most simple case and I found that even 'cap
invoke COMMAND="ls"' is failing:
# cap -vvvv invoke COMMAND="ls"
** message
* executing `invoke'
* executing "ls"
servers: ["my.server"]
[my.server] executing command
command finished
command "ls" failed on my.server
Passing multiple -v options doesn't make the command mose verbose. It
can't be the user credentials because scp works.
This task is failing, too:
task :bla do
run "ls"
end
with the same error.
How can I debug this? Is there some sort of trace of whatever to tell
me WHY "ls" is failing? Usually when commands are failing cap returns
the error message on the server but not here.
I searched the forum to no avail.
Any help is highly appreciated, regards, Niko.
Another option to increase verbosity is to turn on the SSH
debugging...but that is VERY verbose, and mostly meaningless to the
uninitiated. Still, you're welcome to try it:
ssh_options[:verbose] = :debug
You can email me the output (off-list) and I'll take a look at it.
Please do send your Capfile and config/deploy.rb as well, though.
- Jamis
# ======================================
# REQUIRED VARIABLES
# ======================================
set :application, "$the_domain" # Applikation name
set :repository, "http://$the_svn_server/$the_domain/trunk/"
# ======================================
# OPTIONAL VARIABLES
# ======================================
set :deploy_to, "/files/#{application}"
set :user, "$the_user"
set :use_sudo, false
set :domain, "#{user}.$the_server" # All roles are the same
# ======================================
# ROLES
# ======================================
role :web, domain
role :app, domain
role :db, domain
# ======================================
# SSH OPTIONS
# ======================================
ssh_options[:port] = 981
ssh_options[:verbose] = :debug
# ======================================
# TASKS
# ======================================
task :bla do
run "ls"
end
The Capfile is a plain
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'config/deploy'
I'll send you the output of the verbose ssh thing off list.
Thanks for caring, Niko.
Capistrano should be able to be configured to use either behaviour.
I filed this as bug: http://dev.rubyonrails.org/ticket/9290 (I got my
own bug now! :-)
Thanks, Jamis for all the help.
Niko.