Explicit addition of a user's primary_group breaks the user creation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Medium
|
Unassigned |
Bug Description
$ multipass launch --cloud-init - <<EOF
users:
- name: $USER
groups: [ubuntu]
ssh_authorize
- $( cat ~/.ssh/id_rsa.pub )
EOF
# times out due to missing `ubuntu` user
$ multipass ls
# find the IP
$ ssh $IP
# /var/log/
2020-04-02 09:40:27,551 - __init__.py[DEBUG]: Adding user ubuntu
2020-04-02 09:40:27,551 - util.py[DEBUG]: Running hidden command to protect sensitive input/output logstring: ['useradd', 'ubuntu', '--comment', 'Ubuntu', '--groups', 'adm,audio,
2020-04-02 09:40:27,555 - util.py[WARNING]: Failed to create user ubuntu
2020-04-02 09:40:27,556 - util.py[DEBUG]: Failed to create user ubuntu
Traceback (most recent call last):
File "/usr/lib/
util.
File "/usr/lib/
cmd=args)
cloudinit.
Command: ['useradd', 'ubuntu', '--comment', 'Ubuntu', '--groups', 'adm,audio,
Exit code: 9
Reason: -
Stdout:
Stderr: useradd: group ubuntu exists - if you want to add this user to that group, use -g.
2020-04-02 09:40:27,560 - handlers.py[DEBUG]: finish: init-network/
It looks as if a user's primary_group is created prior to that user being created, the user addition fails.
Changed in cloud-init: | |
status: | Confirmed → Triaged |
Isn't this just the fact that if you specify a user the default user doesn't get created?