You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
os.userInfo throws if no username in docker container #25714
It turns out that running a script with docker run with --user flag set, then user actually has no $HOME or username. This in turn causes following error: uv_os_get_passwd returned ENOENT (no such file or directory) if os.userInfo() is accessed.
The error returned from uv_os_get_passwd() is attached to ctxhere, and then thrown in JavaScript here. If you (or anyone else) want to update the docs, they are located here.
many thanks @raido what do you mean exactly by that. instead of which package I should used that? I am trying to do ember build that's where I get this error.
no I don't have that specific package, The only package I found in my project that references uv_os_get_passwd , is in node-gyp . It seems in the latest version of it ( v 5.1.1) this issue is somehow addressed nodejs/node-gyp@c4002de, but updating it to that version still not resolving the issue :( . Is there an workaround that I can use within jenkins to fix this issue? I am using jenkins Pipeline and I have simply :
Activity
cjihrig commentedon Jan 25, 2019
I think the behavior is correct. A documentation PR would be welcome though.
raido commentedon Jan 25, 2019
I guess it throws right here - https://github.com/nodejs/node/blob/master/lib/os.js#L253 ?
It does not seem like it ever gets to the next line to throw the generic error with empty context.
Edit: Or it actually mutates the
ctxobject and that's how the detailed message gets printed?cjihrig commentedon Jan 25, 2019
The error returned from
uv_os_get_passwd()is attached toctxhere, and then thrown in JavaScript here. If you (or anyone else) want to update the docs, they are located here.doc: document os.userInfo() throwing SystemError
zardaloop commentedon May 25, 2020
Hi @raido even-though I am running node:12.0.0 on docker I still get the same error? Is there anything else I need to do to resolve this issue ?
I posted the question on stackoverflow as well but no luck with it yet https://stackoverflow.com/questions/61961485/a-system-error-occurred-uv-os-get-passwd-returned-enoent-no-such-file-or-direc?noredirect=1#comment109603079_61961485
raido commentedon May 25, 2020
Maybe you could use this package: https://github.com/sindresorhus/username?
It has fallback logic for missing username case: sindresorhus/username#22
zardaloop commentedon May 25, 2020
many thanks @raido what do you mean exactly by that. instead of which package I should used that? I am trying to do ember build that's where I get this error.
raido commentedon May 25, 2020
Does you app happen to use
ember-cli-cjs-transformpackage? - rwjblue/ember-cli-cjs-transform#123zardaloop commentedon May 25, 2020
no I don't have that specific package, The only package I found in my project that references uv_os_get_passwd , is in node-gyp . It seems in the latest version of it ( v 5.1.1) this issue is somehow addressed nodejs/node-gyp@c4002de, but updating it to that version still not resolving the issue :( . Is there an workaround that I can use within jenkins to fix this issue? I am using jenkins Pipeline and I have simply :
zardaloop commentedon May 26, 2020
it turned out all I needed to do was adding docker volumne mapping from /etc/passwd to /etc/passwd. like this :
doc: document os.userInfo() throwing SystemError