Skip to content
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

uv_os_get_passwd returned ENOENT in docker #2699

Closed
alexesDev opened this issue Mar 26, 2019 · 4 comments
Closed

uv_os_get_passwd returned ENOENT in docker #2699

alexesDev opened this issue Mar 26, 2019 · 4 comments

Comments

@alexesDev
Copy link

I build my application in docker, pass current uid via -u and get an error becouse /etc/passwd don't have any info about uid. This error can be repeated like this.

docker run --rm -it -u 200 \ # any uid
  node:10.13-alpine \
  sh -c 'echo "require(\"os\").userInfo()" | node'

SystemError [ERR_SYSTEM_ERROR]: A system error occurred:
uv_os_get_passwd returned ENOENT (no such file or directory

I can mount /etc/passwd from host, but this is bad

docker run --rm -it -u 200 \
  -v /etc/passwd:/etc/passwd \
  node:10.13-alpine \
  sh -c 'echo "require(\"os\").userInfo()" | node'

If use process.geteuid() instead of os.userInfo().username, then there will be no problem.

const username = os.userInfo().username;

@Hypnosphi
Copy link

@alexesDev how did you solve this issue?

@MoSattler
Copy link
Contributor

MoSattler commented Jan 11, 2021

I got the same issue as well. Though only when running the container in github actions with a volume.

@MoSattler
Copy link
Contributor

Possibly related to this: nodejs/node#25714

@toxsick
Copy link

toxsick commented Jul 15, 2021

Had the same thing with openshift. The problem was that my user present in /etc/passwd. This can be checked easily with whoami, because it failes in this case. When I add the current user like this, it works:

echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd

In my case this is a openshift topic that drives me nuts on a regular basis. I had to build a custom node image that adds RUN chmod g=u /etc/passwd to be able to do this.

Hope it helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants