spree-contrib / spree_wishlist

Wishlist extension for Spree Commerce.

Home Page:http://guides.spreecommerce.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Session unmarshalling issue with Rails 4.1

jasonfb opened this issue · comments

Upon upgrading to Rails 4.1, we are seeing a new session unmarshall problem that looks like it is related to some unmarshalling stuff caused by this Gem

NameError: uninitialized constant ActiveRecord::Relation::ActiveRecord_Relation_Spree_WishedProduct
Backtrace
More    
application_controller.rb  50  set_utm_fields(...)
[PROJECT_ROOT]/app/controllers/application_controller.rb:50:in `set_utm_fields'
URL GET https://www.mackweldon.com/t/categories/underwear
Location    production on 438fce03-2ebd-412a-bcd5-375237bd444e
Referrer    https://www.google.com/
Browser 32 chromeWindowsUs Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36
Timeline    
Apr 17 - 12:00 amApr 17 - 2:00 amApr 17 - 4:00 amApr 17 - 6:00 amApr 17 - 8:00 amApr 17 - 10:00 amApr 17 - 12:00 pmApr 17 - 2:00 pmApr 17 - 4:00 pmApr 17 - 6:00 pmApr 17 - 8:00 pm
01234
Tags (edit) 
 Delete   Ignore     Share URL   Search Stack Overflow

Switch Style 
Application Backtrace

[PROJECT_ROOT]/app/controllers/application_controller.rb:50 :in `set_utm_fields`
48 
49   def set_utm_fields
50     session[:utm_keys] = {} if session[:utm_keys].blank?
51     utm_hash = {}
52     UTM_KEYS.each do |key|
Full Backtrace

[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/inflector/methods.rb:240 :in `const_get`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/inflector/methods.rb:240 :in `block in constantize`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/inflector/methods.rb:236 :in `each`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/inflector/methods.rb:236 :in `inject`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/inflector/methods.rb:236 :in `constantize`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/core_ext/string/inflections.rb:66 :in `constantize`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/core_ext/marshal.rb:10 :in `rescue in load_with_autoloading`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/core_ext/marshal.rb:6 :in `load_with_autoloading`
[GEM_ROOT]/gems/activerecord-session_store-0.1.1/lib/active_record/session_store.rb:12 :in `unmarshal`
[GEM_ROOT]/gems/activerecord-session_store-0.1.1/lib/active_record/session_store/session.rb:69 :in `data`
[GEM_ROOT]/gems/activerecord-session_store-0.1.1/lib/action_dispatch/session/active_record_store.rb:73 :in `block in get_session`
[GEM_ROOT]/gems/activerecord-session_store-0.1.1/lib/active_record/session_store/extension/logger_silencer.rb:42 :in `silence`
[GEM_ROOT]/gems/activerecord-session_store-0.1.1/lib/action_dispatch/session/active_record_store.rb:65 :in `get_session`
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:266 :in `load_session`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/session/abstract_store.rb:43 :in `block in load_session`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/session/abstract_store.rb:51 :in `stale_session_check!`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/session/abstract_store.rb:43 :in `load_session`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/request/session.rb:180 :in `load!`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/request/session.rb:172 :in `load_for_read!`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/request/session.rb:89 :in `[]`
[PROJECT_ROOT]/app/controllers/application_controller.rb:50 :in `set_utm_fields`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:424 :in `block in make_lambda`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:160 :in `call`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:160 :in `block in halting`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:229 :in `call`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:229 :in `block in halting`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:166 :in `call`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:166 :in `block in halting`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:166 :in `call`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:166 :in `block in halting`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:166 :in `call`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:166 :in `block in halting`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:166 :in `call`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:166 :in `block in halting`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:86 :in `call`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:86 :in `run_callbacks`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/abstract_controller/callbacks.rb:19 :in `process_action`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_controller/metal/rescue.rb:29 :in `process_action`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_controller/metal/instrumentation.rb:31 :in `block in process_action`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/notifications.rb:159 :in `block in instrument`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/notifications/instrumenter.rb:20 :in `instrument`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/notifications.rb:159 :in `instrument`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_controller/metal/instrumentation.rb:30 :in `process_action`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_controller/metal/params_wrapper.rb:250 :in `process_action`
[GEM_ROOT]/gems/activerecord-4.1.9/lib/active_record/railties/controller_runtime.rb:18 :in `process_action`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/abstract_controller/base.rb:136 :in `process`
[GEM_ROOT]/gems/actionview-4.1.9/lib/action_view/rendering.rb:30 :in `process`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_controller/metal.rb:196 :in `dispatch`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_controller/metal/rack_delegation.rb:13 :in `dispatch`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_controller/metal.rb:232 :in `block in action`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/routing/route_set.rb:82 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/routing/route_set.rb:82 :in `dispatch`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/routing/route_set.rb:50 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/journey/router.rb:73 :in `block in call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/journey/router.rb:59 :in `each`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/journey/router.rb:59 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/routing/route_set.rb:685 :in `call`
[GEM_ROOT]/gems/railties-4.1.9/lib/rails/engine.rb:514 :in `call`
[GEM_ROOT]/gems/railties-4.1.9/lib/rails/railtie.rb:194 :in `public_send`
[GEM_ROOT]/gems/railties-4.1.9/lib/rails/railtie.rb:194 :in `method_missing`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/journey/router.rb:73 :in `block in call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/journey/router.rb:59 :in `each`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/journey/router.rb:59 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/routing/route_set.rb:685 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/rack/agent_hooks.rb:30 :in `traced_call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:55 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/rack/browser_monitoring.rb:23 :in `traced_call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:55 :in `call`
[GEM_ROOT]/gems/warden-1.2.3/lib/warden/manager.rb:35 :in `block in call`
[GEM_ROOT]/gems/warden-1.2.3/lib/warden/manager.rb:34 :in `catch`
[GEM_ROOT]/gems/warden-1.2.3/lib/warden/manager.rb:34 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/etag.rb:23 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/conditionalget.rb:25 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/head.rb:11 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/params_parser.rb:27 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/flash.rb:254 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225 :in `context`
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/cookies.rb:562 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/activerecord-4.1.9/lib/active_record/query_cache.rb:36 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:621 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/callbacks.rb:29 :in `block in call`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/callbacks.rb:82 :in `run_callbacks`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/callbacks.rb:27 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/remote_ip.rb:76 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/debug_exceptions.rb:17 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/show_exceptions.rb:30 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/railties-4.1.9/lib/rails/rack/logger.rb:38 :in `call_app`
[GEM_ROOT]/gems/railties-4.1.9/lib/rails/rack/logger.rb:20 :in `block in call`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/tagged_logging.rb:68 :in `block in tagged`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/tagged_logging.rb:26 :in `tagged`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/tagged_logging.rb:68 :in `tagged`
[GEM_ROOT]/gems/railties-4.1.9/lib/rails/rack/logger.rb:20 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/request_id.rb:21 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/methodoverride.rb:21 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/runtime.rb:17 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/activesupport-4.1.9/lib/active_support/cache/strategy/local_cache_middleware.rb:26 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/actionpack-4.1.9/lib/action_dispatch/middleware/static.rb:84 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/sendfile.rb:112 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/rack-timeout-0.2.0/lib/rack/timeout.rb:108 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/railties-4.1.9/lib/rails/engine.rb:514 :in `call`
[GEM_ROOT]/gems/railties-4.1.9/lib/rails/application.rb:144 :in `call`
[GEM_ROOT]/gems/railties-4.1.9/lib/rails/railtie.rb:194 :in `public_send`
[GEM_ROOT]/gems/railties-4.1.9/lib/rails/railtie.rb:194 :in `method_missing`
[GEM_ROOT]/gems/newrelic_rpm-3.9.9.275/lib/new_relic/agent/instrumentation/middleware_tracing.rb:57 :in `call`
[GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:576 :in `process_client`
[GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:670 :in `worker_loop`
[GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525 :in `spawn_missing_workers`
[GEM_ROOT]/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:140 :in `start`
[GEM_ROOT]/gems/unicorn-4.8.3/bin/unicorn:126 :in `<top (required)>`
[GEM_ROOT]/bin/unicorn:23 :in `load`
[GEM_ROOT]/bin/unicorn:23 :in `<main>`

I saw something like this on Rails 3 before, but that problem was fixed with a Rails 4 upgrade.

I think the issue is that the session contains information referencing the object or relation in a way that makes it so that when Rails goes to unmarshall it blows up.

The line of code it is blowing up on is not related to spree wishlist, but as you can see it simply blows up when it tries to access any session variable at all.

This was reported to us by a user on Twitter, as far as we know, he is the only affected person (but I'm sure there are others)