Jira (PUP-11712) Resource type TIDY is not honouring the parameter value from age

12 views
Skip to first unread message

Selvakumar Azhagarsami (Jira)

unread,
Jan 12, 2023, 4:29:03 AM1/12/23
to puppe...@googlegroups.com
Selvakumar Azhagarsami created an issue
 
Puppet / Bug PUP-11712
Resource type TIDY is not honouring the parameter value from age
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2023/01/12 1:28 AM
Priority: Normal Normal
Reporter: Selvakumar Azhagarsami

Puppet Version:  6.26.0

{}Puppet Server Version:  2019.8.10

{}OS Name/Version: RHEL 7

The documentation for the age parameter for the tidy type states:

Tidy files whose age is equal to or greater than the specified time. You can choose seconds, minutes, hours, days, or weeks by specifying the first letter of any of those words (for example, ‘1w’ represents one week).

Docs: https://puppet.com/docs/puppet/7.7/types/tidy.html#tidy-attribute-age

Specifying 0 will remove all files.

Desired Behavior:
 
Setting age=1w removes all files more than 1 week old
Actual Behavior:
 
It's not removing any files, details of the testing below
 

[root@pepm reports]# pwd
/tmp/comply/assessors/4.19.0/Assessor-CLI/reports
 
[root@pepm reports]# ls -lrt
total 3904
-rw-r--r-- 1 root root 995383 Dec  1 07:23 agentdebugoutput.txt
-rw-r--r-- 1 root root 995383 Dec  1 07:23 agentdebugoutput4.txt
-rw-r--r-- 1 root root 995383 Dec  1 07:23 agentdebugoutput3.txt
-rw-r--r-- 1 root root 995383 Dec  1 07:23 agentdebugoutput2.txt  

 

[root@pepm reports]# cat ~/code/newtidy.pp
class basic_tidy {
        tidy { 'delete-assessors':
          path    => '/tmp/comply/assessors',
          age     => '0',
          recurse => true,
          matches => [ 'agentdebugoutput*.txt' ],
        }
}include basic_tidy 

 

[root@pepm reports]# puppet apply ~/code/newtidy.pp
Notice: Compiled catalog for pepm.puppetdebug.vlan in environment production in 0.14 seconds
Notice: Applied catalog in 0.30 seconds 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Charmaine Pritchett (Jira)

unread,
Jan 16, 2023, 11:26:02 PM1/16/23
to puppe...@googlegroups.com
Charmaine Pritchett updated an issue
Change By: Charmaine Pritchett
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 50471

Charmaine Pritchett (Jira)

unread,
Jan 16, 2023, 11:26:03 PM1/16/23
to puppe...@googlegroups.com

Selvakumar Azhagarsami (Jira)

unread,
Jan 16, 2023, 11:27:03 PM1/16/23
to puppe...@googlegroups.com

Selvakumar Azhagarsami (Jira)

unread,
Jan 25, 2023, 5:21:02 AM1/25/23
to puppe...@googlegroups.com
Selvakumar Azhagarsami updated an issue
*Puppet Version:*  6.26.0

{*}{
{ *} } {*}Puppet Server Version:{*}  2019.8.10

{*}{
{ *} } {*}OS Name/Version:{*} RHEL 7


The documentation for the {{age}} parameter for the {{tidy}} type states:
{quote}Tidy files whose age is *equal to or greater* than the specified time. You can choose seconds, minutes, hours, days, or weeks by specifying the first letter of any of those words (for example, ‘1w’ represents one week).

Docs: [https://puppet.com/docs/puppet/7.7/types/tidy.html#tidy-attribute-age]

{*}Specifying 0 will remove all files{*}.
{quote}
*Desired Behavior:*
 
Setting *age=1w* removes all files more than 1 week old
*Actual Behavior:*

 
It's not removing any files, details of the testing below
 
{code:java}
[root@pepm reports]# pwd
/tmp/comply/assessors/4.19.0/Assessor-CLI/reports

[root@pepm reports]# ls -lrt
total 3904
-rw-r--r-- 1 root root 995383 Dec  1 07:23 agentdebugoutput.txt
-rw-r--r-- 1 root root 995383 Dec  1 07:23 agentdebugoutput4.txt
-rw-r--r-- 1 root root 995383 Dec  1 07:23 agentdebugoutput3.txt
-rw-r--r-- 1 root root 995383 Dec  1 07:23 agentdebugoutput2.txt  {code}
 
{code:java}

[root@pepm reports]# cat ~/code/newtidy.pp
class basic_tidy {
        tidy { 'delete-assessors':
          path    => '/tmp/comply/assessors',
          age     => ' 0 1w ',

          recurse => true,
          matches => [ 'agentdebugoutput*.txt' ],
        }
}include basic_tidy {code}
 
{code:java}

[root@pepm reports]# puppet apply ~/code/newtidy.pp
Notice: Compiled catalog for pepm.puppetdebug.vlan in environment production in 0.14 seconds
Notice: Applied catalog in 0.30 seconds {code}

Michael Hashizume (Jira)

unread,
Feb 7, 2023, 4:35:02 PM2/7/23
to puppe...@googlegroups.com
Michael Hashizume updated an issue
Change By: Michael Hashizume
Labels: jira_escalated needs-validation

Josh Cooper (Jira)

unread,
Feb 22, 2023, 5:29:02 PM2/22/23
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11712
 
Re: Resource type TIDY is not honouring the parameter value from age

By default the "age" parameter will compare the "atime" (last accessed time) of the file. You probably want to use "type => mtime" to remove files that haven't been modified in more than 1 week.

If some other process reads the agentdebug*txt files, then the atime will be updated and the files may never be tidied.

We were able to reproduce the problem where files aren't being tidied and adding the "type => mtime" parameter resolved the issue, so I'm going to close this. Please reopen if we're missing something along with steps to reproduce. 

Michael Hashizume (Jira)

unread,
Apr 25, 2023, 4:26:03 PM4/25/23
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages