Bug #7542
Cron has too many fields
| Status: | Closed | Start date: | 05/16/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | - | |||
| Target version: | - | |||
| Affected Puppet version: | Branch: | |||
| Keywords: | ||||
| Votes: | 0 |
Description
On some of my CentOS 5.5 machines, but not others, puppet is trying to install cron entries with too many fields. This means puppet cannot succeed on these hosts. I would be very happy to help debug this, but I really don’t know what information to give. The only way I even figured out the problem was strace.
Some details:
[root@beta01 /]# sudo puppetd -tv info: Caching catalog for beta01.c44031.blueboxgrid.com info: /Stage[main]/Ruby/Tidy[/etc/profile.d/rvm.sh]: File does not exist info: Applying configuration version '1305353595' notice: /Stage[main]/Puppet/Cron[puppet run cron]/ensure: created "-":6: bad hour errors in crontab file, can't install.
Which is odd. They’re both running centos packages for puppet 0.25.5-1.el5
I couldn’t figure it out, so I ran strace, and found this:
[pid 1872] write(3, "# HEADER: This file was autogenerated at Fri May 13 22:50:02 -0700 2011 by puppet.\n# HEADER: While it can +still be managed manually, it is definitely not recommended.\n# HEADER: Note particularly that the comments starting with 'Puppet +Name' should\n# HEADER: not be deleted, as doing so could cause duplicate cron jobs.\n# Puppet Name: puppet run cron\n* 1 1 * * * +foo\n", 366) = 366
Which is equivalent to:
# HEADER: This file was autogenerated at Fri May 13 22:50:02 -0700 2011 by puppet. # HEADER: While it can still be managed manually, it is definitely not recommended. # HEADER: Note particularly that the comments starting with 'Puppet Name' should # HEADER: not be deleted, as doing so could cause duplicate cron jobs. # Puppet Name: puppet run cron * 1 1 * * * foo
That’s one too many fields.
Not that it should matter, but the cron was very simple by that time:
cron { 'puppet run cron':
command => "foo",
user => root,
hour => 1,
minute => 1,
}
History
Updated by Ben Hughes about 1 year ago
- Status changed from Unreviewed to Investigating
- Assignee set to Ben Hughes
- Affected Puppet version deleted (
2.6.4)
I’ve been completely unable to reproduce this here I’m afraid. Could you please see if using the 2.6.x series fixes this problem?
[vagrant@vagrant-centos-64:~]% cat cron.pp
cron { 'puppet run cron':
command => "foo",
user => root,
hour => 1,
minute => 1,
}
[vagrant@vagrant-centos-64:~]% puppet --version
2.6.8
[vagrant@vagrant-centos-64:~]% sudo puppet apply --verbose --debug cron.pp
debug: Failed to load library 'selinux' for feature 'selinux'
debug: Creating default schedules
debug: Puppet::Type::User::ProviderLdap: true value when expecting false
debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist
debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not exist
debug: Puppet::Type::User::ProviderPw: file pw does not exist
debug: Puppet::Type::File::ProviderMicrosoft_windows: feature microsoft_windows is missing
debug: Failed to load library 'ldap' for feature 'ldap'
debug: /File[/etc/puppet/ssl/public_keys]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/lib/puppet/clientbucket]: Autorequiring File[/var/lib/puppet]
debug: /File[/etc/puppet/ssl]: Autorequiring File[/etc/puppet]
debug: /File[/var/lib/puppet/log]: Autorequiring File[/var/lib/puppet]
debug: /File[/etc/puppet/ssl/certificate_requests]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/state/graphs]: Autorequiring File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/client_yaml]: Autorequiring File[/var/lib/puppet]
debug: /File[/etc/puppet/ssl/private_keys]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/client_data]: Autorequiring File[/var/lib/puppet]
debug: /File[/etc/puppet/ssl/certs]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/lib/puppet/run]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
debug: /File[/etc/puppet/ssl/private]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]
debug: Finishing transaction 23494624282720
debug: Loaded state in 0.00 seconds
debug: Loaded state in 0.00 seconds
debug: Prefetching crontab resources for cron
info: Applying configuration version '1305831757'
debug: Finishing transaction 23494623927860
debug: Storing state
debug: Stored state in 0.01 seconds
notice: Finished catalog run in 0.07 seconds
[vagrant@vagrant-centos-64:~]% sudo crontab -l -u root
# HEADER: This file was autogenerated at Thu May 19 18:45:51 +0100 2011 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: puppet run cron
1 1 * * * foo
Updated by Robin Powell about 1 year ago
On Thu, May 19, 2011 at 12:03:35PM -0700, tickets@puppetlabs.com wrote:
Issue #7542 has been updated by Ben Hughes.
Status changed from Unreviewed to Investigating Assignee set to Ben Hughes Affected Puppet version deleted (2.6.4)
I’ve been completely unable to reproduce this here I’m afraid.
I’m totally unsurprised; a random selection of my machines has it, and they all have the same version of puppet; I strongly suspect some ancillary library or system configuration issue.
Could you please see if using the 2.6.x series fixes this problem?
2.6.8 on the client does seem to fix it right up, yep. Sorry I didn’t try that myself; that was dumb. :(
-Robin
Updated by Ben Hughes about 1 year ago
- Status changed from Investigating to Closed
Nah that’s cool. I just didn’t want to reply back with “old version: upgrade” as that seemed impudent.
Closing as it’s fixed in 2.6. Thanks.