Jira (PUP-9973) Can't create users using useradd provider when specifying uid since 6.8.0

0 views
Skip to first unread message

Tim Bishop (JIRA)

unread,
Aug 22, 2019, 5:36:03 PM8/22/19
to puppe...@googlegroups.com
Tim Bishop created an issue
 
Puppet / Bug PUP-9973
Can't create users using useradd provider when specifying uid since 6.8.0
Issue Type: Bug Bug
Affects Versions: PUP 6.8.0
Assignee: Unassigned
Components: Types and Providers
Created: 2019/08/22 2:35 PM
Priority: Major Major
Reporter: Tim Bishop

Puppet Version: 6.8.0
Puppet Server Version: 6.4.0
OS Name/Version: Ubuntu 18.04

Creating a user specifying the UID:

user { 'test':

Desired Behavior:

Creating a user specifying the UID:

 

Actual Behavior:

Please take a moment and attach any relevant log output and/or manifests. This will help us immensely when troubleshooting the issue.

Examples:
Run puppet agent with --test --trace --debug

Relevant sections of /var/log/puppetlabs/puppetserver/puppetserver.log or any applicable logs from the same directory.

For more detailed information turn up the server logs by upping the log level in the server's logback.xml

Relevant sections of configurations files (puppet.conf, hiera.conf, Server's conf.d, defaults/sysconfig)

For memory issues with server heap dumps are also helpful.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Tim Bishop (JIRA)

unread,
Aug 22, 2019, 5:42:03 PM8/22/19
to puppe...@googlegroups.com
Tim Bishop updated an issue
Change By: Tim Bishop
*Puppet Version: 6.8.0*
*Puppet Server Version: 6.4.0*
*OS Name/Version: Ubuntu 18.04*

Creating a user specifying the UID
(uses useradd provider automatically) :

{{ user }} { {{ 'test':   ...   uid => 123,}}}

*Desired Behavior:*

Creating a user specifying the UID: User is created with uid 123.

 

*Actual Behavior:*

Please take a moment and attach any relevant log output and/or manifests. This will help us immensely when troubleshooting the issue. {{Error: Could not create user test1: Execution of '[redacted]' returned 1: Error: Could not execute posix command: no implicit conversion of Integer into String}}

Examples Debugging showed the command as :
Run puppet agent with --test --trace --debug

Relevant sections of
{{ [" / var usr / log sbin / puppetlabs useradd", "-c", "Test1", "-g", "users", "-d", " / puppetserver home / puppetserver.log test1", "-p", "removed", "-s", "/bin/tcsh", "-u", 123, "-m", "test1"] }} or any applicable logs from the same directory.

For more detailed information turn up the server logs by upping the log level in the server So I ' s logback m assuming the 123 argument there should be quoted . xml

Relevant sections of configurations files (puppet.conf Suspect this is to do with this change , hiera.conf, Server but can ' s conf.d, defaults/sysconfig) t see why:

For memory issues with server heap dumps are also helpful [https://github . com/puppetlabs/puppet/commit/70d20329012fc986c3d130f5769cc644f248c1b0#diff-f5b9cc80dd02278d845d220721ac0217]

Josh Cooper (JIRA)

unread,
Aug 23, 2019, 1:37:03 PM8/23/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
*Puppet Version: 6.8.0*
*Puppet Server Version: 6.4.0*
*OS Name/Version: Ubuntu 18.04*

Creating a user specifying the UID (uses useradd provider automatically):

{ {user code:puppet } }
usern
{ {{ 'test':   ...   uid => 123,}
{code
} }

*Desired Behavior:*


User is created with uid 123.

*Actual Behavior:*

{{Error: Could not create user test1: Execution of '[redacted]' returned 1: Error: Could not execute posix command: no implicit conversion of Integer into String}}

Debugging showed the command as:

{{["/usr/sbin/useradd", "-c", "Test1", "-g", "users", "-d", "/home/test1", "-p", "removed", "-s", "/bin/tcsh", "-u", 123, "-m", "test1"]}}

So I'm assuming the 123 argument there should be quoted.

Suspect this is to do with this change, but can't see why:

[https://github.com/puppetlabs/puppet/commit/70d20329012fc986c3d130f5769cc644f248c1b0#diff-f5b9cc80dd02278d845d220721ac0217]

Josh Cooper (JIRA)

unread,
Aug 23, 2019, 2:39:03 PM8/23/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
*Puppet Version: 6.8.0*
*Puppet Server Version: 6.4.0*
*OS Name/Version: Ubuntu 18.04*

Creating a user specifying the UID (uses useradd provider automatically):

{code:puppet}
usern
user { 'test':   ...   uid => 123,}
{code}

*Desired Behavior:*

User is created with uid 123.

*Actual Behavior:*

{{Error: Could not create user test1: Execution of '[redacted]' returned 1: Error: Could not execute posix command: no implicit conversion of Integer into String}}

Debugging showed the command as:

{{["/usr/sbin/useradd", "-c", "Test1", "-g", "users", "-d", "/home/test1", "-p", "removed", "-s", "/bin/tcsh", "-u", 123, "-m", "test1"]}}

So I'm assuming the 123 argument there should be quoted.

Suspect this is to do with this change, but can't see why:

[https://github.com/puppetlabs/puppet/commit/70d20329012fc986c3d130f5769cc644f248c1b0#diff-f5b9cc80dd02278d845d220721ac0217]

Josh Cooper (JIRA)

unread,
Aug 23, 2019, 2:42:03 PM8/23/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9973
 
Re: Can't create users using useradd provider when specifying uid since 6.8.0

Using

user { 'test':
  ensure => present,
  uid => 123,
  password => 'pass123!!'
}

# puppet apply user.pp
...
Error: /Stage[main]/Main/User[test]/ensure: change from 'absent' to 'present' failed: Could not create user test: Execution of '[redacted]' returned 1: Error: Could not execute posix command: no implicit conversion of Integer into String
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:370:in `exec'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:370:in `block (2 levels) in execute_posix'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:128:in `withenv'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:369:in `block in execute_posix'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:502:in `block in safe_posix_fork'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:483:in `fork'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:483:in `safe_posix_fork'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:333:in `execute_posix'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:227:in `execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider.rb:101:in `execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/nameservice.rb:177:in `create'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/user/useradd.rb:261:in `create'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/user.rb:66:in `block (3 levels) in <module:Puppet>'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:490:in `set'
 

Josh Cooper (JIRA)

unread,
Aug 23, 2019, 5:44:02 PM8/23/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9973

The problem is if Puppet::Util::Execution.execute is called with sensitive: true then the command array is not stringified. See https://github.com/puppetlabs/puppet/blob/b7e288ca57670c3fbb8153b0f5e42942626e7608/lib/puppet/util/execution.rb#L165-L172

This is basically the same issue as PUP-9961, it's just we only modified the user providers to pass sensitive: true

Josh Cooper (JIRA)

unread,
Aug 23, 2019, 5:47:03 PM8/23/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Aug 23, 2019, 5:47:04 PM8/23/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Aug 23, 2019, 6:05:03 PM8/23/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Aug 23, 2019, 6:22:04 PM8/23/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Aug 23, 2019, 6:25:03 PM8/23/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes Summary: A regression was introduced in 6.8.0 which prevented puppet from executing commands with non-string arguments if the command was also marked as sensitive.
Release Notes: Bug Fix

Troy Boudreau (JIRA)

unread,
Aug 25, 2019, 4:19:03 PM8/25/19
to puppe...@googlegroups.com
Troy Boudreau commented on Bug PUP-9973
 
Re: Can't create users using useradd provider when specifying uid since 6.8.0

I am seeing this same behavior in the nightly puppet-agent 5.5.16.82.ga51834-1buster on Debian 10.

 

Tim Bishop (JIRA)

unread,
Aug 25, 2019, 5:10:03 PM8/25/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Aug 26, 2019, 12:15:03 PM8/26/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9973

Troy Boudreau yep that is to be expected as the change that introduced the regression was merged to all currently supported branches (5.5.x, 6.0.x, 6.4.x, master). However, only the version merged to master has been released in 6.8.0. Since the regression will be fixed in the older branches before ever being released, this ticket only has a fix version of 6.8.0.

Kris Bosland (JIRA)

unread,
Aug 26, 2019, 2:43:05 PM8/26/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Aug 26, 2019, 2:51:05 PM8/26/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes Summary: A regression was introduced in 6.8.0 which prevented puppet from executing Puppet could not execute commands with non-string arguments if the command was also marked as sensitive and the arguments were passed as an Array to the `execute` method . The issue is fixed for all providers, including the useradd provider.

Jean Bond (JIRA)

unread,
Aug 27, 2019, 6:01:04 PM8/27/19
to puppe...@googlegroups.com

Dorin Pleava (JIRA)

unread,
Sep 11, 2019, 9:51:03 AM9/11/19
to puppe...@googlegroups.com

George Mrejea (JIRA)

unread,
Oct 3, 2019, 7:26:03 AM10/3/19
to puppe...@googlegroups.com
George Mrejea updated an issue
Change By: George Mrejea
Fix Version/s: PUP 6.4.4
Fix Version/s: PUP 5.5.17

Josh Cooper (JIRA)

unread,
Oct 3, 2019, 4:58:03 PM10/3/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.4.4
Fix Version/s: PUP 5.5.17
Reply all
Reply to author
Forward
0 new messages