Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to capistrano and trying to run script to deploy source codes to QA server which connected with VPN. Tested script in my 'Git bash' shell in windows machine. I have no problems at connecting github as tested below.

$ ssh -T
Hi jkjunguser! You've successfully authenticated, but GitHub does not provide sh
ell access.

VPN connection with client's network is established using Cisco ANyConnect v2.5. Tested SSH connection from my local shell to target server and was successful. Also tested github connection from the target server and had no issues.

However when I ran deploy script I got "Error reading response length from authentication socket." error as below.

$ cap qa deploy
  * ?[32m2013-05-30 13:53:16 executing `qa'?[0m
  * ?[32m2013-05-30 13:53:16 executing `deploy'?[0m
  * ?[32m2013-05-30 13:53:16 executing `deploy:update'?[0m
 ** transaction: start
  * ?[32m2013-05-30 13:53:16 executing `deploy:update_code'?[0m
    updating the cached checkout on all servers
    ?[33mexecuting locally: "git ls-remote
ase2.git master"?[0m
    ?[2;37mcommand finished in 7293ms?[0m
  * ?[33mexecuting "if [ -d /home/web/ ]; then
cd /home/web/ && git fetch -q origin && git fet
ch --tags -q origin && git reset -q --hard b0f37d41f5d8aa5716986725d1c72142536af
8d2 && git clean -q -d -x -f; else git clone -q -b master
/client-phase2.git /home/web/ && cd /home/
web/ && git checkout -q -b deploy b0f37d41f5d8a
a5716986725d1c72142536af8d2; fi"?[0m
    servers: ["10.33.XX.XXX"]
    [10.33.XX.XXX] executing command
 ** [10.33.XX.XXX :: err] Error reading response length from authentication sock
 ** [10.33.XX.XXX :: err] ERROR: Repository not found.
 ** [10.33.XX.XXX :: err] fatal: The remote end hung up unexpectedly
    ?[2;37mcommand finished in 2217ms?[0m
*** [?[34mdeploy:update_code?[0m] ?[34mrolling back?[0m
  * ?[33mexecuting "rm -rf /home/web/; tru
    servers: ["10.33.XX.XXX"]
    [10.33.XX.XXX] executing command
    ?[2;37mcommand finished in 522ms?[0m
failed: "sh -c 'if [ -d /home/web/ ]; then cd /
home/web/ && git fetch -q origin && git fetch -
-tags -q origin && git reset -q --hard b0f37d41f5d8aa5716986725d1c72142536af8d2
&& git clean -q -d -x -f; else git clone -q -b master
client-phase2.git /home/web/ && cd /home/web/ && git checkout -q -b deploy b0f37d41f5d8aa571
6986725d1c72142536af8d2; fi'" on 10.33.XX.XXX 

The deploy script used is below. [deploy.rb]

set :repository, ""
set :scm, :git
set :branch, fetch(:branch, "master")

set :use_sudo, false

set :normalize_asset_timestamps, false

ssh_options[:forward_agent] = true

task :qa do

    set :user, 'web'
    set :application, ""
    set :deploy_to, "/home/web/#{application}"
    set :deploy_via, :remote_cache
    set :current_path, "#{deploy_to}/current"
    set :releases_path, "#{deploy_to}/releases/"
    set :shared_path, "#{deploy_to}/shared/"
    role :web, ""

after 'deploy:update', :update_permission

If there is any cure for this "Error reading response length from authentication socket." error that would be great. Please give me any helpful advice. I am happy to try any suggestion.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.