Public bug reported:

containerd is failing its autopkgtest on all architectures:

https://autopkgtest.ubuntu.com/results/autopkgtest-
questing/questing/ppc64el/c/containerd-app/20250720_134304_4ee75@/log.gz

This seems to be quite similar to LP: #2105839 and probably has the same
root cause, but that is riscv64 only, whereas this failure seems to be
afflicting all architectures and the logs are not exact.

From what I can tell from the log output, the basic-smoke autopkgtest
for containerd-app is failing on all architectures due to a race
condition attempting to use the ctr client before the containerd daemon
has finished starting.

I suspect that depending on the performance of the test architecture,
the failure manifests in one of two ways:

* On slower architectures (e.g., riscv64), the client times out trying
to connect to the daemon socket. This is documented in bug #2105839.

* On faster architectures (e.g., ppc64el), the client fails immediately
with a "no such file or directory" error because the socket has not yet
been created.

[Root Cause]
The flaw is in the debian/tests/basic-smoke script. It executes the following 
commands in sequence:

    ...
    containerd &
    ctr images pull docker.io/library/busybox:latest
    ...

Holy race condition batman!  So, containerd's started as a background
process without any wait logic.  ctr executes and may fail because the
daemon's socket at /run/containerd/containerd.sock is not yet available.

[Suggested Fix]

The test script should be modified to poll for the existence of the
/run/containerd/containerd.sock file in a loop after starting the
containerd & process. The script should only proceed with the ctr
commands once the socket is confirmed to be present.

** Affects: containerd-app (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "Suggested implementation of a wait"
   
https://bugs.launchpad.net/bugs/2118738/+attachment/5892959/+files/0001-basic-smoke-Poll-server-before-trying-to-run-test-cl.patch

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

Title:
   containerd-app autopkgtest fails on all architectures because it does
  not wait for the daemon to start

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/containerd-app/+bug/2118738/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to