Fails to create user when uid is in use
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mojo: Continuous Delivery for Juju |
Confirmed
|
Medium
|
Unassigned |
Bug Description
2014-05-23 10:59:35 [INFO] Running script build
2014-05-23 10:59:36 [INFO] Running command in container 'click-
2014-05-23 10:59:37 [INFO] Running command in container 'click-
useradd: UID 1000 is not unique
Traceback (most recent call last):
File "/usr/bin/mojo", line 9, in <module>
load_
File "/usr/lib/
args.func(args)
File "/usr/lib/
manifest.
File "/usr/lib/
phase.
File "/usr/lib/
lxc=True, network=False)
File "/usr/lib/
lxc.run(script, env=env, network=network)
File "/usr/lib/
return method(self, *args, **kwargs)
File "/usr/lib/
self.
File "/usr/lib/
raise e
subprocess.
So it found the user didn't exist, and tried to add it, failing because the uid was in use.
# if the uid exists update the name to match the caller
try:
command = "useradd --home {} --create-home --uid {} {}" \
except subprocess.
if e.returncode == 4:
else:
is the code, so it appears to try and handle this.
However the useradd exited with returncode 1.
Thanks,
James
Related branches
- Tom Haddon: Approve
-
Diff: 166 lines (+80/-17)1 file modifiedmojo/contain.py (+80/-17)
- Tim Kuhlman (community): Approve
-
Diff: 58 lines (+12/-11)1 file modifiedmojo/contain.py (+12/-11)
Changed in canonical-mojo: | |
status: | New → Confirmed |
information type: | Proprietary → Public |
affects: | canonical-mojo → mojo |
Changed in mojo: | |
importance: | Undecided → Medium |
Changed in mojo: | |
assignee: | nobody → Paul Collins (pjdc) |
Changed in mojo: | |
status: | Confirmed → In Progress |
Changed in mojo: | |
status: | In Progress → Fix Committed |
Changed in mojo: | |
status: | Fix Committed → Fix Released |
Changed in mojo: | |
assignee: | Paul Collins (pjdc) → nobody |
UID 1000 is assigned to the first user that is created in the system. On a standard desktop setup that is usually your user; on the base image for the lxc containers, the default user is 'ubuntu', which causes the duplicate uid.