[Bug 2083240] [NEW] buildd system user lacks homedir leading to issues with snaps[and more]

John Chittum 2083240 at bugs.launchpad.net
Mon Sep 30 11:34:59 UTC 2024


Public bug reported:

when running a Noble buildd image as a CI runner, the following error
occurs

```
Running job phase...
Running test:0
cmd_run.go:1129: WARNING: cannot create user data directory: cannot create snap home dir: mkdir /nonexistent: permission denied
Sorry, home directories outside of /home needs configuration.
See https://forum.snapcraft.io/t/11209 for details.
```

the buildd user is created with the following code in livecd-
rootfs/live-build/buildd/02-user.chroot

```
# Create the buildd user and group.
addgroup --gid 2501 buildd
adduser --system --disabled-password --gecos 'Build Daemon user' \
    --ingroup buildd --uid 2001 --shell /bin/bash buildd
mkdir -p /build/buildd
chown buildd:buildd /build/buildd
```

as of 24.04 (maybe earlier), adduser does not create a homedir for
system users:

> If no home directory is specified, the default home directory for a
new system user is /nonexistent.  This directory should never exist on
any Debian system, and adduser will never create it automatically.

on jammy and earlier images, the following ends up the user conf

```
buildd:x:2001:2501:Build Daemon user,,,:/home/buildd:/bin/bash
```

and on 24.04

```
buildd:x:2001:2501:Build Daemon user,,,:/nonexistent:/bin/bash
```

this is fixed by adding an explicit `--home /home/buildd` to the user
creation call

** Affects: livecd-rootfs (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to livecd-rootfs in Ubuntu.
https://bugs.launchpad.net/bugs/2083240

Title:
  buildd system user lacks homedir leading to issues with snaps[and
  more]

Status in livecd-rootfs package in Ubuntu:
  New

Bug description:
  when running a Noble buildd image as a CI runner, the following error
  occurs

  ```
  Running job phase...
  Running test:0
  cmd_run.go:1129: WARNING: cannot create user data directory: cannot create snap home dir: mkdir /nonexistent: permission denied
  Sorry, home directories outside of /home needs configuration.
  See https://forum.snapcraft.io/t/11209 for details.
  ```

  the buildd user is created with the following code in livecd-
  rootfs/live-build/buildd/02-user.chroot

  ```
  # Create the buildd user and group.
  addgroup --gid 2501 buildd
  adduser --system --disabled-password --gecos 'Build Daemon user' \
      --ingroup buildd --uid 2001 --shell /bin/bash buildd
  mkdir -p /build/buildd
  chown buildd:buildd /build/buildd
  ```

  as of 24.04 (maybe earlier), adduser does not create a homedir for
  system users:

  > If no home directory is specified, the default home directory for a
  new system user is /nonexistent.  This directory should never exist on
  any Debian system, and adduser will never create it automatically.

  on jammy and earlier images, the following ends up the user conf

  ```
  buildd:x:2001:2501:Build Daemon user,,,:/home/buildd:/bin/bash
  ```

  and on 24.04

  ```
  buildd:x:2001:2501:Build Daemon user,,,:/nonexistent:/bin/bash
  ```

  this is fixed by adding an explicit `--home /home/buildd` to the user
  creation call

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/2083240/+subscriptions




More information about the foundations-bugs mailing list