Skip to content

Rootless regression on Ubuntu 26.04: same source-built Mosquitto image works on 24.04 and rootful 26.04, but gets EACCES opening /mosquitto/config/mosquitto.conf on 26.04 rootless #28578

@johanrydell

Description

@johanrydell

Issue Description

I found a rootless regression across an Ubuntu upgrade.

The same source-built Mosquitto 2.1.1 image behaves like this:

  • Ubuntu 24.04.4 LTS, rootless: works
  • Ubuntu 26.04 LTS, rootful: works
  • Ubuntu 26.04 LTS, rootless: fails

The failing case is opening /mosquitto/config/mosquitto.conf inside the container.

This is reproducible with a self-built image, not only the official eclipse-mosquitto image. The official image also shows the same rootless symptom on Ubuntu 26.04.

I found Podman issue #6989, which looks related in family because it also involves Mosquitto and Podman non-root behavior, but my case appears different: I can reproduce it with a source-built image, and I have a clear 24.04 vs 26.04 regression split. :contentReference[oaicite:0]{index=0}

The failure is reproducible with a self-built image as well as the official image, which suggests this is not only an official-image packaging issue.

### Steps to reproduce the issue

1. Build a source-based Mosquitto 2.1.1 image that:
   - creates user/group `mosquitto:mosquitto` with uid/gid 1883
   - copies config to `/mosquitto/config/mosquitto.conf`
   - installs the built broker as `/usr/sbin/mosquitto`

2. Run the same image with the same command in each environment:

```bash
podman run --rm -it \
  --entrypoint /usr/sbin/mosquitto \
  mosq-src-baseline \
  -c /mosquitto/config/mosquitto.conf -v


### Describe the results you received


```markdown
Results:

- Ubuntu 24.04.4 LTS rootless: works
- Ubuntu 26.04 LTS rootful: works
- Ubuntu 26.04 LTS rootless: fails

On Ubuntu 26.04 rootless, Mosquitto exits with:

```text
1776976898: Error: Unable to open config file '/mosquitto/config/mosquitto.conf'.
1776976898: mosquitto version 2.1.1 terminating

A rootless strace from the failing Ubuntu 26.04 case shows:
open("/mosquitto/config/mosquitto.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_DIRECTORY) = -1 ENOTDIR (Not a directory)
open("/mosquitto/config/mosquitto.conf", O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission denied)

### Describe the results you expected

```markdown
I expected the same source-built image to behave consistently across the upgrade path.

Specifically, I expected Ubuntu 26.04 rootless to work the same way as:
- Ubuntu 24.04.4 rootless
- Ubuntu 26.04 rootful

Mosquitto should load `/mosquitto/config/mosquitto.conf` and start normally.

### podman info output

```yaml
host:
  arch: amd64
  buildahVersion: 1.42.1
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon_2.1.13+ds1-2_amd64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.13, commit: unknown'
  cpus: 4
  databaseBackend: sqlite
  distribution:
    codename: resolute
    distribution: ubuntu
    version: "26.04"
  eventLogger: journald
  hostname: ubuntu-26lts
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1001
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1001
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
  kernel: 7.0.0-14-generic
  logDriver: journald
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun_1.21-1ubuntu3_amd64
    path: /usr/bin/crun
  security:
    rootless: true
    seccompEnabled: true
    selinuxEnabled: false
    apparmorEnabled: false
  rootlessNetworkCmd: pasta
store:
  graphDriverName: overlay
  graphRoot: /home/mqttsrv/.local/share/containers/storage
  runRoot: /tmp/storage-run-1001/containers
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
version:
  Version: 5.7.0
  BuildOrigin: Ubuntu
  GoVersion: go1.25.0

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

- VMware virtual machine
- Ubuntu 26.04 LTS failing host: `ubuntu-26lts`
- Ubuntu 24.04.4 LTS working host: `t-work`
- Rootless uses:
  - `graphRoot: /home/mqttsrv/.local/share/containers/storage`
  - `runRoot: /tmp/storage-run-1001/containers`
- OCI runtime on failing host: `crun`
- Network backend: `netavark`

### Additional information

Cross-check summary:

- Same source-built image
- Same command
- Same config path: `/mosquitto/config/mosquitto.conf`

Results:
- Ubuntu 24.04.4 rootless: works
- Ubuntu 26.04 rootful: works
- Ubuntu 26.04 rootless: fails

In the failing Ubuntu 26.04 rootless case, `strace` shows:

```text
open("/mosquitto/config/mosquitto.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_DIRECTORY) = -1 ENOTDIR
open("/mosquitto/config/mosquitto.conf", O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission denied)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.triagedIssue has been triaged

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions