Bug #4344
Templates fails sometimes on 2.6
| Status: | Closed | Start date: | 07/23/2010 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | functions | |||
| Target version: | 2.6.1 | |||
| Affected Puppet version: | 2.6.0 | Branch: | http://github.com/nicklewis/puppet/tree/ticket/2.6.x/4344 | |
| Keywords: | ||||
| Votes: | 0 |
Description
This one is reproducible for us on one node and a bit vague but unfortunately rather important.
We have a really simple sudo module with one template.
On a second node where we are testing with the template we have the following issue: Everything works fine in the first puppet run (or when the file doesn’t exist) the second run we get the following error: err: Could not retrieve catalog from remote server: Could not intern from pson: Syntax error at ‘env_reset’ at /etc/sudoers warning: Not using cache on failed catalog err: Could not retrieve catalog; skipping run
I have attached files with debug logging from client and server, and since I still don’t know how to get code pasted properly i have also included the Puppet manifests.
Also the sudoers module is attached.
We call it like this:
$sudo_entries = [ 'noldap ALL=(ALL) ALL', 'seedpimp ALL=(ALL) ALL' ]
include sudoers
Related issues
History
Updated by James Turnbull over 1 year ago
- Category set to functions
- Status changed from Unreviewed to Investigating
- Assignee set to James Turnbull
- Target version set to 2.6.1
Updated by James Turnbull over 1 year ago
I cannot replicate this. Will dig more.
Updated by Markus Roberts over 1 year ago
This is…odd.
From the output it appears that it is trying to import /etc/sudoers as if it were puppet code.
Updated by Markus Roberts over 1 year ago
A thought: assuming the problem occurs with the simplified case in your tgz, does it still occur if you rename the template directory from etc to etc_foo and update the init.pp accordingly?
Updated by James Turnbull over 1 year ago
- Status changed from Investigating to Needs More Information
- Assignee deleted (
James Turnbull)
Updated by Jasper Poppe over 1 year ago
A thought: assuming the problem occurs with the simplified case in your tgz, does it still occur if you rename the template directory from etc to etc_foo and update the init.pp accordingly?
This indeed works! And ‘solves’ the issue, please tell me what more information you need.
Updated by Nick Lewis over 1 year ago
Jasper: could you please give us your configprint output for both master and agent? Also, do both nodes already have an /etc/sudoers file?
Updated by Jasper Poppe over 1 year ago
- File clientconfig added
- File configpuppetmaster added
- Target version deleted (
2.6.1)
Both hosts have indeed a sudoers file, if you throw it away Puppet works fine on both nodes, it goes wrong on the second, third… run on one of the nodes. I’ve attached the configurations. Please tell me if you need more.
Updated by Paul Berry over 1 year ago
- Status changed from Needs More Information to Accepted
It looks like what was happening was this: Puppet agent was looking in the local directory for a file with a name matching the name of an existing module (in this case “sudoers”). It was interpreting this file as a module definition, even if it did not have an extension. This shouldn’t be allowed.
Puppet agent shouldn’t be trying to read module files from the local machine at all. However, as a band aid fix, we’ve prevented puppet from trying to load module definitions from files that don’t have an extension. This should prevent it from mistaking the “/etc/sudoers” file as a module definition file.
More to come.
Updated by Nick Lewis over 1 year ago
- Status changed from Accepted to In Topic Branch Pending Review
- Branch set to http://github.com/nicklewis/puppet/tree/ticket/2.6.x/4344
Updated by Jasper Poppe over 1 year ago
This fixes the issue, glad you could find the cause for this one!, thanks..
Updated by Markus Roberts over 1 year ago
- Status changed from In Topic Branch Pending Review to Closed
commit:449315a2c705df2396852462a1d1e14774b9f117 [#4397]+[#4344] Move type-name resolution out of Puppet::Resource into the AST
commit:daa801b9ff8c81e6812a08a3f6ef82f593248e9d [#4344] Temporary fix to stop agent from importing modules
commit:00ebf01227745edc84084d10a9d8be7439551b0f [#4344] Fix for failing templates when module name matches file in local dir.
Updated by Rudy Gevaert over 1 year ago
I think I hit this error too. Running 2.6.0-2 (debian package). In which RC of 2.6.1 is this fixed?
Updated by James Turnbull over 1 year ago
2.6.1rc2
Updated by Rudy Gevaert over 1 year ago
upgrading to rc3 fixed my issue! thanks!
Updated by R.I. Pienaar over 1 year ago
- Status changed from Closed to Re-opened
This fix breaks/improves import so that it will now only import files named .pp or .rb where in the past it would happily have imported anything matching the supplied glob:
import "/etc/puppet/manifests/nodes/*"
This now only imports .pp and .rb not * as it’s asked to do.
Updated by James Turnbull over 1 year ago
- Target version set to 2.6.1
Updated by Markus Roberts over 1 year ago
- Status changed from Re-opened to Closed
This is a distinct issue, which I’ve opened as #4732.