-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: resolve process.setgid error for group 'nobody' on ubuntu #19755
Conversation
This problem is only triggered on Ubuntu if the tests are run as root, which is probably why we almost never see it. But I definitely have gotten more than one report of it from people following https://www.nodetodo.org/getting-started/ |
Hi @dsinecos, and welcome! Thanks for the pull request! |
} catch (err) { | ||
if (err.message !== 'setgid group id does not exist') { | ||
throw err; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You don't need the else
here because of the throw
in the preceding block. I don't mind it, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took me a while to figure out why we won't need the else
block, got it now :) Will keep it in mind for the future
Linter re-run: https://ci.nodejs.org/job/node-test-linter/17646/ |
test-node-commit-arm needs to be re-run too but using |
@Trott Thanks Rich, for all the guidance :) |
@dsinecos would you be so kind and rebase this? :-) And while being on it: do you mind addressing the nit? But that is not required. |
@BridgeAR Sure :) Give me until tomorrow though, I'm tied up with a few things. I hope that's fine |
@dsinecos sure :-) |
When the tests are run as root in Ubuntu, process.setgid is called with 'nobody' as an argument. This throws an error in Ubuntu. This is because in Ubuntu the equivalent of 'nobody' group is named as 'nogroup' This commit sets gid to 'nobody' first and if it throws a `group id does not exist` error, it attempts to set gid to 'nogroup'. If it still causes an error, the error is thrown. Refs: nodejs#19594
2d83de1
to
b1ebb21
Compare
@BridgeAR I've made the changes. I just realized, the commit message is not as per the guidelines, I'll amend that and push again, sorry about this |
Else block removed as the `throw` in the preceding block makes it redundant Refs: nodejs#19594
b1ebb21
to
2129edf
Compare
@BridgeAR I hope I haven't made any errors around the commits, I did a
Let me know if something is amiss or if this needs more changes :) |
Re-running SmartOS: https://ci.nodejs.org/job/node-test-commit-smartos/16964/ |
Re-running Linux: https://ci.nodejs.org/job/node-test-commit-linux/18062/ |
One last CI before landing: https://ci.nodejs.org/job/node-test-pull-request/14416/ |
Landed in cc8a33e. |
When the tests are run as root in Ubuntu, process.setgid() is called with 'nobody' as an argument. This throws an error in Ubuntu and is because, in Ubuntu, the equivalent of 'nobody' group is named as 'nogroup'. This commit sets gid to 'nobody' first and if it throws a "group id does not exist" error, it attempts to set gid to 'nogroup'. If it still causes an error, the error is thrown. PR-URL: #19755 Refs: #19594 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
When the tests are run as root in Ubuntu, process.setgid() is called with 'nobody' as an argument. This throws an error in Ubuntu and is because, in Ubuntu, the equivalent of 'nobody' group is named as 'nogroup'. This commit sets gid to 'nobody' first and if it throws a "group id does not exist" error, it attempts to set gid to 'nogroup'. If it still causes an error, the error is thrown. PR-URL: #19755 Refs: #19594 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
When the tests are run as root in Ubuntu, process.setgid is called with
'nobody' as an argument. This throws an error in Ubuntu. This is because
in Ubuntu the equivalent of 'nobody' group is named as 'nogroup'
This commit sets gid to 'nobody' first and if it throws a
group id does not exist
error, it attempts to set gid to 'nogroup'. If it stillcauses an error, the error is thrown.
Refs: #19594
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes