Issue #2786 has been updated by Markus Roberts.
This appears to have been introduced with commit:"8f60f0c50ee3dfb6453644f5dcded58e6e80e8bb" When handlebackup's - case File.stat(file).ftype - when "directory" - if self[:recurse] - # we don't need to backup directories when recurse is on - return true ...went away. This logic seems to have made it into the new perform_backup_with_bucket but not into perform_backup_with_backuplocal. ---------------------------------------- Bug #2786: Unable to purge a directory in recurse mode if puppet should backup http://projects.reductivelabs.com/issues/2786 Author: Peter Meier Status: Accepted Priority: Normal Assigned to: Markus Roberts Category: file Target version: 0.25.2 Affected version: 0.25.1 Keywords: Branch: After updating to 0.25 puppet isn't anymore able to purge directories in a directory as backing up seems to fail: <pre> debug: /File[/var/lib/puppet/modules/djbdns]: Changing ensure debug: /File[/var/lib/puppet/modules/djbdns]: 1 change(s) info: /File[/var/lib/puppet/modules/djbdns]: Recursively backing up to filebucket /usr/lib/ruby/site_ruby/1.8/puppet/util/errors.rb:51:in `fail' /usr/lib/ruby/site_ruby/1.8/puppet/type/file.rb:609:in `remove_existing' /usr/lib/ruby/site_ruby/1.8/puppet/type/file/ensure.rb:174:in `sync' /usr/lib/ruby/site_ruby/1.8/puppet/transaction/change.rb:54:in `go' /usr/lib/ruby/site_ruby/1.8/puppet/transaction/change.rb:72:in `forward' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:118:in `apply_changes' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:111:in `collect' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:111:in `apply_changes' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:83:in `apply' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:249:in `eval_children_and_apply_resource' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:417:in `thinmark' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:10:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:416:in `thinmark' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:248:in `eval_children_and_apply_resource' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:205:in `eval_resource' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:254:in `eval_children_and_apply_resource' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:253:in `each' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:253:in `eval_children_and_apply_resource' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:205:in `eval_resource' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:294:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:417:in `thinmark' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:10:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:416:in `thinmark' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:293:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:287:in `collect' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:287:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:142:in `apply' /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:152:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:177:in `benchmark' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:10:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:176:in `benchmark' /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:151:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/agent/locker.rb:21:in `lock' /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/ruby/1.8/sync.rb:229:in `synchronize' /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:130:in `with_client' /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:51:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/application/puppetd.rb:103:in `onetime' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in `send' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in `run_command' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `exit_on_fail' /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run' /usr/sbin/puppetd:159 err: /File[/var/lib/puppet/modules/djbdns]/ensure: change from directory to absent failed: Could not back up; will not replace </pre> the statement which should purge the directory is the following: http://git.puppet.immerda.ch/?p=module-common.git;a=blob;f=manifests/init.pp;h=b0a8ab2d574a940aecb832d4157558e59201b0d7;hb=dba965213d6214ef093930563feb982dba504a3f <pre> file { # Module programmers can use /var/lib/puppet/modules/$modulename to save # module-local data, e.g. for constructing config files "/var/lib/puppet/modules": ensure => directory, source => "puppet://$server/modules/common/modules/", ignore => '\.ignore', recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0; } </pre> The directory in question (@/var/lib/puppet/modules/djbdns@) is completely empty. This used to work on with 0.24.8. There is even a simple testcase to reproduce it: <pre> # cat foo.pp file{'/tmp/foo': source => '/tmp/bar', purge => true, recurse => true, force => true, } # mkdir bar # mkdir -p foo/test # touch foo/a # puppet foo.pp notice: /File[/tmp/foo/a]/ensure: removed err: /File[/tmp/foo/test]/ensure: change from directory to absent failed: Could not back up; will not replace </pre> If we set @backup => false@ everything works fine. <pre> # cat foo.pp file{'/tmp/foo': source => '/tmp/bar', purge => true, recurse => true, force => true, backup => false, } # puppet foo.pp notice: /File[/tmp/foo/test]/ensure: removed # puppet foo.pp # </pre> -- 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://reductivelabs.com/redmine/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
