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

Specifying blacklist_keys with whitelist_keys can result in error #276

Closed
thompiler opened this issue Oct 25, 2017 · 0 comments
Closed

Specifying blacklist_keys with whitelist_keys can result in error #276

thompiler opened this issue Oct 25, 2017 · 0 comments
Labels

Comments

@thompiler
Copy link
Member

thompiler commented Oct 25, 2017

Specifying both blacklist_keys and whitelist_keys, can result in an error.

Example Airbrake config:

Airbrake.configure do |c|
  ...

  c.blacklist_keys = %i[password password_confirmation]
  c.whitelist_keys = [:email, /user/i, 'account_id']
end

(commenting out the blacklist_keys line or setting blacklist_keys = [] does not result in this error)

Error shown in log:

NoMethodError (undefined method `each_key' for "[Filtered]":String
Did you mean?  each_byte):
  airbrake-ruby (2.5.0) lib/airbrake-ruby/filters/keys_filter.rb:76:in `filter_hash'
  airbrake-ruby (2.5.0) lib/airbrake-ruby/filters/keys_filter.rb:134:in `filter_context_key'
  airbrake-ruby (2.5.0) lib/airbrake-ruby/filters/keys_filter.rb:61:in `block in call'
  airbrake-ruby (2.5.0) lib/airbrake-ruby/filters/keys_filter.rb:61:in `each'
  airbrake-ruby (2.5.0) lib/airbrake-ruby/filters/keys_filter.rb:61:in `call'
  airbrake-ruby (2.5.0) lib/airbrake-ruby/filter_chain.rb:47:in `block in refine'
  airbrake-ruby (2.5.0) lib/airbrake-ruby/filter_chain.rb:45:in `each'
  airbrake-ruby (2.5.0) lib/airbrake-ruby/filter_chain.rb:45:in `refine'
  airbrake-ruby (2.5.0) lib/airbrake-ruby/notifier.rb:126:in `send_notice'
  airbrake-ruby (2.5.0) lib/airbrake-ruby/notifier.rb:50:in `notify'
  airbrake (7.1.0) lib/airbrake/rack/middleware.rb:80:in `notify_airbrake'
  airbrake (7.1.0) lib/airbrake/rack/middleware.rb:54:in `rescue in call'
  airbrake (7.1.0) lib/airbrake/rack/middleware.rb:51:in `call'
  activerecord (4.2.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
  actionpack (4.2.9) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.9) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
  activesupport (4.2.9) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
  activesupport (4.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.9) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.2.9) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  actionpack (4.2.9) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  actionpack (4.2.9) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.2.9) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.9) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.9) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.9) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.9) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.9) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.9) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.9) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.8) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.8) lib/rack/runtime.rb:18:in `call'
  rack (1.6.8) lib/rack/lock.rb:17:in `call'
  rack-livereload (0.3.16) lib/rack/livereload.rb:23:in `_call'
  rack-livereload (0.3.16) lib/rack/livereload.rb:14:in `call'
  actionpack (4.2.9) lib/action_dispatch/middleware/static.rb:120:in `call'
  rack (1.6.8) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.9) lib/rails/engine.rb:518:in `call'
  railties (4.2.9) lib/rails/application.rb:165:in `call'
  rack (1.6.8) lib/rack/content_length.rb:15:in `call'
  thin (1.5.1) lib/thin/connection.rb:81:in `block in pre_process'
  thin (1.5.1) lib/thin/connection.rb:79:in `catch'
  thin (1.5.1) lib/thin/connection.rb:79:in `pre_process'
  thin (1.5.1) lib/thin/connection.rb:54:in `process'
  thin (1.5.1) lib/thin/connection.rb:39:in `receive_data'
  eventmachine (1.0.9.1) lib/eventmachine.rb:193:in `run_machine'
  eventmachine (1.0.9.1) lib/eventmachine.rb:193:in `run'
  thin (1.5.1) lib/thin/backends/base.rb:63:in `start'
  thin (1.5.1) lib/thin/server.rb:159:in `start'
  rack (1.6.8) lib/rack/handler/thin.rb:19:in `run'
  rack (1.6.8) lib/rack/server.rb:287:in `start'
  railties (4.2.9) lib/rails/commands/server.rb:80:in `start'
  railties (4.2.9) lib/rails/commands/commands_tasks.rb:80:in `block in server'
  railties (4.2.9) lib/rails/commands/commands_tasks.rb:75:in `tap'
  railties (4.2.9) lib/rails/commands/commands_tasks.rb:75:in `server'
  railties (4.2.9) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
  railties (4.2.9) lib/rails/commands.rb:17:in `<top (required)>'
  bin/rails:4:in `require'
  bin/rails:4:in `<main>
@thompiler thompiler changed the title Specifying blacklist_keys with whitelist_keys results in error Specifying blacklist_keys with whitelist_keys can result in error Oct 25, 2017
@kyrylo kyrylo added the Bug label Oct 26, 2017
kyrylo added a commit that referenced this issue Oct 26, 2017
Fixes #276 (Specifying `blacklist_keys` with `whitelist_keys` can result in
error)
kyrylo added a commit that referenced this issue Oct 26, 2017
Fixes #276 (Specifying `blacklist_keys` with `whitelist_keys` can result in
error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants