New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mina hangs after entering SSH password #88

Closed
amargherio opened this Issue Jan 26, 2013 · 10 comments

Comments

Projects
None yet
8 participants
@amargherio

amargherio commented Jan 26, 2013

After running mina init and modifying my deploy.rb to point to my web server, I try to run mina setup and it hangs after I enter my SSH password. I hit enter, nothing happens, and when I break, it errors out with a broken pipe error. I know I can SSH in using the same account and password. Any thoughts?

The setup part of my deploy.rb is as follows:

set :domain, 'adammargherio.com'
set :deploy_to, '/srv/www/adammargherio.com'
set :repository, 'git://github.com/amargherio/personal.git'
set :branch, 'master'
set :user, 'deploy'
set :port, '22'

task :setup => :environment do
  queue! %[mkdir -p "#{deploy_to}/shared/log"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]

  queue! %[mkdir -p "#{deploy_to}/shared/config"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]

  queue! %[touch "#{deploy_to}/shared/config/database.yml"]
  queue  %[-----> Be sure to edit 'shared/config/database.yml'.]
end

And the results from executing the setup command are:

deploy@adammargherio.com's password: 
-----> Mina: SIGINT received.

       Elapsed time: 68.00 seconds

/home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/output_helpers.rb:111:in `write': Broken pipe (Errno::EPIPE)
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/output_helpers.rb:111:in `putc'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/output_helpers.rb:111:in `block (2 levels) in pretty_system'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/output_helpers.rb:108:in `fork'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/output_helpers.rb:108:in `block in pretty_system'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/open4-1.3.0/lib/open4.rb:107:in `call'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/open4-1.3.0/lib/open4.rb:107:in `do_popen'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/open4-1.3.0/lib/open4.rb:30:in `popen4'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/tools.rb:11:in `popen4'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/output_helpers.rb:83:in `pretty_system'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/ssh_helpers.rb:43:in `ssh'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/helpers.rb:49:in `block in run!'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/helpers.rb:76:in `measure'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/helpers.rb:65:in `report_time'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/helpers.rb:49:in `run!'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/lib/mina/helpers.rb:86:in `mina_cleanup!'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/bin/mina:55:in `block (2 levels) in <top (required)>'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/bin/mina:26:in `block in <top (required)>'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/bin/mina:25:in `instance_eval'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/gems/mina-0.2.1/bin/mina:25:in `<top (required)>'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/bin/mina:19:in `load'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/bin/mina:19:in `<main>'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/bin/ruby_noexec_wrapper:14:in `eval'
    from /home/adam/.rvm/gems/ruby-1.9.3-p286/bin/ruby_noexec_wrapper:14:in `<main>'
@amargherio

This comment has been minimized.

Show comment
Hide comment
@amargherio

amargherio Jan 26, 2013

Rolled back to version 0.2.0 and the setup command works fine. Seems to be an issue with 0.2.1.

amargherio commented Jan 26, 2013

Rolled back to version 0.2.0 and the setup command works fine. Seems to be an issue with 0.2.1.

@slava-vishnyakov

This comment has been minimized.

Show comment
Hide comment
@slava-vishnyakov

slava-vishnyakov Feb 14, 2013

I'm actually having this issue without SIGINT. Every time mina is done there is:

output_helpers.rb:111:in `write': Broken pipe 

Otherwise - awesome gem, thanks a lot for your work!

slava-vishnyakov commented Feb 14, 2013

I'm actually having this issue without SIGINT. Every time mina is done there is:

output_helpers.rb:111:in `write': Broken pipe 

Otherwise - awesome gem, thanks a lot for your work!

@killthekitten

This comment has been minimized.

Show comment
Hide comment
@killthekitten

killthekitten Feb 16, 2013

Did you try to use master?

killthekitten commented Feb 16, 2013

Did you try to use master?

@slava-vishnyakov

This comment has been minimized.

Show comment
Hide comment
@slava-vishnyakov

slava-vishnyakov Feb 16, 2013

@killthekitten Yes, master works fine. Thank you!
Is it just me or did Mina lose colors? :( It was much more colorful in 0.2.1

slava-vishnyakov commented Feb 16, 2013

@killthekitten Yes, master works fine. Thank you!
Is it just me or did Mina lose colors? :( It was much more colorful in 0.2.1

@killthekitten

This comment has been minimized.

Show comment
Hide comment
@killthekitten

killthekitten Feb 16, 2013

@slava-vishnyakov that's a good question, and I didn't find the answer)

killthekitten commented Feb 16, 2013

@slava-vishnyakov that's a good question, and I didn't find the answer)

@welsonla

This comment has been minimized.

Show comment
Hide comment
@welsonla

welsonla Jun 22, 2013

I had the same questions,and even I type the -t to show the log,It change nothing.

I hope in this time,It could tell me some wrong

welsonla commented Jun 22, 2013

I had the same questions,and even I type the -t to show the log,It change nothing.

I hope in this time,It could tell me some wrong

@mikong

This comment has been minimized.

Show comment
Hide comment
@mikong

mikong Jul 10, 2013

Contributor

@slava-vishnyakov, colors are fixed in 0.3.0. @rstacruz made sure of that. :)

This issue should also be no longer happening in the latest version.

Contributor

mikong commented Jul 10, 2013

@slava-vishnyakov, colors are fixed in 0.3.0. @rstacruz made sure of that. :)

This issue should also be no longer happening in the latest version.

@mikong mikong closed this Jul 10, 2013

@mbaniasad

This comment has been minimized.

Show comment
Hide comment
@mbaniasad

mbaniasad Nov 30, 2013

I have this issue now. tried with latest mina on master!
and mina 0.3.0

mbaniasad commented Nov 30, 2013

I have this issue now. tried with latest mina on master!
and mina 0.3.0

@ekurennyy

This comment has been minimized.

Show comment
Hide comment
@ekurennyy

ekurennyy Jan 12, 2014

Have the same error/freeze on v0.3.0
Any ideas?

require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv'

set :domain, 'repo.com'
set :deploy_to, '/var/www/repo.com'
set :repository, 'git@github.com:ekurennyy/repo.git'
set :branch, 'master'

set :shared_paths, ['config/database.yml', 'log']

task :environment do
invoke :'rbenv:load'
end

task :setup => :environment do
queue! %[mkdir -p "#{deploy_to}/shared/log"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]

queue! %[mkdir -p "#{deploy_to}/shared/config"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]

queue! %[touch "#{deploy_to}/shared/config/database.yml"]
queue %[echo "-----> Be sure to edit 'shared/config/database.yml'."]
end

desc "Deploys the current version to the server."
task :deploy => :environment do
deploy do
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'

to :launch do
  queue "touch #{deploy_to}/tmp/restart.txt"
end

end
end

ekurennyy commented Jan 12, 2014

Have the same error/freeze on v0.3.0
Any ideas?

require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv'

set :domain, 'repo.com'
set :deploy_to, '/var/www/repo.com'
set :repository, 'git@github.com:ekurennyy/repo.git'
set :branch, 'master'

set :shared_paths, ['config/database.yml', 'log']

task :environment do
invoke :'rbenv:load'
end

task :setup => :environment do
queue! %[mkdir -p "#{deploy_to}/shared/log"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]

queue! %[mkdir -p "#{deploy_to}/shared/config"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]

queue! %[touch "#{deploy_to}/shared/config/database.yml"]
queue %[echo "-----> Be sure to edit 'shared/config/database.yml'."]
end

desc "Deploys the current version to the server."
task :deploy => :environment do
deploy do
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'

to :launch do
  queue "touch #{deploy_to}/tmp/restart.txt"
end

end
end

@rainbow7706

This comment has been minimized.

Show comment
Hide comment
@rainbow7706

rainbow7706 Apr 12, 2016

Add below line to deploy.rb to fix ssh Hang issue
set :term_mode, nil

rainbow7706 commented Apr 12, 2016

Add below line to deploy.rb to fix ssh Hang issue
set :term_mode, nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment