Issue #14764 has been updated by Charlie Sharpsteen. Status changed from Accepted to Investigating Affected Puppet version changed from 2.7.14 to 3.1.1
Confirmed that this is still present in 3.1.1. The issue appears to be triggered by a change in state from present to absent or vice versa. In this case, we have the following situation entering the [`create_change_event` method in `resource_harness.rb`](https://github.com/puppetlabs/puppet/blob/3.1.1/lib/puppet/transaction/resource_harness.rb#L84-L99): <pre> historical_value = :absent current_value = "644" </pre> The [`is_to_s` method for file modes](https://github.com/puppetlabs/puppet/blob/3.1.1/lib/puppet/type/file/mode.rb#L146-L148) does the following: <pre> def is_to_s(currentvalue) currentvalue.rjust(4, "0") end </pre> That works great for actual file modes like "644" as it transforms them to "0644". But when `current_value` or `historical_value` is a symbol like `:absent`, then the method falls over. ---------------------------------------- Bug #14764: Auditing logs error "undefined method `rjust' for :absent:Symbol" https://projects.puppetlabs.com/issues/14764#change-87529 * Author: R.I. Pienaar * Status: Investigating * Priority: Normal * Assignee: Charlie Sharpsteen * Category: * Target version: * Affected Puppet version: 3.1.1 * Keywords: * Branch: ---------------------------------------- Given: <pre> file{"/tmp/foo": audit => "all"} </pre> If I first run it with the file missing I get: <pre> $ puppet apply test.pp notice: /Stage[main]//File[/tmp/foo]/ensure: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/content: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/target: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/owner: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/group: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/mode: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/type: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/seluser: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/selrole: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/seltype: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/selrange: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/ctime: audit change: newly-recorded value absent notice: /Stage[main]//File[/tmp/foo]/mtime: audit change: newly-recorded value absent notice: Finished catalog run in 0.03 seconds </pre> If I then create the file and run again: <pre> $ touch /tmp/foo $ puppet apply test.pp notice: /Stage[main]//File[/tmp/foo]/ensure: audit change: previously recorded value absent has been changed to file notice: /Stage[main]//File[/tmp/foo]/content: audit change: previously recorded value absent has been changed to {md5}d41d8cd98f00b204e9800998ecf8427e notice: /Stage[main]//File[/tmp/foo]/target: audit change: previously recorded value absent has been changed to notlink notice: /Stage[main]//File[/tmp/foo]/owner: audit change: previously recorded value absent has been changed to rip notice: /Stage[main]//File[/tmp/foo]/group: audit change: previously recorded value absent has been changed to rip err: /Stage[main]//File[/tmp/foo]: Could not evaluate: undefined method `rjust' for :absent:Symbol notice: Finished catalog run in 0.03 seconds </pre> If I run this with --trace <pre> /usr/lib/ruby/site_ruby/1.8/puppet/type/file/mode.rb:145:in `is_to_s' /usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:94:in `create_change_event' /usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:72:in `perform_changes' /usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:69:in `each' /usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:69:in `perform_changes' /usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:133:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:49:in `apply' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:84:in `eval_resource' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:104:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:484:in `thinmark' /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:483:in `thinmark' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:104:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:386:in `traverse' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:99:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:141:in `apply' /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:122:in `retrieve_and_apply_catalog' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:159:in `benchmark' /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:158:in `benchmark' /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:121:in `retrieve_and_apply_catalog' /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:152:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:239:in `main' /usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:153:in `run_command' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:416:in `hook' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:407:in `exit_on_fail' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:69:in `execute' /usr/bin/puppet:4 err: /Stage[main]//File[/tmp/foo]: Could not evaluate: undefined method `rjust' for :absent:Symbol </pre> This is with apply - not tested against a master. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
