You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
python:3.9 - Failed run apt update from the last version of the image #837
today morning we found that our builds failed
we are using python:3.9
when we run apt update the build failed
it looks that it fails because of the upgrade to bookworm
we get this errors
#5 [build 2/4] RUN apt-get update && apt-get install -y --no-install-recommends poppler-utils
#5 sha256:fdb97fe2ebc3fcf79626c6628756f871cc0d6b0fc02ba21a2949fe33d31a2373
#5 0.240 Get:1 http://deb.debian.org/debian bookworm InRelease [147 kB]
#5 0.247 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
#5 0.248 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
#5 0.277 Err:1 http://deb.debian.org/debian bookworm InRelease
#5 0.277 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY F8D2585B8783D481
#5 0.303 Err:2 http://deb.debian.org/debian bookworm-updates InRelease
#5 0.303 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
#5 0.329 Err:3 http://deb.debian.org/debian-security bookworm-security InRelease
#5 0.329 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
#5 0.330 Reading package lists...
#5 0.337 W: GPG error: http://deb.debian.org/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY F8D2585B8783D481
#5 0.337 E: The repository 'http://deb.debian.org/debian bookworm InRelease' is not signed.
#5 0.337 W: GPG error: http://deb.debian.org/debian bookworm-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
#5 0.337 E: The repository 'http://deb.debian.org/debian bookworm-updates InRelease' is not signed.
#5 0.337 W: GPG error: http://deb.debian.org/debian-security bookworm-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
#5 0.337 E: The repository 'http://deb.debian.org/debian-security bookworm-security InRelease' is not signed.
#5 0.337 E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
#5 0.337 E: Sub-process returned an error cod
changed the title [-]Failed run `apt update` from the last version of the build from image `python:3.9`[/-][+]`python:3.9` - Failed run `apt update` from the last version of the image[/+]on Jun 15, 2023
I am unable to reproduce. I'd suggest updating docker and libseccomp on the host. Newer base OS's use newer system calls and an older libseccomp can block them since they are unknown to it. You can verify that it is libseccomp by running the bookworm image with --security-opt seccomp=unconfined.
I see the same for python:3.8-slim and others after the update from buster -> bookworm.
I think the image needs an update of the GPG public keys for the bookworm apt repos.
EDIT: Until this is fixed, you can use the -buster versions of images, such as python:3.8-slim-buster
It seems like the pointers for the latest image tags are moved to bookworm. The python:3.9-slim-bullseye might work instead of python:3.9-slim or maybe python:3.9-slim-buster will work too. The official 3.9 image github update shows that the version is updated from buster to bookworm.
Reacted by WenYu Lee, Tema Smirnov, takahiro ono and Alex Kolyago
Can confirm that our builds were also impacted using python:3.8-slim. Modifying to python:3.8-slim-bullseye resolved the issue, so we're temporarily using that until the issue is resolved.
Reacted by Tema Smirnov, Vadim Laletin, Alex Kolyago and gaosh3n
5.2.2. Python Interpreters marked externally-managed
The Debian provided python3 interpreter packages (python3.11 and pypy3) are now marked as being externally-managed, following PEP-668. The version of python3-pip provided in Debian follows this, and ?will refuse to manually install packages on Debian's python interpreters, unless the --break-system-packages option is specified.
If you need to install a Python application (or version) that isn't packaged in Debian, we recommend that you install it with pipx (in the pipx Debian package). pipx will set up an environment isolated from other applications and system Python modules, and install the application and its dependencies into that.
docker run --name=dummy --rm -ti --privileged python:3.11-slim bash -c 'apt-get update && apt-get install -y less && echo OK'
Get:1 http://deb.debian.org/debian bookworm InRelease [147 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8904 kB]
Get:5 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [28.3 kB]
Fetched 9180 kB in 2s (4844 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
less
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 131 kB of archives.
After this operation, 321 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 less amd64 590-2 [131 kB]
Fetched 131 kB in 0s (3313 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package less.
(Reading database ... 8386 files and directories currently installed.)
Preparing to unpack .../archives/less_590-2_amd64.deb ...
Unpacking less (590-2) ...
Setting up less (590-2) ...
OK
I can confirm that it "works" when unconfined. Don't try this at home
docker run --name=dummy --rm -ti --security-opt seccomp=unconfined python:3.11-slim bash -c 'apt-get update && apt-get install -y less && echo OK'
Get:1 http://deb.debian.org/debian bookworm InRelease [147 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8904 kB]
Get:5 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [28.3 kB]
Fetched 9180 kB in 2s (4821 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
less
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 131 kB of archives.
After this operation, 321 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 less amd64 590-2 [131 kB]
Fetched 131 kB in 0s (2989 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package less.
(Reading database ... 8386 files and directories currently installed.)
Preparing to unpack .../archives/less_590-2_amd64.deb ...
Unpacking less (590-2) ...
Setting up less (590-2) ...
OK
Root cause: it is Docker with libseccomp so a newer syscall used in Debian Bookworm packages/libs is being blocked. (Thanks for confirming @aebm)
libseccomp lets you configure allowed syscalls for a process. Docker sets a default seccomp profile for all containers such that only certain syscalls are allowed and everything else is blocked (so, newer syscalls that are not yet known to libseccomp or docker are blocked).
verify that it is libseccomp by running the Bookworm-based image with --security-opt seccomp=unconfined
use only as a test; it is less secure to keep running them "unconfined"
update libseccomp and docker on the host running the containers
one workaround:
switch to the *bullseye images (in the python images, these will continue to be maintained/updated until the respective Python end of life or the next Debian release, Debian Trixie)
Reacted by Austin Bailey, takahiro ono, Omar Trigui, Marcin Wrochna, jhard, Abdullah Khawer, fengxsong, David Carlos de Araujo Silva, floriankapaun, Enrique Matías Sánchez and 11 more
Reacted by Alejandro E Brito Monedero, aviad priel, akonovalov, yuliyan-valchev-ft, Martin, Pranavi Bollam, Draevich Matthew, yogawa-mp, Mahmut Uludag, ilsnk and 1 more
Just a comment here. If you're running your builds in a dockerized Jenkins, for example, you'll also be using docker:dind (docker in docker). You may need to upgrade docker here. docker pull docker:dind
I've got this problem running in gitlab-ci with the worker running on a private Kubernetes cluster. I'm not sure how to fix it apart from using the older bullseye image which obviously is a stopgap solution. This is the setup for the build:
Activity
[-]Failed run `apt update` from the last version of the build from image `python:3.9`[/-][+]`python:3.9` - Failed run `apt update` from the last version of the image[/+]Cookiehook commentedon Jun 15, 2023
We're seeing the same issues on python:3.10. Worked around by using python:3.10-bullseye for now.
aviadpriel commentedon Jun 15, 2023
yes, same for python:3.9-bullseye
but we have couple of security fixes on Debian 12 that we want to get
a1723 commentedon Jun 15, 2023
The main question is: Will it be fixed in python:xx images or now we must always used images with "bullseye" postfix ?
yosifkit commentedon Jun 15, 2023
I am unable to reproduce. I'd suggest updating docker and libseccomp on the host. Newer base OS's use newer system calls and an older libseccomp can block them since they are unknown to it. You can verify that it is libseccomp by running the bookworm image with
--security-opt seccomp=unconfined.This is similar to the update to Ubuntu focal: docker-library/mongo#606 (comment)
InterferencePattern commentedon Jun 15, 2023
I see the same for
python:3.8-slimand others after the update from buster -> bookworm.I think the image needs an update of the GPG public keys for the bookworm apt repos.
EDIT: Until this is fixed, you can use the
-busterversions of images, such aspython:3.8-slim-busterjmmclean commentedon Jun 15, 2023
hitting us as well, using
python:3.7keever commentedon Jun 15, 2023
This broke our ci docker build jobs that used
python:3.9-slimWe used docker v24.0.2 to do the build.muasif80 commentedon Jun 16, 2023
It seems like the pointers for the latest image tags are moved to bookworm. The
python:3.9-slim-bullseyemight work instead ofpython:3.9-slimor maybepython:3.9-slim-busterwill work too. The official 3.9 image github update shows that the version is updated frombustertobookworm.jacobeturpin commentedon Jun 16, 2023
Can confirm that our builds were also impacted using
python:3.8-slim. Modifying topython:3.8-slim-bullseyeresolved the issue, so we're temporarily using that until the issue is resolved.mitsuo0114 commentedon Jun 19, 2023
Same here in out CI tool. I could solved with downgrading.
I'm assuming following change in Debian may have some affect to CI. (I haven't checked deeply)
https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#python3-pep-668
5.2.2. Python Interpreters marked externally-managed
The Debian provided python3 interpreter packages (python3.11 and pypy3) are now marked as being externally-managed, following PEP-668. The version of python3-pip provided in Debian follows this, and ?will refuse to manually install packages on Debian's python interpreters, unless the --break-system-packages option is specified.
If you need to install a Python application (or version) that isn't packaged in Debian, we recommend that you install it with pipx (in the pipx Debian package). pipx will set up an environment isolated from other applications and system Python modules, and install the application and its dependencies into that.
aebm commentedon Jun 19, 2023
Hi, that is a "problem" with the change of the debian base image used. It seems related to seccomp and it is mentioned here debuerreotype/docker-debian-artifacts#197 (comment)
Example (PS: Don't run you containers with more privileges that necessary =) )
vs
aebm commentedon Jun 19, 2023
I can confirm that it "works" when unconfined. Don't try this at home
tianon commentedon Jun 20, 2023
The proper fix is updating libseccomp2 (and Docker/runc) on your host. 👍
yosifkit commentedon Jun 20, 2023
(basically the same comment as redis/docker-library-redis#365 (comment))
Root cause: it is Docker with
libseccompso a newer syscall used in Debian Bookworm packages/libs is being blocked. (Thanks for confirming @aebm)libseccomplets you configure allowed syscalls for a process. Docker sets a default seccomp profile for all containers such that only certain syscalls are allowed and everything else is blocked (so, newer syscalls that are not yet known tolibseccompordockerare blocked).libseccompby running the Bookworm-based image with--security-opt seccomp=unconfinedlibseccompanddockeron the host running the containers*bullseyeimages (in thepythonimages, these will continue to be maintained/updated until the respective Python end of life or the next Debian release, Debian Trixie)5 remaining items
ad-m-ss commentedon Jul 20, 2023
Docker on Mac usually uses Linux VM. Linux VM uses
libseccomp.k0d3r1s commentedon Jul 21, 2023
which
libseccompversion is required for this to be working?openbrian commentedon Jul 27, 2023
Just a comment here. If you're running your builds in a dockerized Jenkins, for example, you'll also be using docker:dind (docker in docker). You may need to upgrade docker here. docker pull docker:dind
skabbit commentedon Aug 15, 2023
I verify, that switching to
python:3.7-slim-buster(orpython:3.7-busterin my case) resolved this issue with NO_PUBKEY.Also, faced this issue only while using
docker:18.09.7-dindrunner in CI/CD, but cannot reproduce it on docker v20.10.13 manually running docker cmd.Pin debian release docker-library/python#837
mke21 commentedon Sep 21, 2023
I've got this problem running in gitlab-ci with the worker running on a private Kubernetes cluster. I'm not sure how to fix it apart from using the older bullseye image which obviously is a stopgap solution. This is the setup for the build:
sergei-lobanov commentedon Oct 4, 2023
Any plans for a normal fix?
tianon commentedon Dec 7, 2023
#837 (comment)
fgoura commentedon Feb 28, 2024
tianon commentedon Feb 28, 2024
fgoura commentedon Feb 28, 2024
anilrajrimal1 commentedon Aug 7, 2025
All these discussions and i am still having the issue with python3.9-slim
tianon commentedon Aug 7, 2025
@anilrajrimal1 it's likely docker-library/official-images#16829 (or a full disk, which might be the disk of a VM if you're on Docker Desktop or similar)