Capistrano with darcs error "darcs failed: Not a repository"

Skip to first unread message


Aug 16, 2007, 1:30:44 PM8/16/07
to Capistrano
Hello all,

Anyone using Capistrano with darcs? I'm trying to deploy to a new
server and not having any luck.
I've copied the darcs repository to a directory on the server. When
cap is trying to get the list of patches from the repository, it can't
find it, so darcs fails with the error "Not a repository."

Here's my deploy.rb:

set :application, "myapp"
set :repository, "/home/myapp/darcs/myapp"

# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual
# via the :deploy_to variable:
set :deploy_to, "/home/myapp/deploy"

# If you aren't using Subversion to manage your source code,
# your SCM below:
set :scm, :darcs
set :scm_verbose, false
set :deploy_via, :checkout

set :user, 'myapp'

role :app, ""
role :web, ""
role :db, "", :primary => true

And here's a log of my shell session:

me@desktop:~/myapp$ cap deploy:cold
* executing `deploy:cold'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'

darcs failed: Not a repository: /home/myapp/darcs/myapp (/home/
myapp/darcs/myapp/_darcs/inventory: openBinaryFile: does not exist (No
such file or directory))
* executing "darcs get --repo-name=/home/myapp/deploy/releases/
20070816172442 --to-match='hash ' /home/myapp/darcs/myapp && (echo > /
servers: [""]
[] executing command
Copying patch 1 of 225...
Copying patch 2 of 225...
Copying patch 3 of 225...
Copying patch 225 of 225... done!
** [out] darcs:
** [out] Couldn't find patch matching "hash "
** [out]
command finished
*** [deploy:update_code] rolling back
* executing "rm -rf /home/myapp/deploy/releases/20070816172442;
servers: [""]
[] executing command
command finished
command "darcs get --repo-name=/home/myapp/deploy/releases/
20070816172442 --to-match='hash ' /home/myapp/darcs/myapp && (echo > /
home/myapp/deploy/releases/20070816172701/REVISION)" failed on

Jamis Buck

Aug 16, 2007, 1:43:49 PM8/16/07
When using the :checkout deployment strategy, the repository must be
accessible by both the remote host(s) and the local host (since it
just does a checkout operation on each target host).

If that's not an option, you might want to consider using the :copy
strategy, instead.

- Jamis


Aug 16, 2007, 4:28:48 PM8/16/07
to Capistrano
Thanks, Jamis. Changing to ":checkout, :copy" gets the code from my
local darcs repository on my development machine, which works fine for

Another problem, however: cap freezes while uploading the gzipped
copy of the code. The last thing cap prints to the screen is:

** uploading data to

Then it does nothing until I kill it. If I log in to the server,
there's a file at /tmp/20070816195756.tar.gz with zero bytes. Could
this be some obscure bug in Ruby's SFTP library?


Jamis Buck

Aug 16, 2007, 4:32:05 PM8/16/07
Sadly, yeah, it sounds like you're one of the lucky few who are
getting bitten by that one. I've never been able to duplicate it
reliably, so I'm not sure what's causing it, but I'm hoping my rewrite
of Net::SFTP will fix it. (Should have that ready to release by the
end of the month).

In the meantime, I believe some on this list have written custom
strategies to work around that bug... anyone want to chime in here?


Aug 16, 2007, 5:00:33 PM8/16/07
to Capistrano
Thanks, though, at least I know I'm not nuts. I'll figure out a
workaround, probably just upload manually for now.
Reply all
Reply to author
0 new messages