Bug #2786
Unable to purge a directory in recurse mode if puppet should backup
| Status: | Closed | Start date: | 11/04/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | file | |||
| Target version: | 0.25.2 | |||
| Affected Puppet version: | 0.25.1 | Branch: | http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2786 | |
| Keywords: | ||||
| Votes: | 4 |
Description
After updating to 0.25 puppet isn’t anymore able to purge directories in a directory as backing up seems to fail:
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
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
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;
}
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:
# 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
If we set @backup => false@ everything works fine.
# 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
#
Related issues
History
Updated by Markus Roberts over 2 years ago
- Status changed from Unreviewed to Accepted
- Assignee set to Markus Roberts
Updated by Markus Roberts over 2 years ago
- Affected Puppet version changed from 0.25.1 to 0.25.2
Updated by Markus Roberts about 2 years ago
- Target version set to 0.25.2
- Affected Puppet version changed from 0.25.2 to 0.25.1
Updated by Markus Roberts about 2 years ago
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.
Updated by Markus Roberts about 2 years ago
- Assignee changed from Markus Roberts to Jesse Wolfe
Updated by Markus Roberts about 2 years ago
- Assignee changed from Jesse Wolfe to Markus Roberts
Updated by Markus Roberts about 2 years ago
- Status changed from Accepted to In Topic Branch Pending Review
- Branch set to http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2786
My diagnosis above was wrong; the commit was correctly identified but that actual problem was that the new code was failing to manage the return result and this was causing a false error report.
Updated by James Turnbull about 2 years ago
- Status changed from In Topic Branch Pending Review to Closed
Pushed in commit:cccbca4e540db85e49428cae2c78390bfcdbf4a0 in branch 0.25.x