Duplicate cron entries?


#1

Hello,

I’m running chef-client 0.9.6 on a bunch of hosts and occasionally,
duplicate entries show up:

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Chef Name: delete_cores

30 1 * * * find /var/log/archives/core/* -type d -mtime +3 -exec rm -rf
{} ;

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Unfortunately, I’m chef-client on log_level :info…, so this is all I
see in the logs:
[Thu, 19 Aug 2010 23:45:21 -0700] INFO: Added cron ‘findcore’

There’s approx. 15 hosts running the same run_list and it pops up once a
day on a totally random host. I just upgraded to 0.9.6 from 0.8.16,
although I was seeing this in 0.8.16 also. Any ideas?

-Paul Choi


#2

I just deleted /var/spool/cron/root, then re-ran chef-client in debug.

[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[findcore] on
w17.plaxo.com[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[findcore]
using Chef::Provider::Cron[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron
empty for ‘root’
[Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron ‘findcore’
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[delete_cores]
on w17.plaxo.com
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[delete_cores] using
Chef::Provider::Cron
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron ‘delete_cores’ not
found[Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron ‘delete_cores’

Then you get:

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Chef Name: delete_cores

30 1 * * * find /var/log/archives/core/* -type d -mtime +3 -exec rm -rf
{} ;

which is correct.

I guess I’ll leave it in debug for a while…

-Paul

On 8/20/10 9:35 AM, Paul Choi wrote:

Hello,

I’m running chef-client 0.9.6 on a bunch of hosts and occasionally,
duplicate entries show up:

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Chef Name: delete_cores

30 1 * * * find /var/log/archives/core/* -type d -mtime +3 -exec rm
-rf {} ;

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Unfortunately, I’m chef-client on log_level :info…, so this is all I
see in the logs:
[Thu, 19 Aug 2010 23:45:21 -0700] INFO: Added cron ‘findcore’

There’s approx. 15 hosts running the same run_list and it pops up once
a day on a totally random host. I just upgraded to 0.9.6 from 0.8.16,
although I was seeing this in 0.8.16 also. Any ideas?

-Paul Choi


#3

I ran into this a little while back. the issue is (was?) the regular expression used for searching the cron list.

it would mistakenly try to re add existing crons. I’ll take a look later and see if it’s fixed now.

Sent from my iPhone

On Aug 20, 2010, at 1:11 PM, Paul Choi paulchoi@plaxo.com wrote:

I just deleted /var/spool/cron/root, then re-ran chef-client in debug.

[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[findcore] on w17.plaxo.com[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[findcore] using Chef::Provider::Cron[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron empty for ‘root’
[Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron ‘findcore’
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[delete_cores] on w17.plaxo.com
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[delete_cores] using Chef::Provider::Cron
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron ‘delete_cores’ not found[Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron ‘delete_cores’

Then you get:

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Chef Name: delete_cores

30 1 * * * find /var/log/archives/core/* -type d -mtime +3 -exec rm -rf {} ;

which is correct.

I guess I’ll leave it in debug for a while…

-Paul

On 8/20/10 9:35 AM, Paul Choi wrote:

Hello,

I’m running chef-client 0.9.6 on a bunch of hosts and occasionally, duplicate entries show up:

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Chef Name: delete_cores

30 1 * * * find /var/log/archives/core/* -type d -mtime +3 -exec rm -rf {} ;

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Unfortunately, I’m chef-client on log_level :info…, so this is all I see in the logs:
[Thu, 19 Aug 2010 23:45:21 -0700] INFO: Added cron ‘findcore’

There’s approx. 15 hosts running the same run_list and it pops up once a day on a totally random host. I just upgraded to 0.9.6 from 0.8.16, although I was seeing this in 0.8.16 also. Any ideas?

-Paul Choi


#4

The bug I had noticed has been fixed. I ran my tests on 0.9.8 and all is well :slight_smile:

On Fri, Aug 20, 2010 at 2:14 PM, Erik Kastner kastner@gmail.com wrote:

I ran into this a little while back. the issue is (was?) the regular expression used for searching the cron list.

it would mistakenly try to re add existing crons. I’ll take a look later and see if it’s fixed now.

Sent from my iPhone

On Aug 20, 2010, at 1:11 PM, Paul Choi paulchoi@plaxo.com wrote:

I just deleted /var/spool/cron/root, then re-ran chef-client in debug.

[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[findcore] on w17.plaxo.com[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[findcore] using Chef::Provider::Cron[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron empty for ‘root’
[Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron ‘findcore’
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Processing cron[delete_cores] on w17.plaxo.com
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: cron[delete_cores] using Chef::Provider::Cron
[Fri, 20 Aug 2010 10:08:24 -0700] DEBUG: Cron ‘delete_cores’ not found[Fri, 20 Aug 2010 10:08:24 -0700] INFO: Added cron ‘delete_cores’

Then you get:

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Chef Name: delete_cores

30 1 * * * find /var/log/archives/core/* -type d -mtime +3 -exec rm -rf {} ;

which is correct.

I guess I’ll leave it in debug for a while…

-Paul

On 8/20/10 9:35 AM, Paul Choi wrote:

Hello,

I’m running chef-client 0.9.6 on a bunch of hosts and occasionally, duplicate entries show up:

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Chef Name: delete_cores

30 1 * * * find /var/log/archives/core/* -type d -mtime +3 -exec rm -rf {} ;

Chef Name: findcore

0 */2 * * * /usr/local/bin/findcore.sh

Unfortunately, I’m chef-client on log_level :info…, so this is all I see in the logs:
[Thu, 19 Aug 2010 23:45:21 -0700] INFO: Added cron ‘findcore’

There’s approx. 15 hosts running the same run_list and it pops up once a day on a totally random host. I just upgraded to 0.9.6 from 0.8.16, although I was seeing this in 0.8.16 also. Any ideas?

-Paul Choi