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

timestamping error when running inside jruby with sidekiq

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

      We just switched from ruby 1.9.3 -> jruby 1.7.4 and resque -> sidekiq. We use the sidekiq middleware kiqstand to keep the mongo connections in check. During a busy session, we get the following error on one of our mongoid models

      error : "undefined method `timestamping' for Models::User:Class",

      below is the backtrace... i am trying to understand what this error is but any pointers will be very helpful. Thanks

      backtrace : [
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/core_ext/class/attribute.rb:129:in `timestamping'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/core_ext/class/attribute.rb:133:in `timestamping?'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/timestamps/updated.rb:35:in `able_to_set_updated_at?'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:406:in `_run__556740268__update__1250094835__callbacks'",
            "org/jruby/RubyBasicObject.java:1703:in `__send__'",
            "org/jruby/RubyKernel.java:2209:in `send'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__run_callback'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:390:in `_run_update_callbacks'",
            "org/jruby/RubyBasicObject.java:1703:in `__send__'",
            "org/jruby/RubyKernel.java:2209:in `send'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_callbacks'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/callbacks.rb:130:in `run_callbacks'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/persistence/modification.rb:25:in `prepare'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:406:in `_run__556740268__save__1250094835__callbacks'",
            "org/jruby/RubyBasicObject.java:1703:in `__send__'",
            "org/jruby/RubyKernel.java:2209:in `send'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__run_callback'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:390:in `_run_save_callbacks'",
            "org/jruby/RubyBasicObject.java:1703:in `__send__'",
            "org/jruby/RubyKernel.java:2209:in `send'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_callbacks'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/callbacks.rb:130:in `run_callbacks'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/persistence/modification.rb:24:in `prepare'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/persistence/operations/update.rb:45:in `persist'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/persistence.rb:145:in `update'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/persistence.rb:82:in `save'",
            "org/jruby/RubyBasicObject.java:1703:in `__send__'",
            "org/jruby/RubyKernel.java:2209:in `send'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/relations/proxy.rb:143:in `method_missing'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/relations/auto_save.rb:82:in `_callback_after_35'",
            "org/jruby/RubyArray.java:1617:in `each'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/relations/auto_save.rb:81:in `_callback_after_35'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/relations/auto_save.rb:35:in `__autosaving__'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/relations/auto_save.rb:78:in `_callback_after_35'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:408:in `_run__374838223__save__1250094835__callbacks'",
            "org/jruby/RubyBasicObject.java:1703:in `__send__'",
            "org/jruby/RubyKernel.java:2209:in `send'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__run_callback'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:390:in `_run_save_callbacks'",
            "org/jruby/RubyBasicObject.java:1703:in `__send__'",
            "org/jruby/RubyKernel.java:2209:in `send'",
            "/shared/bundle/jruby/1.9/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_callbacks'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/callbacks.rb:130:in `run_callbacks'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/persistence/modification.rb:24:in `prepare'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/persistence/operations/update.rb:45:in `persist'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/persistence.rb:145:in `update'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/persistence.rb:82:in `save'",
            "/shared/bundle/jruby/1.9/gems/mongoid-3.1.5/lib/mongoid/persistence.rb:96:in `save!'",
            "/models/events/event.rb:64:in `update_status!'",
            "/models/events/event.rb:82:in `completed'",
            "/models/events/activity.rb:48:in `completed'",
            "/models/events/activity.rb:62:in `complete_if_done'",
            "/shared/bundle/jruby/1.9/bundler/gems/mongoid-locker-50158725657c/lib/mongoid/locker.rb:83:in `with_lock'",
            "/shared/bundle/jruby/1.9/bundler/gems/mongoid-locker-50158725657c/lib/mongoid/locker.rb:82:in `with_lock'",
            "/models/events/event.rb:212:in `with_lock_with_defaults'",
            "/models/events/activity.rb:61:in `complete_if_done'",
            "org/jruby/RubyBasicObject.java:1703:in `__send__'",
            "/async/job.rb:39:in `perform'",
            "/async/job.rb:18:in `perform'",
            "/workers/sidekiq_job_worker.rb:14:in `perform'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/processor.rb:48:in `process'",
            "org/jruby/RubyProc.java:255:in `call'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/middleware/chain.rb:115:in `invoke'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/middleware/server/active_record.rb:6:in `call'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/middleware/chain.rb:117:in `invoke'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/middleware/server/retry_jobs.rb:62:in `call'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/middleware/chain.rb:117:in `invoke'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/middleware/server/logging.rb:11:in `call'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/logging.rb:22:in `with_context'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/logging.rb:20:in `with_context'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/middleware/server/logging.rb:7:in `call'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/middleware/chain.rb:117:in `invoke'",
            "org/jruby/RubyProc.java:255:in `call'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/middleware/chain.rb:120:in `invoke'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/processor.rb:47:in `process'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/processor.rb:102:in `stats'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/processor.rb:101:in `stats'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/processor.rb:46:in `process'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/processor.rb:40:in `process'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/processor.rb:83:in `do_defer'",
            "/shared/bundle/jruby/1.9/gems/sidekiq-2.14.1/lib/sidekiq/processor.rb:37:in `process'",
            "org/jruby/RubyKernel.java:1932:in `public_send'",
            "/shared/bundle/jruby/1.9/gems/celluloid-0.15.1/lib/celluloid/calls.rb:25:in `dispatch'",
            "/shared/bundle/jruby/1.9/gems/celluloid-0.15.1/lib/celluloid/calls.rb:122:in `dispatch'",
            "/shared/bundle/jruby/1.9/gems/celluloid-0.15.1/lib/celluloid/actor.rb:322:in `handle_message'",
            "/shared/bundle/jruby/1.9/gems/celluloid-0.15.1/lib/celluloid/actor.rb:416:in `task'",
            "/shared/bundle/jruby/1.9/gems/celluloid-0.15.1/lib/celluloid/tasks.rb:55:in `initialize'",
            "/shared/bundle/jruby/1.9/gems/celluloid-0.15.1/lib/celluloid/tasks.rb:47:in `initialize'",
            "/shared/bundle/jruby/1.9/gems/celluloid-0.15.1/lib/celluloid/tasks/task_fiber.rb:13:in `create'"
      

            Assignee:
            arthurnn Arthur Nogueira Neves
            Reporter:
            nchainani nchainani
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: