Bug #2253
puppetd pluginsync clears out your $plugindest if the $pluginsource mount is faulty
| Status: | Closed | Start date: | 05/13/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | file | |||
| Target version: | 0.25.0 | |||
| Affected Puppet version: | 0.25.0 | Branch: | ||
| Keywords: | ||||
| Votes: | 0 |
Description
Regarding the mail message of http://groups.google.com/group/puppet-users/browse_thread/thread/fbdc312effcbf44b
So the undefined behaviour you’re talking about. I can reliably invoke said undefined behaviour, and it is undefined differently to 0.24.4… I think. Or it could be the same and just tickled by the pluginsync issue.
Let me explain in plain English…
I’m using /var/lib/puppet/plugins for everything – $pluginpath, $plugindest, $libdir. That way when I use our internal Makefile system to make install onto a Puppetmaster it’s in the right place, it’s exported via the fileserver, and when the client does a pluginsync it goes to the same place. All our config files are as similar as possible.
I’m provoking the cleanout issue by doing a puppetd —pluginsync on the Puppet Master host. With 0.23 and 0.24 I’ve seen no issue. With 0.25.0 beta I see it recursively empties $plugindest because $pluginsource is delivering nothing:
<0> sa_dewha@engpsr0170.etf.barcapetf.com (0 jobs) /var/lib/puppet/plugins % find . ./puppet ./puppet/type ./puppet/type/etcshadow.rb ... <0> sa_dewha@engpsr0170.etf.barcapetf.com (0 jobs) /var/lib/puppet/plugins % sudo puppetd --noop --no-factsync --pluginsync -t --tags skdjfhskjdfhs --debug ... err: /File[/var/lib/puppet/plugins]: Failed to retrieve current state of resource: Could not retrieve information from source(s) puppet:///plugins debug: /File[/var/lib/puppet/plugins/puppet]: Changing ensure debug: /File[/var/lib/puppet/plugins/puppet]: 1 change(s) debug: /File[/var/lib/puppet/plugins/puppet]: Removing existing directory for replacement with absent notice: /File[/var/lib/puppet/plugins/puppet]/ensure: removed debug: Finishing transaction 23627061668120 with 1 changes info: Loading downloaded plugin /var/lib/puppet/plugins/puppet err: Could not load downloaded file /var/lib/puppet/plugins/puppet: no such file to load -- /var/lib/puppet/plugins/puppet ... notice: Caught INT; calling stop <0> sa_dewha@engpsr0170.etf.barcapetf.com (0 jobs) /var/lib/puppet/plugins . <0> sa_dewha@engpsr0170.etf.barcapetf.com (0 jobs) /var/lib/puppet/plugins
I would expect the pluginsync (and indeed a factsync) to be abandoned if the source is bad.
With 0.23 it doesn’t do the cleanout…
<0> sa_dewha@engpsr0150.etf.barcapetf.com (0 jobs) /var/lib/puppet/plugins % sudo puppetd -t --noop --no-factsync --pluginsync --tags ksjdhfskjdhf --pluginsource puppet://engpsr0150.etf.barcapet f.com/busted warning: Discarded unknown configuration parameter certdnsnames info: Loading fact installed_kernels info: Loading fact rawkernel info: Loading fact blastwave info: Loading fact ipfacts info: Loading fact virtual info: Loading fact build_details info: Loading fact veritas info: Loading fact hwfacts info: Loading fact roothome info: Loading fact hba info: Loading fact ethernet info: Loading fact mounts info: Loading fact lomfacts info: Loading fact satellite info: Loading fact swap notice: Ignoring cache info: Retrieving plugins err: /plugin_collector/File[/var/lib/puppet/plugins]: Failed to generate additional resources during transaction: Fileser ver module 'busted' not mounted err: /plugin_collector/File[/var/lib/puppet/plugins]/source: Could not describe /busted: Fileserver module 'busted' not m ounted info: /plugin_collector/File[/var/lib/puppet/plugins]/source: No specified sources exist info: Caching configuration at /var/lib/puppet/localconfig.yaml notice: Starting configuration run notice: Caught INT; shutting down notice: Shutting down <0> sa_dewha@engpsr0150.etf.barcapetf.com (0 jobs) /var/lib/puppet/plugins % find |head . ./puppet ./puppet/provider ./puppet/provider/sshd_config ./puppet/provider/sshd_config/parsed.rb ./puppet/provider/authorizedkey ./puppet/provider/authorizedkey/parsed.rb ./puppet/provider/cronallow ./puppet/provider/cronallow/parsed.rb ./puppet/provider/ndd
Best regards, Derek
History
Updated by Luke Kanies about 3 years ago
- Category set to file
- Status changed from Unreviewed to Accepted
- Assignee set to Luke Kanies
- Target version set to 0.25.0
Updated by Luke Kanies about 3 years ago
The deal here is that previously we hit the server for every single directory, and if the directory didn’t exist on the server, that directory resource failed. This ensured that we didn’t recursively delete in cases where the server didn’t exist.
Here, we’re getting no info back from the server, which the client is taking to mean an empty directory, so it’s marking everything to get purged. Only later do the failures happen, at which point the resources have already been marked for purging.
The solution here is either to have a fileset-level failure mode, where everything in the fileset fails if there’s no server-side info, or make sure dependencies are set up correctly so that if the top-level directory fails for lack of information, the lower directories get skipped rather than purged.
Updated by Luke Kanies almost 3 years ago
- Status changed from Accepted to Ready For Checkin
- Assignee changed from Luke Kanies to James Turnbull
Fixed in the tickets/master/plugins branch in my repo.
Updated by James Turnbull almost 3 years ago
- Status changed from Ready For Checkin to Closed
Pushed in branch master.