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

NoMethodError: undefined method `logger' for Hash #129

Closed
Kounotori-ssbm opened this issue Jun 21, 2022 · 1 comment · Fixed by #135
Closed

NoMethodError: undefined method `logger' for Hash #129

Kounotori-ssbm opened this issue Jun 21, 2022 · 1 comment · Fixed by #135

Comments

@Kounotori-ssbm
Copy link

Kounotori-ssbm commented Jun 21, 2022

After upgrading to Sidekiq 6.5.0+, we got the following error at Sidekiq::Component#logger.

NoMethodError: undefined method `logger' for {:queues=>["... (configuration in sidekiq.yml) ...}

This is why Sidekiq::LimitFetch#bulk_requeue passes Sidekiq.options to Sidekiq::BasicFetch.new.

Sidekiq::BasicFetch.new(Sidekiq.options).bulk_requeue(*args)

Sidekiq 6.5.0+ expects not Sidekiq.options but Sidekiq as config and it is treated by Sidekiq::Component module. You can also see it at Sidekiq::CLI class.
https://github.com/mperham/sidekiq/blob/e830ecd7ac1539877de03e57fb4807765f5fa392/lib/sidekiq/cli.rb#L25

      @config = Sidekiq

If Sidekiq.option was passed on Sidekiq 6.5.0+ as config, Sidekiq::BasicFetch#bulk_requeue will crash.
Because it call logger.debug and the logger is implemented as config.logger at Sidekiq::Component.

Conclusion

Sidekiq::LimitFetch#bulk_requeue also should not pass Sidekiq.options but Sidekiq to a argument of Sidekiq::BasicFetch.new fot Sidekiq 6.5.0+.
I think it should be like this:

Sidekiq::BasicFetch.new(Sidekiq).bulk_requeue(*args)
@deanpcmad
Copy link
Owner

Will take a look :)

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

Successfully merging a pull request may close this issue.

2 participants