Skip to content
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

Redis connect issue after upgrading to 6.0.6 #4505

Closed
arent-groebner opened this issue Mar 24, 2020 · 6 comments
Closed

Redis connect issue after upgrading to 6.0.6 #4505

arent-groebner opened this issue Mar 24, 2020 · 6 comments

Comments

@arent-groebner
Copy link

arent-groebner commented Mar 24, 2020

Ruby version: ruby 2.5.3p105
Sidekiq / Pro / Enterprise version(s): 6.0.6

When running "rails generate active_admin:install --skip-users", sidekiq-6.0.6 tries to contact a Redis database. This fails, since Redis isn't running during build time. After downgrading to 6.0.5 everything works fine again.

===========================================

Step 33/49 : RUN rails generate active_admin:install --skip-users
 ---> Running in 8f8de119c5f5
bin/rails: No such file or directory - busybox
      create  config/initializers/active_admin.rb
      create  app/admin
      create  app/admin/dashboard.rb
       route  ActiveAdmin.routes(self)
    generate  active_admin:assets
bin/rails: No such file or directory - busybox
      create  app/assets/javascripts/active_admin.js
      create  app/assets/stylesheets/active_admin.scss
/home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:362:in `rescue in establish_connection': Error connecting to Redis on 127.0.0.1:6379 (Errno::E
CONNREFUSED) (Redis::CannotConnectError)
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:343:in `establish_connection'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:106:in `block in connect'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:105:in `connect'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:381:in `ensure_connected'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:231:in `block in process'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:319:in `logging'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:230:in `process'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:196:in `call_pipelined'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:164:in `block in call_pipeline'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:162:in `call_pipeline'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis.rb:2416:in `block in pipelined'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis.rb:52:in `block in synchronize'
        from /opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in `mon_synchronize'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis.rb:52:in `synchronize'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis.rb:2411:in `pipelined'
        from /home/integration-dashboard/.gem/gems/sidekiq-6.0.6/lib/sidekiq/launcher.rb:104:in `block in flush_stats'
        from /home/integration-dashboard/.gem/gems/sidekiq-6.0.6/lib/sidekiq.rb:97:in `block in redis'
        from /home/integration-dashboard/.gem/gems/connection_pool-2.2.2/lib/connection_pool.rb:65:in `block (2 levels) in with'
        from /home/integration-dashboard/.gem/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `handle_interrupt'
        from /home/integration-dashboard/.gem/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `block in with'
        from /home/integration-dashboard/.gem/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `handle_interrupt'
        from /home/integration-dashboard/.gem/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `with'
        from /home/integration-dashboard/.gem/gems/sidekiq-6.0.6/lib/sidekiq.rb:94:in `redis'
        from /home/integration-dashboard/.gem/gems/sidekiq-6.0.6/lib/sidekiq/launcher.rb:103:in `flush_stats'
      create  db/migrate/20200323215216_create_active_admin_comments.rb
/home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:362:in `rescue in establish_connection': Error connecting to Redis on 127.0.0.1:6379 (Errno::E
CONNREFUSED) (Redis::CannotConnectError)
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:343:in `establish_connection'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:106:in `block in connect'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:105:in `connect'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:381:in `ensure_connected'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:231:in `block in process'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:319:in `logging'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:230:in `process'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:196:in `call_pipelined'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:164:in `block in call_pipeline'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis/client.rb:162:in `call_pipeline'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis.rb:2416:in `block in pipelined'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis.rb:52:in `block in synchronize'
        from /opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in `mon_synchronize'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis.rb:52:in `synchronize'
        from /home/integration-dashboard/.gem/gems/redis-4.1.3/lib/redis.rb:2411:in `pipelined'
        from /home/integration-dashboard/.gem/gems/sidekiq-6.0.6/lib/sidekiq/launcher.rb:104:in `block in flush_stats'
        from /home/integration-dashboard/.gem/gems/sidekiq-6.0.6/lib/sidekiq.rb:97:in `block in redis'
        from /home/integration-dashboard/.gem/gems/connection_pool-2.2.2/lib/connection_pool.rb:65:in `block (2 levels) in with'
        from /home/integration-dashboard/.gem/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `handle_interrupt'
        from /home/integration-dashboard/.gem/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `block in with'
        from /home/integration-dashboard/.gem/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `handle_interrupt'
        from /home/integration-dashboard/.gem/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `with'
        from /home/integration-dashboard/.gem/gems/sidekiq-6.0.6/lib/sidekiq.rb:94:in `redis'
        from /home/integration-dashboard/.gem/gems/sidekiq-6.0.6/lib/sidekiq/launcher.rb:103:in `flush_stats'

ERROR: Service 'rails' failed to build: The command '/bin/sh -c rails generate active_admin:install --skip-users' returned a non-zero code: 1

@misdoro
Copy link
Contributor

misdoro commented Mar 24, 2020

Already fixed here:
#4502
We'll need to wait for next release

@mperham
Copy link
Collaborator

mperham commented Mar 24, 2020

Why is rails generate requiring Sidekiq's launcher? The launcher is only required when you run the sidekiq binary. I suspect someone else is breaking this; post your initializer.

@arent-groebner
Copy link
Author

arent-groebner commented Mar 24, 2020

Here's my Sidekiq initializer:

`
schedule = 'config/schedule.yml'

if File.exist?(schedule) && Sidekiq.server?
Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule)
end

require "sidekiq/throttled"
Sidekiq::Throttled.setup!
`

@misdoro
Copy link
Contributor

misdoro commented Mar 24, 2020

@arent-groebner are you using the sidekiq-cron gem too ? Looks like launcher is included there.

@mperham
Copy link
Collaborator

mperham commented Mar 24, 2020

Yep, it's a sidekiq-cron bug. They should not be requiring the launcher except when inside a Sidekiq process.

@mperham mperham closed this as completed Mar 24, 2020
@arent-groebner
Copy link
Author

Thanks. I will open a ticket there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants