Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image for Postgres 14 based on BookWarm is broken somehow #1100

Closed
sirmax123 opened this issue Jun 15, 2023 · 8 comments
Closed

Docker image for Postgres 14 based on BookWarm is broken somehow #1100

sirmax123 opened this issue Jun 15, 2023 · 8 comments

Comments

@sirmax123
Copy link

Updated docker image with tag postgres:14 is broken

Steps to reproduce:

  1. Existing Dockerfile, worked fine until today, just need to add postgis
FROM postgres:14

RUN apt-get update -y && apt-get install postgresql-14-postgis-3 -y

  1. Starting from today got an errors running docker build command:
<Skipped>
apt-get  update
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]
Err:1 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
Err:2 http://deb.debian.org/debian bookworm-updates InRelease
<skipped>
  1. Actual result: Build Failed
  2. Expected result: extension is installed

Workaround:

Replace FROM postgres:14 with FROM postgres:14-bullseye
(not possible to fix in my upstream repo, so I have to use sed in the build pipeline to do the fix on-the-fly)

@evgeniagusakova
Copy link

have the same issue

@yosifkit
Copy link
Member

yosifkit commented 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)

Same as docker-library/python#837 (comment)

Related: #1099

@Chaoste
Copy link

Chaoste commented Jun 16, 2023

It also breaks all our services when booting postgres:13 within our CircleCI pipelines. We're able to hotfix it for the moment by setting the image to postgres:13-bullseye. The logs didn't tell us anything about the reason behind it. One service was crashing right away with exit code 2, and the other one timed out after 10 minutes.

@fallenreaper
Copy link

fallenreaper commented Jun 16, 2023

Confirmed with @Chaoste , I am trying to build AMD64 version of postgres:13. I tested with 13+ and bullseye/bookworm. Does not like the update command. I also updated my Docker for Desktop on my Mac to see if that fixed things, but it did not.

@ColinChartier
Copy link

Also running into this issue on ubuntu 18, docker 23.05-1. Dmesg says:

bash[6496]: segfault at 56473bc14000 ip 00007fb59281fb97 sp 00007fff8864a568 error 6 in libc.so.6[7fb5926f3000+155000]
[  676.608738] Code: 00 00 c5 7d e7 8f 20 20 00 00 c5 7d e7 97 40 20 00 00 c5 7d e7 9f 60 20 00 00 c5 7d e7 a7 00 30 00 00 c5 7d e7 af 20 30 00 00 <c5> 7d e7 b7 40 30 00 00 c5 7d e7 bf 60 30 00 00 48 83 ef 80 ff c9

so it's bash that's segfaulting before the process even hits postgres

@yosifkit
Copy link
Member

(basically the same comment as docker-library/redis#365 (comment) and docker-library/python#837 (comment))

Root cause: it is very likely Docker with libseccomp so a newer syscall used in Debian Bookworm packages/libs is being blocked.

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
  • one fix:
    • update libseccomp and docker on the host running the containers
  • one workaround:
    • switch to the *bullseye images (in the postgres images, these will continue to be maintained/updated until the respective PostgreSQL end of life or the next Debian release, Debian Trixie)

@DCCInterstellar
Copy link

I was referred from #1015 to this issue regarding an error involving around "pg_stat_tmp/global.stat": Permission Denied" error.

Is anyone having this issue? I've changed permissions multiple times for the file but it doesn't work unless I manually restart postgres14 then it works temporarily.

juagargi added a commit to netsec-ethz/scionlab that referenced this issue Aug 22, 2023
* Add management command to list users email.
* Accept email values in command line, send email.
* Workaround docker incompatibility issue with postgres:latest
See docker-library/postgres#1100
@tianon
Copy link
Member

tianon commented Dec 15, 2023

#1100 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants