-
Notifications
You must be signed in to change notification settings - Fork 144
incompatibility between capistrano-resque and capistrano-rbenv #101
Comments
+1 for this issue |
+1 |
In 0.2.2, we started using |
I'm not sure how you would fix it but where you use this command:
I think that the fetch method prepends the RBENV_ variables to the bundle command. Does this from sidekiq help? https://github.com/lemurheavy/sidekiq_test/blob/master/lib/sidekiq/capistrano.rb#L39 Note the |
The primary difference I see is that they're directly I think capistrano-rbenv reworks the results of What happens if you manually SSH into your server and run the I'll test this out when I have some time, but I recall the current implementation working fine as-is on my test server (which includes capistrano-rbenv) so I may not be able to reproduce. |
Also, I really need to clean up and add the stuff below to the README, with the top of the README saying "You probably should not use this library". Using the approach below, with a process manager, avoids the need to do some of the hacks we have like This mirrors the author of Sidekiq's thoughts at the bottom of this page: https://github.com/mperham/sidekiq/wiki/Deployment): From #72: This gem isn't the best approach to managing workers on a production system. What happens if the system reboots or the workers die unexpectedly? Using a system-level process manager (upstart, init.d, etc.) will handle this kind of stuff without having to manually deploy/start resque via capistrano. If you need to restart workers during a deploy, you can just add a super-simple task like sudo service resque restart. And if you need to set a custom user, this can be done in the init/upstart script. |
The interaction between this gem and capistrano-rbenv causes problems in this configuration. Allowing "nohup" to be left out is a workaround. See 9z0b3t1c#101 for why this is so.
The interaction between this gem and capistrano-rbenv causes problems in this configuration. Removing "nohup" is a workaround. See 9z0b3t1c#101 for why this is so.
You can create a new release with this changes? |
+1 |
+1 |
just add env before the #{SSHKit.config.command_map[:rake]} my code is 👍 desc "Start Resque workers"
task :start do
for_each_workers do |role, workers|
on roles(role) do
create_pid_path
worker_id = 1
workers.each_pair do |queue, number_of_workers|
info "Starting #{number_of_workers} worker(s) with QUEUE: #{queue}"
number_of_workers.times do
pid = "#{fetch(:resque_pid_path)}/resque_work_#{worker_id}.pid"
within current_path do
execute :nohup, %{env #{SSHKit.config.command_map[:rake]} RAILS_ENV=#{rails_env} QUEUE="#{queue}" PIDFILE=#{pid} BACKGROUND=yes #{"VERBOSE=1 " if fetch(:resque_verbose)}INTERVAL=#{fetch(:interval)} #{"environment " if fetch(:resque_environment_task)}resque:work #{output_redirection}}
end
worker_id += 1
end
end
end
end
end |
if you are using set :rbenv_prefix, "env RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec" fix this issues with nothing change, good luck! |
+1 am getting this with capistrano (3.5.0), capistrano-resque (0.2.2),
|
@archfish It works for me! Thanks a lot. |
I'm using capistrano 3.2.1 with capistrano-resque gem to restart rasque workers on deployment. Always getting this error.
If I check my error log at
apps/app_production/current/log/resque.log
it shows.I brought the issue to stackoverflow and here is the thread.
http://stackoverflow.com/questions/29705693/rails-deployment-with-capistrano-and-start-resque-workers
The text was updated successfully, but these errors were encountered: