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

A copy of Spree::Preferences::Configuration has been removed from the module tree but is still active! #5104

Closed
masterkain opened this issue Aug 1, 2014 · 12 comments

Comments

@masterkain
Copy link
Contributor

running 2-3-stable

Started GET "/" for 127.0.0.1 at 2014-08-01 12:14:27 +0200
Processing by Spree::HomeController#index as HTML
Completed 500 Internal Server Error in 1ms

ArgumentError (A copy of Spree::Preferences::Configuration has been removed from the module tree but is still active!):
  activesupport (4.1.4) lib/active_support/dependencies.rb:465:in `load_missing_constant'
  activesupport (4.1.4) lib/active_support/dependencies.rb:180:in `const_missing'
  /Users/kain/.rvm/gems/ruby-2.1.2/bundler/gems/spree-293b8861d00b/core/app/models/spree/preferences/configuration.rb:32:in `preferences'
  /Users/kain/.rvm/gems/ruby-2.1.2/bundler/gems/spree-293b8861d00b/core/app/models/spree/preferences/preferable_class_methods.rb:13:in `block in preference'
  /Users/kain/.rvm/gems/ruby-2.1.2/bundler/gems/spree-293b8861d00b/core/app/models/spree/preferences/preferable.rb:43:in `get_preference'
  /Users/kain/.rvm/gems/ruby-2.1.2/bundler/gems/spree-293b8861d00b/core/lib/spree/core/controller_helpers/ssl.rb:8:in `block (2 levels) in <module:SSL>'
  activesupport (4.1.4) lib/active_support/callbacks.rb:438:in `instance_exec'
  activesupport (4.1.4) lib/active_support/callbacks.rb:438:in `block in make_lambda'
  activesupport (4.1.4) lib/active_support/callbacks.rb:142:in `call'
  activesupport (4.1.4) lib/active_support/callbacks.rb:142:in `block (2 levels) in halting_and_conditional'
  activesupport (4.1.4) lib/active_support/callbacks.rb:142:in `each'
  activesupport (4.1.4) lib/active_support/callbacks.rb:142:in `all?'
  activesupport (4.1.4) lib/active_support/callbacks.rb:142:in `block in halting_and_conditional'
  activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `call'
  activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `block in halting'
  activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `call'
  activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `block in halting'
  activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.4) lib/active_support/callbacks.rb:86:in `call'
  activesupport (4.1.4) lib/active_support/callbacks.rb:86:in `run_callbacks'
  actionpack (4.1.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.1.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
  activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.1.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.1.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.1.4) lib/abstract_controller/base.rb:136:in `process'
  actionview (4.1.4) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.1.4) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.1.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.1.4) lib/action_controller/metal.rb:232:in `block in action'
  actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:82:in `call'
  actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
  actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:50:in `call'
  actionpack (4.1.4) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `each'
  actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:678:in `call'
  railties (4.1.4) lib/rails/engine.rb:514:in `call'
  railties (4.1.4) lib/rails/railtie.rb:194:in `public_send'
  railties (4.1.4) lib/rails/railtie.rb:194:in `method_missing'
  actionpack (4.1.4) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `each'
  actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:678:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  rack (1.5.2) lib/rack/etag.rb:23:in `call'
  rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
  rack (1.5.2) lib/rack/head.rb:11:in `call'
  actionpack (4.1.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.1.4) lib/action_dispatch/middleware/flash.rb:254:in `call'
  rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.1.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  activerecord (4.1.4) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
  activerecord (4.1.4) lib/active_record/migration.rb:380:in `call'
  actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.1.4) lib/active_support/callbacks.rb:82:in `run_callbacks'
  actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.1.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  actionpack (4.1.4) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  actionpack (4.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.1.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.4) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.4) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.4) lib/rails/rack/logger.rb:20:in `call'
  quiet_assets (1.0.3) lib/quiet_assets.rb:23:in `call_with_quiet_assets'
  actionpack (4.1.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.1.4) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.4) lib/rails/engine.rb:514:in `call'
  railties (4.1.4) lib/rails/application.rb:144:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
  /Users/kain/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
  /Users/kain/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
  /Users/kain/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'


  Rendered /Users/kain/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.7ms)
  Rendered /Users/kain/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.3ms)
  Rendered /Users/kain/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms)
  Rendered /Users/kain/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (146.3ms)
@masterkain
Copy link
Contributor Author

This maybe has something to do with spring, running the tools with spring stopped does not result in errors.

Feel free to close if inappropriate, thanks!

@peterberkenbosch
Copy link
Member

Do you have a console open as well @masterkain? I have this now and then as well. Restarting the server or console solves it.

@JDutil
Copy link
Member

JDutil commented Aug 4, 2014

I think it's related to spring as well. I've never seen this particular error, but have experienced similar ones in development env caused by spring.

@phbernard
Copy link

I confirm the issue with spring. Running this from the command line solved the problem:

bin/spring stop
bin/spring

@masterkain
Copy link
Contributor Author

I got this without spring active, it seems that if an exception is being thrown (in development mode), the next request will result in this error. I'll try to reliably reproduce.

@masterkain
Copy link
Contributor Author

nope, cannot reproduce reliably, it's random.

@abrambailey
Copy link

I'm also getting this randomly ...

remote: git://github.com/spree/spree.git
  revision: 9d4617334c872e591839a930c2aa52c834ce0896
  branch: 2-3-stable
  specs:
    spree (2.3.2.beta)
      spree_api (= 2.3.2.beta)
      spree_backend (= 2.3.2.beta)
      spree_cmd (= 2.3.2.beta)
      spree_core (= 2.3.2.beta)
      spree_frontend (= 2.3.2.beta)
      spree_sample (= 2.3.2.beta)
    spree_api (2.3.2.beta)
      rabl (~> 0.9.4.pre1)
      spree_core (= 2.3.2.beta)
      versioncake (~> 2.3.1)
    spree_backend (2.3.2.beta)
      jquery-rails (= 3.1.0)
      jquery-ui-rails (~> 4.1.0)
      select2-rails (~> 3.5.0)
      spree_api (= 2.3.2.beta)
      spree_core (= 2.3.2.beta)
    spree_cmd (2.3.2.beta)
      thor (~> 0.14)
    spree_core (2.3.2.beta)
      activemerchant (~> 1.43.1)
      acts_as_list (= 0.3.0)
      awesome_nested_set (~> 3.0.0.rc.3)
      aws-sdk (= 1.27.0)
      cancancan (~> 1.8.4)
      deface (~> 1.0.0)
      ffaker (~> 1.16)
      font-awesome-rails (~> 4.0)
      friendly_id (~> 5.0.4)
      highline (~> 1.6.18)
      httparty (~> 0.11)
      json (~> 1.7)
      kaminari (~> 0.15.0)
      monetize
      paperclip (~> 4.1.1)
      paranoia (~> 2.0)
      rails (~> 4.1.4)
      ransack (~> 1.2.2)
      state_machine (= 1.2.0)
      stringex (~> 1.5.1)
      truncate_html (= 0.9.2)
    spree_frontend (2.3.2.beta)
      canonical-rails (~> 0.0.4)
      jquery-rails (= 3.1.0)
      spree_api (= 2.3.2.beta)
      spree_core (= 2.3.2.beta)
      stringex (~> 1.5.1)
    spree_sample (2.3.2.beta)
      spree_core (= 2.3.2.beta)

@abrambailey
Copy link

This error is caused for me whenever I change the route for the mounted spree engine without restarting my server.

@JDutil
Copy link
Member

JDutil commented Aug 12, 2014

Verified just hit this on master today. I still suspect this is related to spring, but not sure how to fix yet. I've run into other similar issues with Rails 4.1 like jumph4x/durable_decorator#24

@BenMorganIO
Copy link
Contributor

This is currently in my spree application. On Rails 4.1, but I removed the spring gem, bin/spring and its boot in the application. I am, however, using Zeus.

@BenMorganIO
Copy link
Contributor

Looks like its coming from here. Follow this SO QA with no hope.

It looks like Spree::Preferences::Configuration is not automatically being reloaded, but Spree::Preferences::ScopeStore is reloading.

@bbonislawski
Copy link
Contributor

I don't think we can fix this issue and I'm not sure if it still occurs since configuration got some updates.

If anyone encounters this, just restart spring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants