Project

General

Profile

Actions

Bug #3472

closed

"instance of IO needed" failure on new install

Added by Dustin Mitchell over 10 years ago. Updated over 10 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Settings
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

On a new install, once everything else was set up:

[ pid=22752 thr=70076495972780 file=utils.rb:176 time=2013-10-22 13:02:26.512 ]: *** Exception TypeError in PhusionPassenger::Rack::ApplicationSpawner (instance of IO needed) (process 22752, thread #<Thread:0x7f77e94c9358>):
from /usr/lib/ruby/1.8/yaml.rb:133:in `load'
from /usr/lib/ruby/1.8/yaml.rb:133:in `unsafe_load'
from /usr/lib/ruby/site_ruby/1.8/puppet/vendor/safe_yaml/lib/safe_yaml.rb:144:in `load'
from /usr/share/foreman/app/models/setting.rb:75:in `default'
from /usr/share/foreman/app/models/setting.rb:63:in `value='
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/base.rb:1569:in `send'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/base.rb:1569:in `attributes='
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/base.rb:1565:in `each'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/base.rb:1565:in `attributes='
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/base.rb:1416:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/validations.rb:32:in `new'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/validations.rb:32:in `create!'
from /usr/share/foreman/lib/foreman/default_settings/loader.rb:21:in `create'
from /usr/share/foreman/lib/foreman/default_settings/loader.rb:44:in `load'
from /usr/share/foreman/lib/foreman/default_settings/loader.rb:36:in `each'
from /usr/share/foreman/lib/foreman/default_settings/loader.rb:36:in `load'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/transactions.rb:207:in `transaction'
from /usr/share/foreman/lib/foreman/default_settings/loader.rb:33:in `load'
from /usr/share/foreman/config/initializers/foreman.rb:4
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in `load'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in `load'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:227:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in `load'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/engine.rb:201
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/engine.rb:200:in `each'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/engine.rb:200
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/initializable.rb:25:in `instance_exec'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/initializable.rb:25:in `run'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/initializable.rb:50:in `run_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/initializable.rb:49:in `each'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/initializable.rb:49:in `run_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/application.rb:134:in `initialize!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/application.rb:77:in `send'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.20/lib/rails/application.rb:77:in `method_missing'
from /usr/share/foreman/config/environment.rb:5
from config.ru:3:in `require'
from config.ru:3
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.5/lib/rack/builder.rb:46:in `instance_eval'
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.5/lib/rack/builder.rb:46:in `initialize'
from config.ru:1:in `new'
from config.ru:1

This is foreman-1.1stable.3.el6.

I fixed this by adjusting the suspect method in foreman/app/models/setting.rb to only call YAML.load if the attribute is found:

def default
YAML.load(read_attribute(:default)) if read_attribute(:default)
end

This seemed to fix the problem.


Related issues 1 (0 open1 closed)

Is duplicate of Foreman - Bug #2343: app/models/setting.rb#default chokes on nil attributesClosedTomáš Strachota03/20/2013Actions
Actions #1

Updated by Dominic Cleal over 10 years ago

  • Is duplicate of Bug #2343: app/models/setting.rb#default chokes on nil attributes added
Actions #2

Updated by Dominic Cleal over 10 years ago

  • Category set to Settings
  • Status changed from New to Duplicate

Thanks for the report, but I think this is fixed via #2343 in Foreman 1.2.0.

Actions

Also available in: Atom PDF