Photo-1 Photo-2 Photo-3 Photo-4 Photo-5 Photo-6

@brentmc79

@brentmc79

Full-time web developer. Part-time smart ass.

I'm Brent Collier.

After a year and a half as an engineer on Twitter's Trust & Safety team, I'm looking for my next gig. Contact me if you know of something interesting.

#

my first hiccup

Posted on 06/04/2008

So I mentioned earlier that I was using Capistrano 2.0.  Well, in actuality, I was using version 2.3.0.  Why's this important?  Well, I'll tell ya....

On my initial deploy:

cap deploy:cold

...everything went fine.  Capistrano did a clone of my Github repo, ran all of my migrations, and started up the mongrels without a hitch.  It was on my subsequent deploy that I had a problem.

macbook:blog brent$ cap deploy
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
ssh_exchange_identification: Connection closed by remote host
fatal: The remote end hung up unexpectedly
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/brent/public_html/acts-as-blogr.com/releases/20080604051355; true"
    servers: ["acts-as-blogr.com"]
    [acts-as-blogr.com] executing command
    command finished
/Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy/scm/git.rb:217:in `query_revision': Unable to resolve revision for master (RuntimeError)
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `send'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy/scm/base.rb:63:in `local'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/recipes/deploy.rb:37:in `load'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/configuration/variables.rb:87:in `call'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/configuration/variables.rb:87:in `fetch'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/configuration/variables.rb:110:in `protect'
     ... 35 levels...
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/lib/capistrano/cli/execute.rb:14:in `execute'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.3.0/bin/cap:4
    from /usr/bin/cap:19:in `load'
    from /usr/bin/cap:19

I tried again and got the same results.  After a quick google or two, I found this Lighthouse ticket for Capistrano. Evidently there's an issue with cap version 2.3.0 in which it calls 'fetch --tags' to update your code, which returns only tag commits instead of all commits.  This is a problem.

Fortunately, the solution is a simple as either downgrading to version 2.2.0, or upgrading to the latest build.  I opted for the safe route and installed 2.2.0.  Now everything is right as rain.