capistrano-sidekiq icon indicating copy to clipboard operation
capistrano-sidekiq copied to clipboard

Why not use `bundle exec sidekiq` ?

Open kumagi opened this issue 7 years ago • 6 comments

In my environment, cap production sidekiq:start dies immediately. The capistrano's boot up sidekiq via below command.

$ sidekiq --index 0 --pidfile /opt/my_application/shared/tmp/pids/sidekiq-0.pid --environment production --logfile /opt/my_application/shared/log/sidekiq.log --config /opt/my_application/current/config/sidekiq.yml  -r /opt/my_application/current --daemon

It uses system installed sidekiq. And it bytes me environment related bug.

How about boot up sidekiq via

/opt/my_application/current/bin/bundle exec sidekiq 

command? It worked me in CLI test.

kumagi avatar Jun 22 '17 03:06 kumagi

You either not using capistano-bundler or overriding a default option. show me your deploy.rb

seuros avatar Jun 22 '17 09:06 seuros

https://gist.github.com/kumagi/99b20d12cf1d5c5b27a7b5793fb51798 I could not find the corresponding option to use bundler. Please let me teach.

kumagi avatar Jun 22 '17 16:06 kumagi

From Gemfile.lock I found capistrano-bundler

    capistrano (3.8.2)
      airbrussh (>= 1.0.0)
      i18n
      rake (>= 10.0.0)
      sshkit (>= 1.9.0)
    capistrano-bundler (1.2.0)
      capistrano (~> 3.1)
      sshkit (~> 1.2)

kumagi avatar Jun 22 '17 16:06 kumagi

I finally resolved. Adding below configuration in my deploy/production.rb

set :bundle_bins, %w{gem rake rails sidekiq}

It works well for me. How about writing it in README.md?

kumagi avatar Jun 22 '17 18:06 kumagi

Same problem here.

Definition of bundle_bins does not seem to be the solution, since capistrano-sidekiq itself currently does it.

When I force gem code to run without --daemon option, local execution is stuck (as expected) and remotely the sidekiq process is running as well.

The problem seems to be in the daemonization.

If I run directly in the server the same command capistrano-sidekiq runs, everything works fine.

rodrigomanhaes avatar Jul 18 '17 04:07 rodrigomanhaes

@kumagi, @rodrigomanhaes, I had the same issue, and to fix it - I simply moved require 'capistrano/sidekiq' line in Capfile lower, I guess it should go lower than require 'capistrano/bundler' line.

flvrone avatar Apr 03 '18 17:04 flvrone