Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-3685

nil error in mongoid/sessions/factory.rb

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      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'

            Assignee:
            Unassigned Unassigned
            Reporter:
            calebclark calebclark
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: