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

NPE on tagged logger #123

Closed
lanxx019 opened this issue Apr 13, 2017 · 1 comment
Closed

NPE on tagged logger #123

lanxx019 opened this issue Apr 13, 2017 · 1 comment
Labels

Comments

@lanxx019
Copy link
Contributor

We have a lot of test failures on this:

      NoMethodError:
        undefined method `size' for nil:NilClass
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/logstash-logger-0.22.1/lib/logstash-logger/tagged_logging.rb:18:in `ensure in tagged'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/logstash-logger-0.22.1/lib/logstash-logger/tagged_logging.rb:18:in `tagged'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/logstash-logger-0.22.1/lib/logstash-logger/tagged_logging.rb:5:in `tagged'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/rack/logger.rb:20:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/rack-1.5.5/lib/rack/session/abstract/id.rb:225:in `context'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/rack-1.5.5/lib/rack/session/abstract/id.rb:220:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/actionpack-4.0.13/lib/action_dispatch/middleware/cookies.rb:486:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/request_store-1.3.1/lib/request_store/middleware.rb:9:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/actionpack-4.0.13/lib/action_dispatch/middleware/request_id.rb:21:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/rack-1.5.5/lib/rack/methodoverride.rb:21:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/rack-1.5.5/lib/rack/runtime.rb:17:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/activesupport-4.0.13/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/actionpack-4.0.13/lib/action_dispatch/middleware/static.rb:84:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/rack-1.5.5/lib/rack/sendfile.rb:112:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/rack-cors-0.4.0/lib/rack/cors.rb:80:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/engine.rb:511:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/application.rb:97:in `call'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/rack-test-0.6.3/lib/rack/mock_session.rb:30:in `request'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/rack-test-0.6.3/lib/rack/test.rb:244:in `process_request'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/rack-test-0.6.3/lib/rack/test.rb:124:in `request'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/actionpack-4.0.13/lib/action_dispatch/testing/integration.rb:311:in `process'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/actionpack-4.0.13/lib/action_dispatch/testing/integration.rb:32:in `get'
      # /home/vagrant/.rvm/gems/ruby-2.2.3/gems/actionpack-4.0.13/lib/action_dispatch/testing/integration.rb:345:in `block (2 levels) in <module:Runner>'
      # ./spec/requests/stark/stark_helper.rb:51:in `stark_request'
      # ./spec/requests/stark/stark_helper.rb:19:in `stark_get'
      # ./spec/requests/stark/dashboard_shipment_list_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/requests/stark/dashboard_shipment_list_spec.rb:81:in `block (5 levels) in <top (required)>'
      # ------------------
      # --- Caused by: ---
      # NoMethodError:
      #   undefined method `empty?' for nil:NilClass
      #   /home/vagrant/.rvm/gems/ruby-2.2.3/gems/logstash-logger-0.22.1/lib/logstash-logger/tagged_logging.rb:22:in `reject'

I do not know or care why we are getting nil tags, but I think it would be save to check it inside the reject block here

@dwbutler dwbutler added the bug label Apr 14, 2017
@dwbutler
Copy link
Owner

Fixed in #124

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