[PUP-1544] Puppet Logging - `format_exception': undefined method `message' for #<Array:0x7f40783b5848> (NoMethodError) Created: 2014/01/30  Updated: 2016/11/28  Resolved: 2016/11/28

Status: Closed
Project: Puppet
Component/s: Types and Providers
Affects Version/s: PUP 3.5.0
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Gavin Williams Assignee: Kylo Ginsberg
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File lib_puppet_type_package_rb-2.diff     File lib_puppet_util_rb.diff    
Issue Links:
Relates
relates to PUP-1542 Puppet::Util::Log requires a message Closed
Template:
QA Contact: Narmadha Perumal

 Description   

When trying to test some tweaks to support PUP-958, an issue has been encountered whereby Puppet is throwing the following error:

sudo bundle exec puppet resource package bash ensure=held
/home/vagrant/puppet/lib/puppet/util/logging.rb:34:in `format_exception': undefined method `message' for #<Array:0x7f40783b5848> (NoMethodError)
        from /home/vagrant/puppet/lib/puppet/util/logging.rb:46:in `format_exception'
        from /home/vagrant/puppet/lib/puppet/util/logging.rb:27:in `log_exception'
        from /home/vagrant/puppet/lib/puppet/util.rb:491:in `exit_on_fail'
        from /home/vagrant/puppet/lib/puppet/application.rb:367:in `run'
        from /home/vagrant/puppet/lib/puppet/context.rb:51:in `override'
        from /home/vagrant/puppet/lib/puppet.rb:224:in `override'
        from /home/vagrant/puppet/lib/puppet/application.rb:357:in `run'
        from /home/vagrant/puppet/lib/puppet/util/command_line.rb:137:in `run'
        from /home/vagrant/puppet/lib/puppet/util/command_line.rb:91:in `execute'
        from /home/vagrant/puppet/bin/puppet:4
        from /usr/lib/ruby/gems/1.8/bin/puppet:19:in `load'
        from /usr/lib/ruby/gems/1.8/bin/puppet:19

This is with the attached lib_puppet_type_package_rb-2.diff patch applied.

If I then apply the attached lib_puppet_util_rb.diff patch, which enables some additional logging, I get the following exception:

puppet]$ sudo bundle exec puppet resource package bash ensure=held
#<Puppet::ResourceError: Parameter ensure failed on Package[bash]: Provider must have features 'holdable' to set 'ensure' to 'held' Provider must have features 'holdable' to set 'ensure' to 'held'>
/home/vagrant/puppet/lib/puppet/util/errors.rb:104:in `fail'
/home/vagrant/puppet/lib/puppet/parameter.rb:467:in `validate'
/home/vagrant/puppet/lib/puppet/property.rb:563:in `should='
/home/vagrant/puppet/lib/puppet/property.rb:563:in `each'
/home/vagrant/puppet/lib/puppet/property.rb:563:in `should='
/home/vagrant/puppet/lib/puppet/property.rb:615:in `value='
/home/vagrant/puppet/lib/puppet/type.rb:653:in `[]='
/home/vagrant/puppet/lib/puppet/type.rb:2242:in `set_parameters'
/home/vagrant/puppet/lib/puppet/type.rb:2236:in `each'
/home/vagrant/puppet/lib/puppet/type.rb:2236:in `set_parameters'
/home/vagrant/puppet/lib/puppet/type.rb:2192:in `initialize'
/home/vagrant/puppet/lib/puppet/resource.rb:307:in `new'
/home/vagrant/puppet/lib/puppet/resource.rb:307:in `to_ral'
/home/vagrant/puppet/lib/puppet/indirector/resource/ral.rb:37:in `save'
/home/vagrant/puppet/lib/puppet/indirector/indirection.rb:283:in `save'
/home/vagrant/puppet/lib/puppet/application/resource.rb:219:in `find_or_save_resources'
/home/vagrant/puppet/lib/puppet/application/resource.rb:143:in `main'
/home/vagrant/puppet/lib/puppet/application.rb:376:in `run_command'
/home/vagrant/puppet/lib/puppet/application.rb:367:in `run'
/home/vagrant/puppet/lib/puppet/application.rb:474:in `plugin_hook'
/home/vagrant/puppet/lib/puppet/application.rb:367:in `run'
/home/vagrant/puppet/lib/puppet/util.rb:479:in `exit_on_fail'
/home/vagrant/puppet/lib/puppet/application.rb:367:in `run'
/home/vagrant/puppet/lib/puppet/context.rb:51:in `override'
/home/vagrant/puppet/lib/puppet.rb:224:in `override'
/home/vagrant/puppet/lib/puppet/application.rb:357:in `run'
/home/vagrant/puppet/lib/puppet/util/command_line.rb:137:in `run'
/home/vagrant/puppet/lib/puppet/util/command_line.rb:91:in `execute'
/home/vagrant/puppet/bin/puppet:4
/usr/lib/ruby/gems/1.8/bin/puppet:19:in `load'
/usr/lib/ruby/gems/1.8/bin/puppet:19
/home/vagrant/puppet/lib/puppet/util/logging.rb:34:in `format_exception': undefined method `message' for #<Array:0x7f4effb0d650> (NoMethodError)
        from /home/vagrant/puppet/lib/puppet/util/logging.rb:46:in `format_exception'
        from /home/vagrant/puppet/lib/puppet/util/logging.rb:27:in `log_exception'
        from /home/vagrant/puppet/lib/puppet/util.rb:491:in `exit_on_fail'
        from /home/vagrant/puppet/lib/puppet/application.rb:367:in `run'
        from /home/vagrant/puppet/lib/puppet/context.rb:51:in `override'
        from /home/vagrant/puppet/lib/puppet.rb:224:in `override'
        from /home/vagrant/puppet/lib/puppet/application.rb:357:in `run'
        from /home/vagrant/puppet/lib/puppet/util/command_line.rb:137:in `run'
        from /home/vagrant/puppet/lib/puppet/util/command_line.rb:91:in `execute'
        from /home/vagrant/puppet/bin/puppet:4
        from /usr/lib/ruby/gems/1.8/bin/puppet:19:in `load'
        from /usr/lib/ruby/gems/1.8/bin/puppet:19

This would suggest that the ResourceError is being correctly thrown, but then a further error is causing the exception as seen above.

Having discussed this with Adrien Thebo, he's suggested this might be a cascading error of some description.

Let me know if you require further info.



 Comments   
Comment by Gavin Williams [ 2014/01/30 ]

Relevant patch files.

Comment by Gavin Williams [ 2014/01/30 ]

Issues are likely related.

Comment by Andrew Parker [ 2014/04/24 ]

Gavin Williams, can you please open a pull request with these changes. We only use pull requests to track code contributions.

Comment by Gavin Williams [ 2014/04/24 ]

Andrew Parker I didn't ever get it working tbh.

The patches attached were from my hacking around trying to get things working, and quickly got out of my depth...
Adrien Thebo did give me some assistance at various points, so might remember the issues...

Comment by Moses Mendoza [ 2016/11/28 ]

This ticket has not been updated in some time and is now being closed due to inactivity. This isn't necessarily a statement that this ticket isn't important - other issues may have demanded precedence since it was filed, or it may have simply slipped through the cracks. If any viewer/watcher feels closing this ticket is an error, please re-open it and add a comment explaining. Our apologies in advance for any mistake on this.

Generated at Sat Aug 08 09:01:36 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.