sous-chefs / users

Development repository for the users cookbook
https://supermarket.chef.io/cookbooks/users
Apache License 2.0
138 stars 218 forks source link

useradd fails if user primary group is already supplementary group #431

Closed jgainey closed 3 years ago

jgainey commented 4 years ago

Cookbook version

1.6.1

Chef-client version

11.8.12

Platform Details

Red Hat Enterprise Linux Server release 6.10 (Santiago)

Scenario:

Mixlib::ShellOut::ShellCommandFailed ------------------------------------ Expected process to exit with [0], but received '9' ---- Begin output of ["useradd", "-c", "Application Admin", "-d", "/home/admin", "-m", "admin"] ---- STDOUT: STDERR: useradd: group admin exists - if you want to add this user to that group, use -g. ---- End output of ["useradd", "-c", "Application Admin", "-d", "/home/admin", "-m", "admin"] ---- Ran ["useradd", "-c", "Application Admin", "-d", "/home/admin", "-m", "admin"] returned 9

Steps to Reproduce:

Expected Result:

/etc/passwd: mboss:x:501:501:My Boss:/home/myboss:/bin/bash admin:x:502:502:Application Admin:/home/admin:/bin/bash

/etc/group: myboss:x:501: admin:x:502:myboss

$ id admin uid=502(admin) gid=502(admin) groups=502(admin)

$ id myboss uid=501(myboss) gid=501(myboss) groups=501(myboss),502(admin)

Actual Result:

chef-client log Mixlib::ShellOut::ShellCommandFailed ------------------------------------ Expected process to exit with [0], but received '9' ---- Begin output of ["useradd", "-c", "Application Admin", "-d", "/home/admin", "-m", "admin"] ---- STDOUT: STDERR: useradd: group admin exists - if you want to add this user to that group, use -g. ---- End output of ["useradd", "-c", "Application Admin", "-d", "/home/admin", "-m", "admin"] ---- Ran ["useradd", "-c", "Application Admin", "-d", "/home/admin", "-m", "admin"] returned 9

/etc/passwd: mboss:x:501:501:My Boss:/home/myboss:/bin/bash

/etc/group: myboss:x:501: admin:x:502:myboss

$ id admin id: admin: No such user

$ id myboss uid=501(myboss) gid=501(myboss) groups=501(myboss),502(admin)

welcomebot commented 4 years ago

Hey There It looks like this is the first issue you've filed against the chef-cookbooks project. I'm here to offer you a bit of extra help to make sure we can quickly get back to you. Make sure you've filled out all the fields in our issue template. Make sure you've provided us with the version of chef-client you're running, your operating system and the version of the cookbook. If you're not using the most up to date version of the cookbook then please make sure to update first. Lots of things change between versions even if you're issue isn't listed in the changelog. Finally please give us a detailed description of the issue you're having. The more we know about what you're trying to do, what actually happens, and how you can reproduce the problem, the better.

If you're looking for more immediate troubleshooting help make sure to check out #general on the Chef Community Slack. There's plenty of folks there willing to lend a helping hand. Thanks for the first issue. We hope we can get back to you soon with a solution.

github-actions[bot] commented 3 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

github-actions[bot] commented 3 years ago

Closing due to inactivity. If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.