Jira (PUP-9569) Crontab prefetch fails when the filename is not a valid user

2 views
Skip to first unread message

Jarret Lavallee (JIRA)

unread,
Mar 21, 2019, 3:02:08 PM3/21/19
to puppe...@googlegroups.com
Jarret Lavallee updated an issue
 
Puppet / Bug PUP-9569
Crontab prefetch fails when the filename is not a valid user
Change By: Jarret Lavallee
Summary: Crontab error with prefetch fails when the filename begining with is not a hash valid user
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Jorie Tappa (JIRA)

unread,
Mar 25, 2019, 1:16:04 PM3/25/19
to puppe...@googlegroups.com

Jarret Lavallee (JIRA)

unread,
Mar 28, 2019, 7:42:02 PM3/28/19
to puppe...@googlegroups.com
Jarret Lavallee updated an issue
Change By: Jarret Lavallee
*Puppet Version:2018.1.2*
*Puppet Server Version:5.5.3*
*OS Name/Version:centos 7.5*

Describe your issue in as much detail as possible…
Describe steps to reproduce…

*Desired Behavior:* Puppet, throws a crontab error when examining the /var/spool/cron directory, as tries to list the crontab for users when that user is just a temp file starting with a hash.


Looks like this might be part of mcollective (as that's where in the debug log it mentions it).
Oddly, this error does not appear in the debug log, only in STDERR

To re-create the error, all you need to do is create a file starting with a hash in the
{{ /var/spool/cron/ }} folder. ( {{ touch '/var/spool/cron/#tmp.XXXXkhATKA' }} ) as is created by editing the crontab and having that process crash during edit.

*Actual Behavior:*

{code} [root@xxxxx tmp]# puppet agent -t 
Info: Using configured environment 'staging' 
Info: Retrieving pluginfacts 
Info: Retrieving plugin 
Info: Retrieving locales 
Info: Loading facts 
Info: Caching catalog for xxxxx.example.com
Info: Applying configuration version '200fcdecf443bdcf4232a9c6abafabc14bd819eb' 
crontab: option requires an argument – 'u' 
crontab: usage error: unrecognized option 
usage: crontab [-u user] file 
crontab [-u user] [ -e | -l | -r ] 
(default operation is replace, per 1003.2) 
-e (edit user's crontab) 
-l (list user's crontab) 
-r (delete user's crontab) 
-i (prompt before deleting user's crontab) 
-s (selinux context) 
Notice: Applied catalog in 6.50 seconds

[root@xxxxxx tmp]# ls -l /var/spool/cron/ 
total 4 
-rw-------. 1 username username 0 Dec 17 2014 username 
-rw-------. 1 root root 1182 Mar 12 16:24 root 
-rw-------. 1 root root 0 Mar 15 2019 #tmp.XXXXkhATKA

[root@xxxxxx tmp]# rm /var/spool/cron/#tmp.XXXXkhATKA 
rm: remove regular empty file `/var/spool/cron/#tmp.XXXXkhATKA'? y

[root@xxxxxx tmp]# puppet agent -t 
Info: Using configured environment 'staging' 
Info: Retrieving pluginfacts 
Info: Retrieving plugin 
Info: Retrieving locales 
Info: Loading facts 
Info: Caching catalog for xxxxxx.example.com 
Info: Applying configuration version '200fcdecf443bdcf4232a9c6abafabc14bd819eb' 
Notice: Applied catalog in 5.20 seconds

{code}

Adam Bottchen (JIRA)

unread,
Mar 28, 2019, 7:52:03 PM3/28/19
to puppe...@googlegroups.com
Adam Bottchen updated an issue
Change By: Adam Bottchen
CS Priority: Needs Priority Reviewed

Branan Riley (JIRA)

unread,
Mar 29, 2019, 9:11:04 AM3/29/19
to puppe...@googlegroups.com
Branan Riley updated an issue
Change By: Branan Riley
Labels: cron linux type_and_provider

Branan Riley (JIRA)

unread,
Mar 29, 2019, 9:12:05 AM3/29/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Apr 3, 2019, 6:22:02 AM4/3/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Apr 3, 2019, 6:22:03 AM4/3/19
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR - Triage 2019-04-17

Gheorghe Popescu (JIRA)

unread,
Apr 16, 2019, 3:32:05 AM4/16/19
to puppe...@googlegroups.com

Gheorghe Popescu (JIRA)

unread,
Apr 16, 2019, 8:34:04 AM4/16/19
to puppe...@googlegroups.com
Gheorghe Popescu commented on Bug PUP-9569
 
Re: Crontab prefetch fails when the filename is not a valid user

Jarret Lavallee seems that this issue was solved in newer puppet versions. Tested on 5.5.9

[root@host ~]# puppet --version
5.5.9
[root@host ~]# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for host.delivery.puppetlabs.net
Info: Applying configuration version '1555417727'
Notice: /Stage[main]/Main/Node[default]/Cron[logrotate]/ensure: created
Error: /Stage[main]/Main/Node[default]/Cron[logrotate]: Could not evaluate: Cannot write the #tmp.XXXXkhATKA user's crontab: The user does not exist
Notice: Applied catalog in 0.12 seconds

 

 

Gheorghe Popescu (JIRA)

unread,
Apr 16, 2019, 8:36:03 AM4/16/19
to puppe...@googlegroups.com

This issue is not reproducible after the changes made to crontab provider in 5.5.9. Upgrading puppet to a newer version should fix it.

Austin Boyd (JIRA)

unread,
Dec 12, 2019, 9:06:23 AM12/12/19
to puppe...@googlegroups.com
Austin Boyd updated an issue
 
Change By: Austin Boyd
Zendesk Ticket IDs: 34212
Zendesk Ticket Count: 1
Reply all
Reply to author
Forward
0 new messages