podman: Rootless podman on CircleCI fails to even build with error running container: from /usr/bin/crun: sd-bus call: Permission denied

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

I select bug here but this is more a question about what the assumptions are about the setup and what could be causing the crun / sd-dbus Permission deniced / Interactive authentication required failure or what configuration change to try.

Description

I try to add testing https://github.com/freeipa/freeipa-container on CircleCI on their Ubuntu 22.04 VMs.

Compared to GitHub Actions Ubuntu 22.04 where this works without issues once a session gets created by ssh to self, on CircleCI where loginctl shows that we already have session I’m hitting

STEP 2/2: RUN date
error running container: error from /usr/bin/crun creating container for [/bin/sh -c date]: sd-bus call: Permission denied
: exit status 1
Error: error building at STEP "RUN date": error while running runtime: exit status 1
Exited with code exit status 125

or with podman from download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/

STEP 2/2: RUN date
error running container: from /usr/bin/crun creating container for [/bin/sh -c date]: sd-bus call: Interactive authentication required.: Permission denied
: exit status 1
ERRO[0003] did not get container create message from subprocess: EOF 
Error: building at STEP "RUN date": while running runtime: exit status 1
Exited with code exit status 1

Steps to reproduce the issue:

  1. Have .circleci/config.yml in your project’s repo with content to install podman and build an image with it in rootless fashion
version: 2.1

jobs:
  build-image:
    machine:
      image: ubuntu-2204:edge
    resource_class: arm.medium
    steps:
      - run: sudo apt-get -y update
      - run: sudo apt-get -y install podman
      - run: podman version
      - run: podman info
      - run: apt list podman
      - run: loginctl
      - run: ( echo FROM quay.io/centos/centos:stream9 ; echo RUN date ) > Dockerfile.circleci
      - run: podman build -f Dockerfile.circleci .

workflows:
  test-podman:
    jobs:
      - build-image
  1. Enable CircleCI, push, watch the pipeline output.

Describe the results you received:

https://app.circleci.com/pipelines/github/adelton/freeipa-container/74/workflows/9a11b1d9-4040-4d9f-a005-e50532d4bb44/jobs/503

podman build -f Dockerfile.circleci .

STEP 1/2: FROM quay.io/centos/centos:stream9
Trying to pull quay.io/centos/centos:stream9...
Getting image source signatures
…
Writing manifest to image destination
Storing signatures
STEP 2/2: RUN date
error running container: error from /usr/bin/crun creating container for [/bin/sh -c date]: sd-bus call: Permission denied
: exit status 1
Error: error building at STEP "RUN date": error while running runtime: exit status 1
Exited with code exit status 125

Describe the results you expected:

No error, image built.

Additional information you deem important (e.g. issue happens only occasionally):

The loginctl shows we are running in a session:

SESSION  UID USER     SEAT TTY
     c1 1001 circleci      

1 sessions listed.

I also tried systemd-run --scope --user and ssh to self to no avail. It seems like we have session alright, it just needs some permissions somewhere.

I get this on the CircleCI Ubuntu VMs in deterministic fashion. When I change the

      - run: sudo apt-get -y update
      - run: sudo apt-get -y install podman

steps to

      - run: sudo mkdir -p /etc/apt/keyrings
      - run: curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key
             | gpg --dearmor
             | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
      - run: echo
             "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]
             https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /"
             | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
      - run: sudo apt-get update -y
      - run: sudo apt-get install -y podman skopeo

to test with the latest podman per https://podman.io/getting-started/installation#ubuntu, the output is slightly different but still error:

https://app.circleci.com/pipelines/github/adelton/freeipa-container/73/workflows/a086e653-cd68-47f9-851c-54a79d849c7f/jobs/502

podman build -f Dockerfile.circleci .

STEP 1/2: FROM quay.io/centos/centos:stream9
Trying to pull quay.io/centos/centos:stream9...
Getting image source signatures
Writing manifest to image destination
Storing signatures
STEP 2/2: RUN date
error running container: from /usr/bin/crun creating container for [/bin/sh -c date]: sd-bus call: Interactive authentication required.: Permission denied
: exit status 1
ERRO[0003] did not get container create message from subprocess: EOF 
Error: building at STEP "RUN date": while running runtime: exit status 1
Exited with code exit status 1

Output of podman version:

Version:      3.4.4
API Version:  3.4.4
Go Version:   go1.17.3
Built:        Thu Jan  1 00:00:00 1970
OS/Arch:      linux/arm64
WARN[0000] Failed to add pause process to systemd sandbox cgroup: dbus: invalid bus address (no transport) 

Output of podman info:

host:
  arch: arm64
  buildahVersion: 1.23.1
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: 'conmon: /usr/bin/conmon'
    path: /usr/bin/conmon
    version: 'conmon version 2.0.25, commit: unknown'
  cpus: 2
  distribution:
    codename: jammy
    distribution: ubuntu
    version: "22.04"
  eventLogger: journald
  hostname: ip-172-28-21-69
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1002
      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: 5.15.0-1022-aws
  linkmode: dynamic
  logDriver: journald
  memFree: 6990278656
  memTotal: 8116731904
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version 0.17
      commit: 0e9229ae34caaebcb86f1fde18de3acaf18c6d9a
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1001/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.0.1
      commit: 6a7b16babc95b6a3056b33fb45b74a6f62262dd4
      libslirp: 4.6.1
  swapFree: 0
  swapTotal: 0
  uptime: 1m 59.56s
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/circleci/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/circleci/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 0
  runRoot: /run/user/1001/containers
  volumePath: /home/circleci/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.4
  Built: 0
  BuiltTime: Thu Jan  1 00:00:00 1970
  GitCommit: ""
  GoVersion: go1.17.3
  OsArch: linux/arm64
  Version: 3.4.4

Package info (e.g. output of rpm -q podman or apt list podman or brew info podman):

Listing... Done
podman/jammy,now 3.4.4+ds1-1ubuntu1 arm64 [installed]

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes; No

Additional environment details (AWS, VirtualBox, physical, etc.):

This is on CircleCI Ubuntu 22.04 ARM VM.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (12 by maintainers)

Most upvoted comments