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

Rate Throttling Throws Error #2684

Closed
pglombardo opened this issue Oct 25, 2024 · 6 comments · Fixed by #2685
Closed

Rate Throttling Throws Error #2684

pglombardo opened this issue Oct 25, 2024 · 6 comments · Fixed by #2685

Comments

@pglombardo
Copy link
Owner

comment throttling (minute or second) raise an issue in rake component and docker not start

ArgumentError: Must pass :limit option (ArgumentError)

          raise ArgumentError, "Must pass #{opt.inspect} option" unless options[opt]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/rack-attack-6.7.0/lib/rack/attack/throttle.rb:14:in `block in initialize'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/rack-attack-6.7.0/lib/rack/attack/throttle.rb:13:in `each'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/rack-attack-6.7.0/lib/rack/attack/throttle.rb:13:in `initialize'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/rack-attack-6.7.0/lib/rack/attack/configuration.rb:72:in `new'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/rack-attack-6.7.0/lib/rack/attack/configuration.rb:72:in `throttle'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/forwardable-1.3.3/lib/forwardable.rb:240:in `throttle'
/opt/PasswordPusher/config/initializers/rack_attack.rb:34:in `<class:Attack>'
/opt/PasswordPusher/config/initializers/rack_attack.rb:2:in `<main>'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/engine.rb:689:in `load'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/engine.rb:689:in `block in load_config_initializer'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.1.2/lib/active_support/notifications.rb:212:in `instrument'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/engine.rb:688:in `load_config_initializer'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/engine.rb:642:in `block (2 levels) in <class:Engine>'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/engine.rb:641:in `each'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/engine.rb:641:in `block in <class:Engine>'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/initializable.rb:32:in `instance_exec'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/initializable.rb:32:in `run'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/initializable.rb:61:in `block in run_initializers'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/initializable.rb:50:in `each'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/initializable.rb:50:in `tsort_each_child'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/initializable.rb:60:in `run_initializers'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/application.rb:435:in `initialize!'
/opt/PasswordPusher/config/environment.rb:7:in `<main>'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/application.rb:411:in `require_environment!'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1.2/lib/rails/application.rb:559:in `block in run_tasks_blocks'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/cli/exec.rb:58:in `load'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/cli/exec.rb:58:in `kernel_load'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/cli/exec.rb:23:in `run'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/cli.rb:455:in `exec'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/cli.rb:35:in `dispatch'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/cli.rb:29:in `start'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/exe/bundle:28:in `block in <top (required)>'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/opt/PasswordPusher/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.17/exe/bundle:20:in `<top (required)>'

Originally posted by @0x25 in #2157 (comment)

@pglombardo pglombardo mentioned this issue Oct 25, 2024
11 tasks
@pglombardo
Copy link
Owner Author

Which Docker tag were you using @0x25?

@0x25
Copy link

0x25 commented Oct 25, 2024

hello,

for my test I create the docker with

docker run -d --mount type=bind,source=/opt/passwordpusher/settings.yml,target=/opt/PasswordPusher/config/settings.yml \                           
      --mount type=bind,source=/opt/passwordpusher/db.sqlite3,target=/opt/PasswordPusher/db/db.sqlite3 \
      -p "5100:5100" pglombardo/pwpush:latest

After that a simple docker start with my modified settings.yml

I mount the the db because I didn't have any smtp. So I can extract the token and validate manually for my test :) .

@pglombardo
Copy link
Owner Author

Ok - fix is in #2685. I'll try to release this today. Thanks for reporting!

@pglombardo
Copy link
Owner Author

This should be fixed in v1.47.3 - could you try out that version and let me know?

@0x25
Copy link

0x25 commented Oct 25, 2024

hello,

no more error if I comment vars in throttling.
fast patch ;)

@pglombardo
Copy link
Owner Author

Excellent then - I'll close this out but let me know if anything else comes up. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants