-
Notifications
You must be signed in to change notification settings - Fork 96
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
User scripts with rolling (ubuntu noble) fail from existing UID=1000 #1060
Comments
Scripts are definitely still supported! This affects people running with UID=1000 as the local user on the host. Our build farms get "lucky" because the jenkins-agent is created after another user and gets UID=1001.
A PR here would be welcome. I think @cottsay's hack was |
Docker image ubuntu:noble now ships with an existing user "ubuntu" with UID=1000. So when you try to create a new user "buildfarm" with UID=1000 it fails. Somehow this got fixed on the actual buildfarm, as the buildfarm ID is currently being set at 1001 in those cases.
But when a user tries to run scripts, typically with their UID=1000, it fails.
For example, if I try to run
ros_buildfarm.scripts.doc.generate_doc_script
for rolling (which uses ubuntu:noble) the created job will fail, because the Dockerfile tries toRUN useradd -u 1000 -l -m buildfarm
which fails since there is already a userubuntu
with UID=1000I've played around with the easiest ways to fix this. In a Dockerfile you can add:
RUN if [ $(id -nu 1000) ]; then userdel -r $(id -nu 1000); fi
before the
RUN useradd ...
and it works whether a user with UID=1000 exists or not (that is, on both ubuntu:noble as well as earlier versions). In an empy script on ros_buildfarm you add instead:RUN if [ $(id -nu @uid) ]; then userdel -r $(id -nu @uid); fi
(I tried instead
RUN useradd -o -u @uid -l -m buildfarm
as well, allowing a duplicate UID, but that does not work because the buildfarm gets confused about whether we are using /home/ubuntu or /home/buildfarm)I could do a PR for this, but that issue occurs in a lot of places, every *.Dockerfile.em. Is supporting user scripts still a thing in ros_buildfarm? Am I doing something wrong running them? If you want a PR, would you prefer this in a snippet?
The text was updated successfully, but these errors were encountered: