Creating a user as a member of a group fails to add that group to the user
When creating a user, if a group is selected during account creation, the group is not added to the user at the OS level, and an error is logged:
/system_usermanager.php: The command '/usr/sbin/pw groupmod -l 'admins' -g '1999' -M '0,2020' 2>&1' returned exit code '67', the output was 'pw: user `2020' does not exist'
It would appear the sync process is attempting to add the user to the group before the user exists in a way visible to
This group will not appear on the user in the OS until after a reboot, or after the group is removed and added again.
Adding a group to an existing user works and does not produce an error.
Updated by Jens Groh over 5 years ago
Jim Pingle: pardon me for jumping in, but is that happening only on the slave via XMLRPC or is that happening on the master? We were encountering a problem that the sudo package won't recognize users being in the admins group when those were added after the sudo package installation. Users installed before (or I think before a reboot) could 'sudo' correclty while newly created ones get the "sudo blah incident reported ;)" message. Could that perhaps be related to this? If you don't think so, should I open a bug here or elsewhere for the sudo package?
Updated by Jim Pingle over 5 years ago
It's happening on a standalone system, not XMLRPC. Presumably it would also happen on a master if the same situation happened.
It's easy to reproduce, just make a user and add a group during the creation step. You'll see the error and if you check
id <username> it won't show them in the group. You can also check the groups file and so on. If you create the user without a group, then edit again and add the group, that works OK and it shows everywhere. It also fixes itself during a full user resync like what happens during a reboot.