eth-cscs/sarus

Failed to retrieve username for uid=xxxxx

pozsa opened this issue · 5 comments

pozsa commented

Receiving the error mentioned in the subject. I'd welcome any ideas what I might be doing wrong. Thanks.

-bash-4.2$ sarus --debug images
[6215047.318118181] [<redacted>] [CLI] [DEBUG] parsing CLI arguments of images command
[6215047.318211795] [<redacted>] [CommonUtility] [DEBUG] initializing CLI config's directories for local repository
Failed to retrieve username for uid=<redacted>
See 'sarus help images'
[6215047.345666132] [<redacted>] [main] [ERROR] Error trace (most nested error last):
#0   parseCommandArguments at "CommandImages.hpp":137 Failed to retrieve username for uid=<redacted>
See 'sarus help images'
-bash-4.2$

steps taken before trying the above command

sudo mkdir /opt/sarus
cd /opt/sarus
sudo wget https://github.com/eth-cscs/sarus/releases/download/1.3.0/sarus-Release.tar.gz
tar xf sarus-Release.tar.gz
cd 1.3.0-Release
sudo yum install squashfs-tools
sudo ./configure_installation.sh
export PATH=/opt/sarus/1.3.0-Release/bin:${PATH}

extra info:

File: ‘/opt/sarus/1.3.0-Release/bin/sarus’
Access: (6755/-rwsr-sr-x)  Uid: (    0/    root)   Gid: (    0/    root)

Hello @pozsa,
the error is caused by Sarus being unable to find an entry corresponding to the current user in the passwd/group caches created in <Sarus install path>/etc (see here for more information on the passwd/group caches).

The configure_installation.sh script, which you are calling as part of your installation steps, should have taken care of creating the caches by using getent.

Could you please verify your user is present in Sarus's passwd cache (e.g. cat /opt/sarus/1.3.0-Release/etc/passwd)?
Does a call to getent passwd return a list of all the users in the system as you would expect them?

pozsa commented

Hi @Madeeks,
Yes this is going to be the source of the issue.
getent passwd does not return all the users in our case.
Hence it's also not in the cache.

Any ideas on how to resolve this? It is not an option on our end for getent passwd to return all. The list is way too big.

The most straightforward way you could solve this issue right now is to explicitly add the users (and corresponding groups) which will use Sarus to the passwd/group caches.
Would that be a feasible option?
I'll discuss with the other developers if there are ways we can improve this use case.

pozsa commented

Thanks. That works for testing our deployment.
I am talking tomorrow to our sys admins managing our HPC cluster. I'll bring up this topic and see if we can make something happen on our end.

Closing due to no further action required on the developer side.
Feel free to reopen with additional details or open a new issue.