Capistrano hanging on “Authentication realm” (on my new Mac!)

by Rich Brant on March 30, 2007

So I was kindly issued a shiny new MacBook Pro which is truly awesome; an elegant gui built on top of Unix. I think this page pretty much covers it. I’ve been using Ubuntu Linux for the past 6 months or so, and I can ‘t say I’m sad to close that chapter. While Linux is great on the server, it’s just too much work for me – for now – on the desktop. Ubuntu is really onto something special, but it still has some way to go.

As for the new Mac, I was able to get all the basics compiled fairly easily: ruby, rails, subversion, mysql. The only issue I’ve run into is with capistrano. I was unable to deploy via capistrano from projects that included a specific server with a temp ssl certificate. I could never get past the “Authentication realm.” I was able to enter in my username and password for the machine (even though specified in my deploy recipe), but kept being prompted for it a second time. And it wasn’t possible to enter my username the second time, so it would just hang here:

servers: ["www.yourdomainhere.org"]
   [www.yourdomainhere.org] executing command
 ** [out :: www.yourdomainhere.org] Authentication realm:
<https://svn.yourdomainhere.com:443> Subversion Repository
 ** [out :: www.yourdomainhere.org] Username:
 

Lots of googling suggested issuing svn commands prior to issuing capistrano in order to get capistrano to ‘remember’ the info. I tried that, but it still didn’t do the trick. So I dug around in capistrano and adjusted the the svn_stream_handler method (on OS X in /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/scm/subversion.rb) to include the following:

elsif out =~ /\busername.*:/i
                ch.send_data "#{configuration[:svn_username]}\n"

Leave a Comment

Previous post: Getting the mysql gem installed on Ubuntu

Next post: The perfect assessment of Ruby