Repository: capistrano/capistrano

Issue #1058: If i want git clone in sequence not parallel.
Created: 2014-05-18T06:18:39Z
i can do it with custom task like below ,
desc "echo2"                                                                                                             
task :echo2  do                                                                                                          
  on roles(:all), in: :sequence, wait: 2 do |host|                                                                 
    puts "doom #{host}    "                                                                                              
  end                                                                                                                    
 end

but how  git clone or git update is not clear

Duplicate issue #1534: ssh error when I add more hosts
Created: 2015-12-10T03:09:17Z
Before I had 4 servers, but now I add more 10 servers.
I am trying to deploy all 14 servers, git check heads and pull code from my gitlab server,but I got some problem, as follows:
DEBUG [49ca967f]    ssh_exchange_identification: Connection closed by remote host
DEBUG [49ca967f]    fatal: Could not read from remote repository.
DEBUG [49ca967f]
DEBUG [49ca967f]    Please make sure you have the correct access rights
DEBUG [49ca967f]    and the repository exists.

The detail:
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@server: git exit status: 128
git stdout: Nothing written
git stderr: ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in `rescue in block (2 levels) in execute'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
SSHKit::Command::Failed: git exit status: 128
git stdout: Nothing written
git stderr: ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/command.rb:95:in `exit_status='
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:179:in `block in _execute'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `tap'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/capistrano-3.4.0/lib/capistrano/git.rb:11:in `git'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/capistrano-3.4.0/lib/capistrano/git.rb:21:in `check'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/capistrano-3.4.0/lib/capistrano/tasks/git.rake:28:in `block (4 levels) in <top (required)>'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:85:in `with'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/capistrano-3.4.0/lib/capistrano/tasks/git.rake:27:in `block (3 levels) in <top (required)>'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/marcolee/.rvm/gems/ruby-2.1.2/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => git:check
The deploy has failed with an error: Exception while executing as deploy@server: git exit status: 128
git stdout: Nothing written
git stderr: ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
** Invoke deploy:failed (first_time)
** Execute deploy:failed
** Invoke bearychat:notify_deploy_fail (first_time)
** Execute bearychat:notify_deploy_fail

I try to separate deployment of the 4 old servers and the 10 new servers, it works.
What's the problem? And how to fix it?
Thx for rending my issue!

Closing comment (2015-12-31T01:08:44Z): I'm closing this issue due to inactivity and since it is probably a duplicate of #1058.