Jira (PUP-10376) Custom file ownership for lastrunreport as defined in puppet.conf is ignored

0 views
Skip to first unread message

Ferenc Erki (Jira)

unread,
Mar 19, 2020, 11:30:03 AM3/19/20
to puppe...@googlegroups.com
Ferenc Erki created an issue
 
Puppet / Bug PUP-10376
Custom file ownership for lastrunreport as defined in puppet.conf is ignored
Issue Type: Bug Bug
Affects Versions: PUP 6.13.0, PUP 6.14.0
Assignee: Unassigned
Created: 2020/03/19 8:29 AM
Priority: Normal Normal
Reporter: Ferenc Erki

Puppet Version: 6.14.0
Puppet Server Version: 6.9.1
OS Name/Version: Ubuntu 18.04.4 LTS (Bionic Beaver)

Somewhat similarly to PUP-10325, the custom ownership settings for the `lastrunreport` file in `puppet.conf` also doesn't seem to be preserved once the agent run is finished. Interestingly enough, during the run it seems to be correctly set.

Desired Behavior:

**After the run is finished, the `lastrunreport` file should have the ownership and permissions set as specified in `puppet.conf`.

Actual Behavior:

 

During the run the ownership/permissions seems to be correctly set, but once finished, the ownership of the `lastrunreport` file is set to `root:root` and permissions to `0660`.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 19, 2020, 1:31:05 PM3/19/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10376
 
Re: Custom file ownership for lastrunreport as defined in puppet.conf is ignored

Ferenc Erki this is a duplicate of PUP-10325, right? Or are you saying this is a variation of that issue? If so, can you provide the puppet.conf you're using and the before and after permissions for the file?

Josh Cooper (Jira)

unread,
Mar 19, 2020, 3:20:04 PM3/19/20
to puppe...@googlegroups.com

Ferenc Erki (Jira)

unread,
Mar 23, 2020, 4:51:03 AM3/23/20
to puppe...@googlegroups.com
Ferenc Erki commented on Bug PUP-10376
 
Re: Custom file ownership for lastrunreport as defined in puppet.conf is ignored

It's very similar, but I don't think it's a duplicate. PUP-10325 is about the lastrunfile's mode setting, and this is about the file's ownership.

Configuration in /etc/puppetlabs/puppet/puppet.conf:

[agent]
lastrunreport = /opt/puppetlabs/puppet/cache/state/last_run_report.yaml { owner = root, group = service, mode = 0640 }

The lastrunreport file's ownership and mode info looks like this during the agent run (that is the correct expected result):

$ ls -l /opt/puppetlabs/puppet/cache/state/last_run_report.yaml
-rw-r----- 1 root puppet 942435 Mar 23 08:22 /opt/puppetlabs/puppet/cache/state/last_run_report.yaml

And as soon as the puppet agent finishes, it is changed to these incorrect (default?) values:

$ ls -l /opt/puppetlabs/puppet/cache/state/last_run_report.yaml
-rw-rw---- 1 root root 942435 Mar 23 08:22 /opt/puppetlabs/puppet/cache/state/last_run_report.yaml

Mihai Buzgau (Jira)

unread,
Mar 24, 2020, 7:42:03 AM3/24/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Mar 24, 2020, 7:43:03 AM3/24/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Mar 24, 2020, 7:44:03 AM3/24/20
to puppe...@googlegroups.com

Gheorghe Popescu (Jira)

unread,
Mar 24, 2020, 8:33:03 AM3/24/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 1, 2020, 3:51:03 AM4/1/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 2, 2020, 7:23:05 PM4/2/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10376
 
Re: Custom file ownership for lastrunreport as defined in puppet.conf is ignored

This is failing CI because we register a task to run cmd.exe /c puppet agent -t as LocalSystem. On 2008r2 the task scheduler cannot find puppet in its PATH. This is only an issue now, because the test had been skipped until this change.

I'm not sure why/how the test is passing on 2019. I am guessing that when the puppet MSI is installed, it modifies the system PATH in a way that the schedule service sees the change, but 2008r2 does not.

I think the beaker test used to pass on 2008r2 because C:\Program Files\Puppet Labs\puppet\bin was in the VM's system PATH, but they were last due to the way we use puppet to provision them during imaging.

I'm thinking the best thing is to explicitly specify the full path for the scheduled task, something like:

cmd /c "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" /c agent -t

Or setting the current working directory for the task to C:\Program Files\Puppet Labs\Puppet\bin.

To reproduce, run

$ bundle exec rake ci:test:aio SERVER_VERSION=6.9.2 SHA=525b88bc94cd2154a863c9d80e46981035f39d60 TESTS=tests/windows/PUP-9719_windows_system_first_pa_run.rb TEST_TARGET=windows2008r2-64a OPTIONS='--preserve-hosts=always

John O'Connor (Jira)

unread,
Apr 3, 2020, 6:55:03 AM4/3/20
to puppe...@googlegroups.com

Hi Josh Cooper

Shouldn't have been any changes to PATH on the most recent refresh (which was last January to address the recent CVE).
I'm probably overdue a refresh - unlikely to do it in April, but may well do one in May to catch the impending Windows 10 (2004) build (for win-10-next).

This is a very interesting point - I don't check the PATH - actually - should ensure that references to Puppet are removed from it.
Worth ticketing for next refresh - I'm assuming yes to this - have created IMAGES-1189

We do need to sunset all the Windows 2008r2/2008/7 vmpooler pools and associated tests.

Josh Cooper (Jira)

unread,
Apr 3, 2020, 12:05:02 PM4/3/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10376

Passed CI in 0b9e2690e31c50f96703eac023a594692f5234d8

Josh Cooper (Jira)

unread,
Apr 3, 2020, 12:05:04 PM4/3/20
to puppe...@googlegroups.com

Claire Cadman (Jira)

unread,
Apr 27, 2020, 6:55:03 AM4/27/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages