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. Could you please 
see if using the 2.6.x series fixes this problem?

<pre>
[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
</pre>
----------------------------------------
Bug #7542: Cron has too many fields
https://projects.puppetlabs.com/issues/7542

Author: Robin Powell
Status: Investigating
Priority: Normal
Assignee: Ben Hughes
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


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:

<pre>
[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.
</pre>

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:

<pre>
  [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
</pre>

Which is equivalent to:

<pre>
# 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
</pre>

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,
    }



-- 
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://projects.puppetlabs.com/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.

Reply via email to