Project

General

Profile

Bug #14225

super: no superclass method `load_defaults' for #<Class:..> on startup

Added by Dominic Cleal about 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Settings
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Nightly tests on Debian Wheezy and Ubuntu Precise are failing to start the application under Apache with the following error:

[ pid=9283 thr=19585120 file=utils.rb:176 time=2016-03-16 08:51:14.807 ]: *** Exception NoMethodError in PhusionPassenger::Rack::ApplicationSpawner (super: no superclass method `load_defaults' for #<Class:0x00000002e035d8>) (process 9283, thread #<Thread:0x0000000255b0c0>):
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-4.1.14.2/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
        from /usr/share/foreman/app/models/setting/general.rb:5:in `load_defaults'
        from /usr/share/foreman/config/initializers/foreman.rb:21:in `each'
        from /usr/share/foreman/config/initializers/foreman.rb:21:in `<top (required)>'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:241:in `load'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:241:in `block in load'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:232:in `load_dependency'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:241:in `load'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/engine.rb:648:in `block in load_config_initializer'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-4.1.14.2/lib/active_support/notifications.rb:161:in `instrument'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/engine.rb:647:in `load_config_initializer'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/engine.rb:611:in `each'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/engine.rb:611:in `block in <class:Engine>'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/initializable.rb:30:in `instance_exec'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/initializable.rb:30:in `run'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /usr/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
        from /usr/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
        from /usr/lib/ruby/1.9.1/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
        from /usr/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
        from /usr/lib/ruby/1.9.1/tsort.rb:209:in `block in each_strongly_connected_component_from'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/initializable.rb:44:in `each'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/initializable.rb:44:in `tsort_each_child'
        from /usr/lib/ruby/1.9.1/tsort.rb:203:in `each_strongly_connected_component_from'
        from /usr/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
        from /usr/lib/ruby/1.9.1/tsort.rb:180:in `each'
        from /usr/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
        from /usr/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/initializable.rb:54:in `run_initializers'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/application.rb:300:in `initialize!'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/railtie.rb:194:in `public_send'
        from /usr/share/foreman/vendor/ruby/1.9.1/gems/railties-4.1.14.2/lib/rails/railtie.rb:194:in `method_missing'
        from /usr/share/foreman/config/environment.rb:5:in `<top (required)>'
        from config.ru:3:in `require'
        from config.ru:3:in `block in <main>'

These are the two Ruby 1.9.3 platforms remaining, so it could only affect 1.9.3. Reverting the commit in #6924 lets the application load normally.


Related issues

Related to Foreman - Bug #6924: UI should throw proper validation error while updating some params with any random value(like utf-8 or -ve values)Closed2014-08-05

Associated revisions

Revision f7f6bd5e (diff)
Added by Dominic Cleal about 6 years ago

fixes #14225 - add missing require for Resolv

Setting itself is explicitly required too, which will provide a better
error message in future for this and similar issues loading the class.

History

#1 Updated by Dominic Cleal about 6 years ago

  • Related to Bug #6924: UI should throw proper validation error while updating some params with any random value(like utf-8 or -ve values) added

#2 Updated by Dominic Cleal about 6 years ago

The underlying error in the Setting class (visible when adding a require_dependency from the initialiser for setting.rb) is:

[ pid=9283 thr=19585120 file=utils.rb:176 time=2016-03-16 09:15:16.074 ]: *** Exception NameError in PhusionPassenger::Rack::ApplicationSpawner (uninitialized constant Setting::Resolv) (process 9283, thread #<Thread:0x0000000255b0c0>):
        from /usr/share/foreman/app/models/setting.rb:43:in `<class:Setting>'
        from /usr/share/foreman/app/models/setting.rb:3:in `<top (required)>'
        from /usr/share/foreman/config/initializers/foreman.rb:17:in `<top (required)>'

#3 Updated by The Foreman Bot about 6 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3332 added

#4 Updated by Dominic Cleal about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF