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

flush_stats being called in assets:precompile #4509

Closed
tylerdavis opened this issue Mar 25, 2020 · 3 comments
Closed

flush_stats being called in assets:precompile #4509

tylerdavis opened this issue Mar 25, 2020 · 3 comments

Comments

@tylerdavis
Copy link

Ruby version: 2.6.3
Sidekiq / Pro / Enterprise version(s): OSS

The recent addition of the flush_stats call in 6.0.6 is now attempting to connect to redis when calling bin/rails assets:precompile

 /usr/local/bundle/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::ECONNREFUSED) (Redis::CannotConnectError)
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:343:in `establish_connection'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:106:in `block in connect'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:105:in `connect'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:381:in `ensure_connected'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:231:in `block in process'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:319:in `logging'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:230:in `process'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:196:in `call_pipelined'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:164:in `block in call_pipeline'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:162:in `call_pipeline'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:2416:in `block in pipelined'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:52:in `block in synchronize'
 Step #1: 	from /usr/local/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:52:in `synchronize'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:2411:in `pipelined'
 Step #1: 	from /usr/local/bundle/gems/skylight-core-4.2.3/lib/skylight/core/probes/redis.rb:53:in `block in pipelined'
 Step #1: 	from /usr/local/bundle/gems/skylight-core-4.2.3/lib/skylight/core/fanout.rb:25:in `instrument'
 Step #1: 	from /usr/local/bundle/gems/skylight-core-4.2.3/lib/skylight/core/probes/redis.rb:52:in `pipelined'
 Step #1: 	from /usr/local/bundle/gems/sidekiq-6.0.6/lib/sidekiq/launcher.rb:104:in `block in flush_stats'
 Step #1: 	from /usr/local/bundle/gems/sidekiq-6.0.6/lib/sidekiq.rb:97:in `block in redis'
 Step #1: 	from /usr/local/bundle/gems/connection_pool-2.2.2/lib/connection_pool.rb:65:in `block (2 levels) in with'
 Step #1: 	from /usr/local/bundle/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `handle_interrupt'
 Step #1: 	from /usr/local/bundle/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `block in with'
 Step #1: 	from /usr/local/bundle/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `handle_interrupt'
 Step #1: 	from /usr/local/bundle/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `with'
 Step #1: 	from /usr/local/bundle/gems/sidekiq-6.0.6/lib/sidekiq.rb:94:in `redis'
 Step #1: 	from /usr/local/bundle/gems/sidekiq-6.0.6/lib/sidekiq/launcher.rb:103:in `flush_stats'
 Step #1: /usr/local/bundle/gems/redis-4.1.3/lib/redis/connection/hiredis.rb:19:in `connect': Connection refused (Errno::ECONNREFUSED)
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/connection/hiredis.rb:19:in `connect'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:349:in `establish_connection'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:106:in `block in connect'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:105:in `connect'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:381:in `ensure_connected'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:231:in `block in process'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:319:in `logging'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:230:in `process'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:196:in `call_pipelined'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:164:in `block in call_pipeline'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:306:in `with_reconnect'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis/client.rb:162:in `call_pipeline'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:2416:in `block in pipelined'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:52:in `block in synchronize'
 Step #1: 	from /usr/local/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:52:in `synchronize'
 Step #1: 	from /usr/local/bundle/gems/redis-4.1.3/lib/redis.rb:2411:in `pipelined'
 Step #1: 	from /usr/local/bundle/gems/skylight-core-4.2.3/lib/skylight/core/probes/redis.rb:53:in `block in pipelined'
 Step #1: 	from /usr/local/bundle/gems/skylight-core-4.2.3/lib/skylight/core/fanout.rb:25:in `instrument'
 Step #1: 	from /usr/local/bundle/gems/skylight-core-4.2.3/lib/skylight/core/probes/redis.rb:52:in `pipelined'
 Step #1: 	from /usr/local/bundle/gems/sidekiq-6.0.6/lib/sidekiq/launcher.rb:104:in `block in flush_stats'
 Step #1: 	from /usr/local/bundle/gems/sidekiq-6.0.6/lib/sidekiq.rb:97:in `block in redis'
 Step #1: 	from /usr/local/bundle/gems/connection_pool-2.2.2/lib/connection_pool.rb:65:in `block (2 levels) in with'
 Step #1: 	from /usr/local/bundle/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `handle_interrupt'
 Step #1: 	from /usr/local/bundle/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `block in with'
 Step #1: 	from /usr/local/bundle/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `handle_interrupt'
 Step #1: 	from /usr/local/bundle/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `with'
 Step #1: 	from /usr/local/bundle/gems/sidekiq-6.0.6/lib/sidekiq.rb:94:in `redis'
 Step #1: 	from /usr/local/bundle/gems/sidekiq-6.0.6/lib/sidekiq/launcher.rb:103:in `flush_stats'
 Step #1: The command '/bin/sh -c bin/rails assets:precompile ASSET_COMPILE=true' returned a non-zero code: 1

Are you using an old version?
Have you checked the changelogs to see if your issue has been fixed in a later version?

https://github.com/mperham/sidekiq/blob/master/Changes.md
https://github.com/mperham/sidekiq/blob/master/Pro-Changes.md
https://github.com/mperham/sidekiq/blob/master/Ent-Changes.md

@mperham
Copy link
Collaborator

mperham commented Mar 25, 2020 via email

@tylerdavis
Copy link
Author

My apologies, @mperham! Thanks for pointing me in the right direction.

@mperham
Copy link
Collaborator

mperham commented Mar 25, 2020

For other's benefit, this is a bug in sidekiq-cron loading some Sidekiq code it shouldn't.

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

2 participants