If you get this error ‘fatal: unable to look up current user in the passwd file: no such user‘ when run git command in a pod on OpenShift. Then try to to set up two environment variables as below. This worked for me. The reason could be that on OpenShift, the users are not in the /etc/passwd file but just a random UID.
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
Hi
Would it be possible to give a few more specifics on how you managed to fix this?
Thanks
Just setup the environment variables before git clone, for example.
export GIT_COMMITTER_NAME=’user_name’
export GIT_COMMITTER_EMAIL=’user_email’
git clone …
I can confirm this works, but name/email must directly match your account settings and it is case sensitive.
Thats for sure in the Linux world.
This didn’t work for me using git version 1.8.3.1 on an image based on openshift/base-centos7. I got around it by supplying the details to git:
git -c user.name=git-bug-workaround -c user.email=not@used.com commit
The official solution is to use nss_wrapper and gettext to set the /etc/passwd to container a user that matches the randomly assigned one documented at https://docs.openshift.com/enterprise/3.1/creating_images/guidelines.html