Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 10.14.0
-
Fix Version/s: 10.14.0
-
Component/s: None
-
Labels:None
Description
If chef encounters a load error in an attribute file (you access a variable which does not exist for example like "default['something'] = doesnotexist"), chef cannot display the error but insteads throws another exception:
NoMethodError: undefined method `describe_error' for #<Chef::Formatters::NullFormatter:0x0000000212f140>
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/formatters/base.rb:176:in `file_load_failed'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/formatters/base.rb:226:in `recipe_file_load_failed'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/event_dispatch/dispatcher.rb:29:in `block in recipe_file_load_failed'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/event_dispatch/dispatcher.rb:29:in `each'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/event_dispatch/dispatcher.rb:29:in `recipe_file_load_failed'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/run_context.rb:82:in `rescue in block in load'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/run_context.rb:76:in `block in load'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/run_context.rb:75:in `each'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/run_context.rb:75:in `load'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/client.rb:228:in `setup_run_context'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/client.rb:185:in `run'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/application/client.rb:271:in `block in run_application'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/application/client.rb:258:in `loop'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/application/client.rb:258:in `run_application'
/var/lib/gems/1.9.1/gems/chef-10.13.0/lib/chef/application.rb:70:in `run'
/var/lib/gems/1.9.1/gems/chef-10.13.0/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:19:in `load'
/usr/bin/chef-client:19:in `<main>'
The reason for this is that describe_error does not exist
Issue Links
- is duplicated by
-
CHEF-3294
Output Formatters/Error Handlers obscures error messages in some cases.
-
FYI, I've fixed this bug and sent a pull request here: https://github.com/opscode/chef/pull/335