Capistrano deploy failing on /public/system "No such file or

trying like mad to get this to work.

cap setup works fine, sets up the dir structure on dreamhost (tho setup
doesnt create the “current” symlink).

on deploy, i get:

  • executing “rm -rf
    /home/USERNAME/dwightnight.org/releases/20060722060159/log
    /home/USERNAME/dwightnight.org/releases/20060722060159/public/system
    &&\n
    ln -nfs /home/USERNAME/dwightnight.org/shared/log
    /home/USERNAME/dwightnight.org/releases/20060722060159/log &&\n ln
    -nfs
    /home/USERNAME/dwightnight.org/shared/system
    /home/USERNAME/dwightnight.org/releases/20060722060159/public/system”
    servers: [“dwightnight.org”]
    [dwightnight.org] executing command
    ** [out :: dwightnight.org] ln: creating symbolic link
    /home/USERNAME/dwightnight.org/releases/20060722060159/public/system' to /home/USERNAME/dwightnight.org/shared/system’
    ** [out :: dwightnight.org] : No such file or directory
    command finished
    *** [update_code] transaction: rollback
    • [update_code] rolling back
    • executing “rm -rf
      /home/USERNAME/dwightnight.org/releases/20060722060159”
      servers: [“dwightnight.org”]
      [dwightnight.org] executing command
      command finished
      rake aborted!
      command “rm -rf
      /home/USERNAME/dwightnight.org/releases/20060722060159/log
      /home/USERNAME/dwightnight.org/releases/20060722060159/public/system
      &&\\n ln -nfs /home/USERNAME/dwightnight.org/shared/log
      /home/USERNAME/dwightnight.org/releases/20060722060159/log &&\\n ln
      -nfs
      /home/USERNAME/dwightnight.org/shared/system
      /home/USERNAME/dwightnight.org/releases/20060722060159/public/system”
      failed
      on dwightnight.org

i have both a local and remote copy of the /public/system/ folders.

anyone know anything? thanks!

jason

I’m having the exact same problem in two of my projects.

I’m running a mac (os X 10.4) and deploying on Linux (debian)

Does somebody recognize this problem?

Have you find a resolution yet?

Regards,

Harm de Laat

** [out :: dwightnight.org http://dwightnight.org] ln: creating
symbolic link
/home/USERNAME/dwightnight.org/releases/20060722060159/public/system' to /home/USERNAME/dwightnight.org/shared/system’
** [out :: dwightnight.org http://dwightnight.org ] : No such file or
directory
I assume /home/USERNAME/dwightnight.org/shared/system does actually
exist on the remote server? Your local copy of public/system/ wont be
used, Neither will log/. They’re both symlink’d to the shared/system
and shared/log - obviously those files need to exist for that to happen.
They should have been set up when you ran the rake setup task.

Can you double check and let us know the outcome?

Steve

I’m sorry for hijacking this thread.
But I checked, and the directory exists on the remote filesystem.
For me the problem remains…

<…>

/home/USERNAME/dwightnight.org/releases/20060722060159/public/system"
failed on dwightnight.org

i have both a local and remote copy of the /public/system/ folders.

anyone know anything? thanks!

“/home/USERNAME/” part looks suspicious to me.

Regards,
Rimantas

http://rimantas.com/

I’m sorry for hijacking this thread.
But I checked, and the directory exists on the remote filesystem.
For me the problem remains…
Ok - what if you run the command manually yourself?

In the previous posters case, it would be:

ln -s /home/USERNAME/dwightnight.org/shared/system
/home/USERNAME/dwightnight.org/releases/20060722060159/public/system

Something is defiantly missing somewhere on the remote server and it’s
stopping that command from working.

Steve

“/home/USERNAME/” part looks suspicious to me.

I’m assuming they’re using USERNAME as a place holder to demonstrate the
actual setup :0) At least i hope so…

Steve

Ok,

I’m doing this:

clean up previous attempts on the remote system

rm /var/rails/kabisa_crm/ -Rf

on the local system (mac)

rake remote:exec ACTION=setup

(in /Users/harmdelaat/radrails/kabisa_crm)
loading configuration
/usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0
/lib/capistrano/recipes/standard.rb
loading configuration ./config/deploy.rb

  • executing task setup

  • executing “mkdir -p -m 775 /var/www/rails/kabisa_crm/releases
    /var/www/rails/kabisa_crm/shared/system &&\n mkdir -p -m 777
    /var/www/rails/kabisa_crm/shared/log”
    servers: [“kabisa_crm”]
    Password: *******

    [kabisa_crm] executing command
    command finished

I checked the remote filesystem and the files are created. There is a

directory /var/rails/kabisa_crm. It contains two subdirs: releases and
shared

then on the local system:

rake deploy

(in /Users/harmdelaat/radrails/kabisa_crm)
loading configuration
/usr/local/lib/ruby/gems/1.8/gems/capistrano-1.1.0
/lib/capistrano/recipes/standard.rb
loading configuration ./config/deploy.rb

  • executing task deploy
    ** transaction: start

  • executing task update_code

  • querying latest revision…

  • executing “if [[ ! -d /var/rails/kabisa_crm/releases/20060723120511
    ]];
    then\n svn co -q -r2
    http://xbase.textdriven.com/svn/kabisa_crm/var/rails/kabisa_crm/releases/20060723120511
    &&\n (test -e
    /var/rails/kabisa_crm/revisions.log || touch
    /var/rails/kabisa_crm/revisions.log && chmod 666
    /var/rails/kabisa_crm/revisions.log) && echo date +\"%Y-%m-%d %H:%M:%S\"
    $USER 2 20060723120511 >> /var/rails/kabisa_crm/revisions.log;\n
    fi”
    servers: [“kabisa_crm”]
    Password: *******

    [kabisa_crm] executing command
    command finished

  • executing “rm -rf /var/rails/kabisa_crm/releases/20060723120511/log
    /var/rails/kabisa_crm/releases/20060723120511/public/system &&\n ln
    -nfs
    /var/rails/kabisa_crm/shared/log
    /var/rails/kabisa_crm/releases/20060723120511/log &&\n ln -nfs
    /var/rails/kabisa_crm/shared/system
    /var/rails/kabisa_crm/releases/20060723120511/public/system”
    servers: [“kabisa_crm”]
    [kabisa_crm] executing command
    ** [out :: kabisa_crm] ln:
    ** [out :: kabisa_crm] creating symbolic link
    /var/rails/kabisa_crm/releases/20060723120511/public/system' to /var/rails/kabisa_crm/shared/system’
    ** [out :: kabisa_crm] : No such file or directory
    command finished
    *** [update_code] transaction: rollback

  • [update_code] rolling back

  • executing “rm -rf /var/rails/kabisa_crm/releases/20060723120511”
    servers: [“kabisa_crm”]
    [kabisa_crm] executing command
    command finished
    rake aborted!
    command “rm -rf /var/rails/kabisa_crm/releases/20060723120511/log
    /var/rails/kabisa_crm/releases/20060723120511/public/system &&\\n ln
    -nfs /var/rails/kabisa_crm/shared/log
    /var/rails/kabisa_crm/releases/20060723120511/log &&\\n ln -nfs
    /var/rails/kabisa_crm/shared/system
    /var/rails/kabisa_crm/releases/20060723120511/public/system” failed on
    kabisa_crm

(See full trace by running task with --trace)

Again problems with the symlink…
I cannot check the command manually because the rake deploy task removes
the
directory.

I have no idea what to do…

(I also have this problem with an other project)

Regards,

Harm de Laat

Yes it does:

serv-1-2-41:/var/rails/kabisa_crm/shared# cd
/var/rails/kabisa_crm/shared
serv-1-2-41:/var/rails/kabisa_crm/shared# ls -la
total 16
drwxr-xr-x 4 root root 4096 Jul 23 14:01 .
drwxr-xr-x 4 root root 4096 Jul 23 14:04 …
drwxrwxrwx 2 root root 4096 Jul 23 14:01 log
drwxrwxr-x 2 root root 4096 Jul 23 14:01 system
serv-1-2-41:/var/rails/kabisa_crm/shared#

I checked the remote filesystem and the files are created. There is a

directory /var/rails/kabisa_crm. It contains two subdirs: releases and
shared
And shared contains log/ and system/ yeah?

Steve

Tried this:

serv-1-2-41:/var/rails/kabisa_crm/releases# mkdir -p
20060723120511/public/system
serv-1-2-41:/var/rails/kabisa_crm/releases# ln -nfs
/var/rails/kabisa_crm/shared/system
/var/rails/kabisa_crm/releases/20060723120511/public/system
serv-1-2-41:/var/rails/kabisa_crm/releases#

This seems to work fine… So somehow the directory does not exist when
the
rake script is being executed.

Any suggestions?

Yes it does:

serv-1-2-41:/var/rails/kabisa_crm/shared# cd
/var/rails/kabisa_crm/shared
serv-1-2-41:/var/rails/kabisa_crm/shared# ls -la
total 16
drwxr-xr-x 4 root root 4096 Jul 23 14:01 .
drwxr-xr-x 4 root root 4096 Jul 23 14:04 …
drwxrwxrwx 2 root root 4096 Jul 23 14:01 log
drwxrwxr-x 2 root root 4096 Jul 23 14:01 system
serv-1-2-41:/var/rails/kabisa_crm/shared#

What if you manually create a directory in releases and try to create a
symlink to the shared/system dir?

The only reason i ask is that capistrano performs fairly straight
forward commands on the remote server. If something is stopping it from
doing this, you may have to try and simulate the things it’s trying in
order track down the problem.

Unfortunately, it’s probably something very simple - but you have to
start somewhere :0)

Steve

I think I have found what is causing this:

  • executing “rm -rf /var/rails/kabisa_crm/releases/20060723143300/log
    /var/rails/kabisa_crm/releases/20060723143300/public/system &&\n ln
    -nfs
    /var/rails/kabisa_crm/shared/log
    /var/rails/kabisa_crm/releases/20060723143300/log &&\n ln -nfs
    /var/rails/kabisa_crm/shared/system
    /var/rails/kabisa_crm/releases/20060723143300/public/system”
    servers: [“kabisa_crm”]
    [kabisa_crm] executing command
    ** [out :: kabisa_crm] ln:
    ** [out :: kabisa_crm] creating symbolic link
    /var/rails/kabisa_crm/releases/20060723143300/public/system' to/var/rails/kabisa_crm/shared/system’
    ** [out :: kabisa_crm] : No such file or directory
    command finished

The rake deploy script first deletes the following directories
recusively:

rm -rf /var/rails/kabisa_crm/releases/20060723143300/log
/var/rails/kabisa_crm/releases/20060723143300/public/system

Then later it tries to symlink to the second directory:

ln -nfs /var/rails/kabisa_crm/shared/system
/var/rails/kabisa_crm/releases/20060723143300/public/system

This ofcourse failes because the previous statement deleted this entire
directory.

I think this might be a bug in Capistrano? If so, who should I contact?
Where can I report this bug?

Any ideas?

Regards,

Harm de Laat

This ofcourse failes because the previous statement deleted this entire
directory.

I think this might be a bug in Capistrano? If so, who should I contact?
Where can I report this bug?
I might be wrong but that doesn’t look like a bug to me. Like i said
before, you don’t want runtime specific directories like log and system
from your dev machine being used on your production server so capistrano
removes them and symlinks to the shared directory.

If /var/rails/kabisa_crm/releases/20060723143300/system existed as a
directory, you would not be able to create a symbolic link with the same
name.

The only reason that statement would fail is if the source directory
(/var/rails/kabisa_crm/shared/system) did not exist. Either that or
/var/rails/kabisa_crm/releases/20060723143300/public/ was missing…

Steve

I finally found the problem.

The problem was that my SVN repository was not correctly defined in
deploy.rb

I configured:
set :repository, “http://xbase.textdriven.com/svn/kabisa_crm

And it should have been:
set :repository, “http://xbase.textdriven.com/svn/kabisa_crm/kabisa_crm

Thanks all,

Regards,

Harm!

Harm de Laat wrote:

I finally found the problem.

The problem was that my SVN repository was not correctly defined in
deploy.rb

I configured:
set :repository, “http://xbase.textdriven.com/svn/kabisa_crm

And it should have been:
set :repository, “http://xbase.textdriven.com/svn/kabisa_crm/kabisa_crm

Thanks all,

Regards,

Harm!

And to piggy back on this one, 3 hours later I found that my problem was
the same, except I had to append “trunk” to my repository path. This
makes sense since you wouldn’t want your branches and tags deployed. : )

Here is everything – > www.oppifjellet1.xt.pl and here
www.oppifjellet.xt.pl