Jira (PUP-3907) Noop changes to file ownership fail if required User or Group does not exist

12 views
Skip to first unread message

Charlie Sharpsteen (JIRA)

unread,
Jan 23, 2015, 3:11:55 PM1/23/15
to puppe...@googlegroups.com
Charlie Sharpsteen created an issue
 
Puppet / Bug PUP-3907
Noop changes to file ownership fail if required User or Group does not exist
Issue Type: Bug Bug
Affects Versions: PUP 3.7.3
Assignee: Kylo Ginsberg
Components: Catalog Application
Created: 2015/01/23 12:11 PM
Priority: Normal Normal
Reporter: Charlie Sharpsteen

If a noop run contains File resources, and those resources have pending changes for User or Group ownership, the run will show failures if those User or Group resources don't exist yet.

Reproduction Case

  • Create the following manifest:

# noop_test.pp
file {'/tmp/usertest':
  ensure => present,
  owner => testuser,
}
 
file {'/tmp/grouptest':
  ensure => present,
  group => testgroup,
}
 
user{'testuser':
  ensure => present,
}
 
group{'testgroup':
  ensure => present,
}

Create the test file:

touch /tmp/usertest
touch /tmp/grouptest

Outcome

A noop application produces errors:

# puppet apply --noop noop_test.pp
 
Notice: Compiled catalog for poss-head-master.puppetdebug.vlan in environment production in 1.87 seconds
Notice: /Stage[main]/Main/User[testuser]/ensure: current_value absent, should be present (noop)
Error: Could not find user testuser
Error: /Stage[main]/Main/File[/tmp/usertest]/owner: change from root to testuser failed: Could not find user testuser
Notice: /Stage[main]/Main/Group[testgroup]/ensure: current_value absent, should be present (noop)
Error: Could not find group testgroup
Error: /Stage[main]/Main/File[/tmp/grouptest]/group: change from root to testgroup failed: Could not find group testgroup
Notice: Applied catalog in 0.08 seconds

Expected Outcome

The noop run notes that the values would be changed but doesn't produce an error. The error should only happen if Users or Groups are missing when Puppet enforces the change.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a)
Atlassian logo

Charlie Sharpsteen (JIRA)

unread,
Jan 23, 2015, 3:15:53 PM1/23/15
to puppe...@googlegroups.com
Charlie Sharpsteen updated an issue
 
Noop changes to file ownership generate failures if required User or Group does not exist
Change By: Charlie Sharpsteen
Summary: Noop changes to file ownership  fail  generate failures  if required User or Group does not exist

Maggie Dreyer (JIRA)

unread,
May 15, 2017, 6:35:03 PM5/15/17
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
Labels: noop
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Sean McDonald (JIRA)

unread,
May 15, 2017, 7:45:03 PM5/15/17
to puppe...@googlegroups.com

Sean McDonald (JIRA)

unread,
May 15, 2017, 7:46:03 PM5/15/17
to puppe...@googlegroups.com

Sean McDonald (JIRA)

unread,
May 15, 2017, 7:46:03 PM5/15/17
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:46:53 PM5/18/17
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 11, 2021, 1:46:03 AM11/11/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.13.0
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Nov 11, 2021, 1:46:03 AM11/11/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 11, 2021, 1:47:03 AM11/11/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 11, 2021, 1:50:03 AM11/11/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-3907
 
Re: Noop changes to file ownership generate failures if required User or Group does not exist

The error occurs because puppet tries to normalize the user and group name to uid/gid in order to determine if the file owner & group are insync or not. And it doesn't take noop into account before raising. Its possible to avoid this by specify the uid & gid for the user and group resources, but there seems to be a trivial fix here.

Josh Cooper (Jira)

unread,
Nov 11, 2021, 1:17:02 PM11/11/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 11, 2021, 1:18:02 PM11/11/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: Puppet will now correctly report when a file's owner or group would change in noop mode even if the owner or group would be created in the same run.

Josh Cooper (Jira)

unread,
Nov 19, 2021, 11:30:03 AM11/19/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages