-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
I'm getting random undefined method `map' for nil:NilClass from mongoid/sessions/factory.rb:122 when using Sidekiq. We're using kiqstand.
I'm guessing there's some issue with the session getting corrupted as config["hosts"] is nil, but our config file is correct. Rerunning the job fixes it.
Thoughts?
Below is the backtrace.
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/sessions/factory.rb:122:in `inject_ports'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/sessions/factory.rb:106:in `parse'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/sessions/factory.rb:62:in `create_session'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/sessions/factory.rb:28:in `create'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/sessions.rb:137:in `with_name'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/sessions.rb:390:in `session'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/sessions.rb:227:in `mongo_session'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/sessions.rb:171:in `collection'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/contextual/mongo.rb:260:in `initialize'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/contextual.rb:51:in `create_context'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/contextual.rb:34:in `context'
/app/vendor/bundle/jruby/1.9/gems/mongoid-3.1.6/lib/mongoid/contextual.rb:19:in `size'
/app/models/api_auth.rb:45:in `find_by_api_key'