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

On unprivileged setup, ansible_user_uid undefined #116

Closed
pcm32 opened this issue Oct 28, 2020 · 1 comment
Closed

On unprivileged setup, ansible_user_uid undefined #116

pcm32 opened this issue Oct 28, 2020 · 1 comment

Comments

@pcm32
Copy link
Member

pcm32 commented Oct 28, 2020

When running on an unprivileged setup, same user ssh-in and installing galaxy, I get the following error:

TASK [galaxyproject.galaxy : Set Galaxy user facts] ***************************************************************
fatal: [galaxy-gxa-002]: FAILED! => {"msg": "The field 'become' has an invalid value, which includes an undefined variable. The error was: 'ansible_user_uid' is undefined"}

This doesn't happen for some reason when the user ssh-ing and the galaxy_user (still all unprivileged) are different. Any ideas?

Problem seems to be here: https://github.com/galaxyproject/ansible-galaxy/blob/master/defaults/main.yml#L51

@pcm32
Copy link
Member Author

pcm32 commented Jan 29, 2021

Maybe I should have come back to this (I first saw the error in Oct but went back to work on this in Dec and forgot about this issue). I realised the issue here was that the python3 installation (happened with compiled from source and brew installation) I was basing on had some issues in the system where it was running to obtain information from the user database:

import os
import pwd
pwd.getpwuid(os.getuid())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'getpwuid(): uid not found: 2074'

this apparently impacted in the ability of ansible to set the user uid and hence the failure. The comparison I was mentioning was based on a different target system, where the python3 installation didn't suffer from this. So I think that this was more of an issue on my side and hence I'll close this. If you are here because you run into the same problem, and the above snippet works for you, then feel free to re-open.

@pcm32 pcm32 closed this as completed Jan 29, 2021
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

1 participant