-
Notifications
You must be signed in to change notification settings - Fork 307
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
Gem will break after Sidekiq 6.0 has been released #224
Comments
Any update or solution ? |
Hi everyone,
This errors puts console, Is there any solution or resource for this problem ? |
For those who use rbenv like me, I did quick manual on how to switch to systemd. https://gist.github.com/Paprikas/11fc850f81b687d9cbb7a8efb5ead208 |
I think adding a sidekiq <= 6.0 restriction on the last version is a bad idea. capistrano-sidekiq already works with sidekiq 6 if you use the systemd init feature. If somebody want to keep deamonizing sidekiq they can still force the version of sidekiq and capistrano-sidekiq in their gemfile. If you lock the sidekiq version in the gemspec, you force people who do the right thing to fork capistrano-sidekiq if they want the latest version of sidekiq. Though, forcing systemd restrict deployment to linux servers. One way to deal with this would be to abstract the call to systemd in a class that we could substitute for other class if we want to use different service manager. Then adding a new service manager would be trivial. |
For systemd-based deployments, it's basically:
set :sidekiq_roles, -> { :app }
set :sidekiq_systemd_unit_name, "sidekiq@#{fetch(:stage)}"
namespace :sidekiq do
desc 'Quiet sidekiq (stop fetching new tasks from Redis)'
task :quiet do
on roles fetch(:sidekiq_roles) do
# See: https://github.com/mperham/sidekiq/wiki/Signals#tstp
execute :systemctl, '--user', 'kill', '-s', 'SIGTSTP', fetch(:sidekiq_systemd_unit_name), raise_on_non_zero_exit: false
end
end
desc 'Stop sidekiq (graceful shutdown within timeout, put unfinished tasks back to Redis)'
task :stop do
on roles fetch(:sidekiq_roles) do
# See: https://github.com/mperham/sidekiq/wiki/Signals#tstp
execute :systemctl, '--user', 'kill', '-s', 'SIGTERM', fetch(:sidekiq_systemd_unit_name), raise_on_non_zero_exit: false
end
end
desc 'Start sidekiq'
task :start do
on roles fetch(:sidekiq_roles) do
execute :systemctl, '--user', 'start', fetch(:sidekiq_systemd_unit_name)
end
end
desc 'Restart sidekiq'
task :restart do
on roles fetch(:sidekiq_roles) do
execute :systemctl, '--user', 'restart', fetch(:sidekiq_systemd_unit_name)
end
end
end
after 'deploy:starting', 'sidekiq:quiet'
after 'deploy:updated', 'sidekiq:stop'
after 'deploy:published', 'sidekiq:start'
after 'deploy:failed', 'sidekiq:restart' |
Sidekiq 6 has been released and
|
Now that Sidekiq 6 has been released, which removes the ability to daemonize sidekiq, we must pin sidekiq until we are daemonizing sidekiq via systemd (vs. the sidekiq executable in the bundle). Note the tracking issue in capistrano-sidekiq: seuros/capistrano-sidekiq#224
Thanks @leoarnold! Your example code was extremely useful. |
This gem does support user level systemd deployment already. With customizable service template included. You just have to set the correct parameters. https://github.com/seuros/capistrano-sidekiq/blob/master/README.md#integration-with-systemd |
@twistedjoe True that, yet most users do not require the versatile support for the whole variety of init systems. Since this project is not very active (see screenshot below), it seems advisable (c.f. CVE-2019-15224) to replace it with four simple and maintainable customized Capistrano tasks rather than hoping for a fresh breeze in this project. |
I'm going to release the new version this weekend, that support only sidekiq 6+. |
Hey @seuros, Do you have an ETA for this release? (sidekiq 6+) |
@seuros ping |
+1, I have
after updating to sidekiq6 and deploying app |
@seuros ping ping |
Any news on this? |
@seuros ping |
This gem does support systemd and sidekiq 6.0 but currently sidekiq is locked to version < 6, so I've created fork which allow to use newest sidekiq 6.0.3: https://github.com/rwojnarowski/capistrano-sidekiq In short, to get this gem working with sidekiq 6.0: |
@rwojnarowski well, my bundler path doesn't seem to be there tho |
@rwojnarowski Worked like a charm, hopefully main gem will be updated soon. UPDATE: status is giving me this:
Update 2: I tracked it down to the path of bundler in generated service was not relative to rvm. I change that line to For anyone playing around with systemctl for sidekiq or anything, i used following sequence of commands for hit and try:
Commenting this to help others as well as my log for next time. |
https://curationexperts.github.io/playbook/production/sidekiq_in_production.html
|
Credit here: seuros/capistrano-sidekiq#224 (comment) with some modifications
Newbies corner for those out here who are struggling with this 🤼♀️
This means: open that file and check that the
Then, |
I struggled with this a lot. Downgraded to |
Any update on the support for Sidekiq 6? |
This still fails for me :(
working directory is also set
but works when I run it from current_path manually at the server
|
@leoarnold I followed your steps. Created a sidekiq.service file and tried to use that in deploy.rb. I cant seem to get this working. While deploying, capistrano cant find the service file. On my server, i can start sidekiq manually with Any idea about this. |
@gauravm31 That is because you installed the systemd unit in system space, not in user space. To run services in user space, enable-linger for the unprivileged user and then follow e.g. https://computingforgeeks.com/how-to-run-systemd-service-without-root-sudo/ |
@leoarnold Followed the steps. Then there was another issue regarding user/group. If we user systemctl with --user, we need to remove the user and group setting from service file as it is not needed. Otherwise it breaks. explained here https://unix.stackexchange.com/questions/438064/ after removing user and group settings, it works fine. Thanks for the help. |
…with sidekiq-capistrano, see seuros/capistrano-sidekiq#224 (comment)
sidekiq 6 is not compatible with the way we are using capistrano-sidekiq, resulting in failed deployments even though everything installed successfully in development and CI. More info: seuros/capistrano-sidekiq#224
sidekiq 6 is not compatible with the way we are using capistrano-sidekiq, resulting in failed deployments even though everything installed successfully in development and CI. More info: seuros/capistrano-sidekiq#224
After updating sidekiq to version 5.2.5 the following warning is shown:
The ticket: sidekiq/sidekiq#4045
As the gemspec denotes a requirement to
sidekiq >= 3.4
but no upper limit, this gem will most likely break after the new version of sidekiq has been released.The quickfix would be to additionally require sidekiq <= 6.0 and release a new version.
What needs to be done to fix this issue in the long run?
PS: I already had
gem 'sidekiq', '~> 5.1'
within my gemfile so I'm not directly affected but will prevent the update to any newer version of sidekiq.The text was updated successfully, but these errors were encountered: