Problem with basic "cap invoke" command

285 views
Skip to first unread message

niko

unread,
Aug 16, 2007, 4:43:03 AM8/16/07
to Capistrano
Hi everybody,

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.

Jamis Buck

unread,
Aug 16, 2007, 9:48:50 AM8/16/07
to capis...@googlegroups.com
What do your Capfile and config/deploy.rb look like?

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

niko

unread,
Aug 17, 2007, 8:02:29 AM8/17/07
to Capistrano
This is the deploy.rb (I've change sensitive stuff into $the_bla style
variables; they're just strings in the orig. file):

# ======================================
# 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.

niko

unread,
Aug 17, 2007, 10:53:06 AM8/17/07
to Capistrano
This turned out to be an issue with my paranoid shared host not
allowing to spawn new shells and Capistrano2 using "ssh sh -c COMMAND"
where Capistrano1 used "ssh COMMAND". This way Capistrano is more
compatible to hosts with non-POSIX shells like tcsh.

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.

Reply all
Reply to author
Forward
0 new messages