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

WebRunner does not correctly function when passing in Namespace #1815

Open
essjayhch opened this issue Aug 9, 2022 · 1 comment
Open

WebRunner does not correctly function when passing in Namespace #1815

essjayhch opened this issue Aug 9, 2022 · 1 comment

Comments

@essjayhch
Copy link
Contributor

Due to a bug in Line 89 the resque-web binary will not start when passing in -N.

This can easily be corrected by adjusting to line so it doesn't reference runner.logger.info rather logger.info.

Details

Observed in versions

  • v2.2.1

Observed Behaviour

bundler: failed to load command: resque-web (/usr/local/.rbenv/versions/2.7.6/bin/resque-web)
Traceback (most recent call last):
   20: from /usr/local/.rbenv/versions/2.7.6/bin/bundle:25:in `<main>'
   19: from /usr/local/.rbenv/versions/2.7.6/bin/bundle:25:in `load'
   18: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/exe/bundle:36:in `<top (required)>'
   17: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
   16: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/exe/bundle:48:in `block in <top (required)>'
   15: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/cli.rb:25:in `start'
   14: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
   13: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/cli.rb:31:in `dispatch'
   12: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
   11: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
   10: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    9: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/cli.rb:483:in `exec'
    8: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/cli/exec.rb:23:in `run'
    7: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/cli/exec.rb:58:in `kernel_load'
    6: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.3.9/lib/bundler/cli/exec.rb:58:in `load'
    5: from /usr/local/.rbenv/versions/2.7.6/bin/resque-web:25:in `<top (required)>'
    4: from /usr/local/.rbenv/versions/2.7.6/bin/resque-web:25:in `load'
    3: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/resque-2.2.1/bin/resque-web:15:in `<top (required)>'
    2: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/resque-2.2.1/bin/resque-web:15:in `new'
    1: from /usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/resque-2.2.1/lib/resque/web_runner.rb:47:in `initialize'
/usr/local/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/resque-2.2.1/lib/resque/web_runner.rb:89:in `before_run': undefined local variable or method `runner' for #<Resque::WebRunner:0x0000000002454168> (NameError)

Expected Behaviour

[2022-08-09 12:34:56 +0000] Using Redis namespace 'default'
....
[2022-08-09 12:34:56 +0000] Starting 'resque-web'...
[2022-08-09 12:34:56 +0000] trying port 5678...
[2022-08-09 12:34:56 +0000] Running with Rack handler: Rack::Handler::WEBrick
[2022-08-09 12:34:56] INFO  WEBrick 1.7.0
[2022-08-09 12:34:56] INFO  ruby 2.7.6 (2022-04-12) [x86_64-linux]
[2022-08-09 12:34:56] INFO  WEBrick::HTTPServer#start: pid=19631 port=5678
@essjayhch
Copy link
Contributor Author

This appears to have been mitigated in 2.3.0, however Resque.redis.namespace = namespace needs to be set after Resque.redis = redis_conf due to the fact that the latter resets the Resque.redis object, so otherwise -N cannot interact with -r.

-r also does not understand redis://host:port/db/namespace syntax, it cuts off at db

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

1 participant