Project

General

Profile

Actions

Bug #2343

closed

app/models/setting.rb#default chokes on nil attributes

Added by David Schmitt over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

On a freshly installed wheezy with the 1.1.1+debian1 packages from deb.theforeman.org, I get the following trace:

rake aborted!
can't convert nil into String
/usr/lib/ruby/1.9.1/psych.rb:203:in `parse'
/usr/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
/usr/lib/ruby/1.9.1/psych.rb:151:in `parse'
/usr/lib/ruby/1.9.1/psych.rb:127:in `load'
/usr/share/foreman/app/models/setting.rb:77:in `default'
/usr/share/foreman/app/models/setting.rb:63:in `value='
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.0.20/lib/active_record/base.rb:1569:in `block in attributes='
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.0.20/lib/active_record/base.rb:1565:in `each'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.0.20/lib/active_record/base.rb:1565:in `attributes='
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.0.20/lib/active_record/base.rb:1416:in `initialize'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.0.20/lib/active_record/validations.rb:32:in `new'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.0.20/lib/active_record/validations.rb:32:in `create!'
/usr/share/foreman/lib/foreman/default_settings/loader.rb:21:in `create'
/usr/share/foreman/lib/foreman/default_settings/loader.rb:77:in `block (2 levels) in load'
/usr/share/foreman/lib/foreman/default_settings/loader.rb:61:in `each'
/usr/share/foreman/lib/foreman/default_settings/loader.rb:61:in `block in load'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.0.20/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.0.20/lib/active_record/transactions.rb:207:in `transaction'
/usr/share/foreman/lib/foreman/default_settings/loader.rb:33:in `load'
/usr/share/foreman/config/initializers/foreman.rb:4:in `<top (required)>'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in `load'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in `block in load'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:227:in `load_dependency'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in `load'
/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.0.20/lib/rails/engine.rb:201:in `block (2 levels) in <class:Engine>'
/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.0.20/lib/rails/engine.rb:200:in `each'
/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.0.20/lib/rails/engine.rb:200:in `block in <class:Engine>'
/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.0.20/lib/rails/initializable.rb:25:in `instance_exec'
/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.0.20/lib/rails/initializable.rb:25:in `run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.0.20/lib/rails/initializable.rb:50:in `block in run_initializers'
/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.0.20/lib/rails/initializable.rb:49:in `each'
/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.0.20/lib/rails/initializable.rb:49:in `run_initializers'
/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.0.20/lib/rails/application.rb:134:in `initialize!'
/usr/share/foreman/vendor/ruby/1.9.1/gems/railties-3.0.20/lib/rails/application.rb:77:in `method_missing'
/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
[...]

I've added debugging to the "default" method and it dies with "modulepath is nil".

Returning nil instead of raising an exception let the db:migrate run through.


Related issues 3 (0 open3 closed)

Related to Foreman - Refactor #2660: Setting model, improve tests, string parsing and change to create!ClosedTomáš Strachota06/12/2013Actions
Related to Foreman - Bug #2686: foreman-config doesn't change boolean settingsClosedDominic Cleal06/20/2013Actions
Has duplicate Foreman - Bug #3472: "instance of IO needed" failure on new installDuplicate10/22/2013Actions
Actions

Also available in: Atom PDF