`puma:restart' invoke twice but i only call it once on my deploy app via Capistrano?
I assume you are using the capistrano3-puma gem. That gem automatically restarts puma for you at the conclusion of a successful deployment. So that is the first time the restart task is being called.
Additionally, in your deploy.rb, you've defined your own custom restart task, and you are invoking it after :finishing
. That is the source of the second invocation, and thus the warning.
To "fix" this problem, remove the redundant task:
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
invoke 'puma:restart'
end
end
And remove this:
after :finishing, :restart
Capistrano leaving remote tail open
Have you tried adding the pty option to stop buffering.
stream(..., :pty => true)
Net::SSH::AuthenticationFailed: Authentication failed for user
Did you add your key to the Agent?
What do you see when you run:
$ ssh-add -l
If you get 'The agent has no identities.', then add your key with:
$ ssh-add id_rsa_key_name
How to have Capistrano NOT rollback if a task fails
from the Capistrano Task docs there is a config you can add to if there is an error, to continue.
task :solr_start, :on_error => :continue do
# your code here
end
Just add that to each task you want to ignore errors and continue. Though, the best possible thing is to see if you can figure out what is causing the failure and have the restart command be more robust to really restart it. I only say this, since when you try to hand off the script to someone else, they might not know exactly how to tell if it restarted correctly.
Related Topics
Rails 3.2 Create a Form That's Used in the Footer of Every Page
No Such File or Directory @ Rb_Sysopen for External Url/Rails 6.11/Ruby 3
Why Can't We Override '||' and '&&'
Wicked_Pdf Is Not Rendering Header
Ruby Code for Modifying Outer Quotes on Strings
Calling Ruby Method Without Instantiating Class
Regex to Match Something Based on What Was Matched Before
Symbol#To_Proc Shorthand with the Stabby Lambda Syntax
Find and Replace Specific Hash and It's Values Within Array
Does 'Upcase!' Not Mutate a Variable in Ruby
Why Does Ruby Use Its Own Syntax for Safe Navigation Operator
Encoding::Undefinedconversionerror: "\Xc2" from Ascii-8Bit to Utf-8
How to Reinstall Ruby with Readline Support
Why Rails Can Use 'If' as Hash Key But Not in Ruby
Enforce File Upload Size on Heroku
Carrierwave and Correct File Extension Depending on Its Contents