Skip to content

fix(docker): install PostgreSQL 18 client so dbbackup works#15306

Merged
Maffooch merged 1 commit into
DefectDojo:bugfixfrom
valentijnscholten:bugfix-dbbackup-pg18-client
Jul 23, 2026
Merged

fix(docker): install PostgreSQL 18 client so dbbackup works#15306
Maffooch merged 1 commit into
DefectDojo:bugfixfrom
valentijnscholten:bugfix-dbbackup-pg18-client

Conversation

@valentijnscholten

Copy link
Copy Markdown
Member

Summary

  • Fixes The dbbackup funktion in the manage.py script is not working because of server version mismatch #15301: ./manage.py dbbackup fails with pg_dump: error: aborting because of server version mismatch because the PostgreSQL client tools in the images are older than the bundled PostgreSQL 18 server, and pg_dump refuses to dump a server newer than itself.
  • The server was bumped to 18.x, but the client tooling was never bumped to match: the Debian image shipped v17 (generic postgresql-client on trixie), and the Alpine/nginx images shipped v16 (postgresql16-client).
  • Alpine (Dockerfile.django-alpine, Dockerfile.nginx-alpine): bump the base image to alpine3.23 and install postgresql18-client. The v18 client is not available in the alpine3.22 package repos, so the base bump is required. The nginx build-stage base is kept identical to the django build stage to preserve Docker layer caching.
  • Debian (Dockerfile.django-debian): Debian trixie only ships postgresql-client-17, so add the PostgreSQL APT (PGDG) repository and install postgresql-client-18 in the release stage.
  • Keeps the PostgreSQL server at 18 (no data-directory migration for existing deployments); only the client tooling is aligned upward.

The bundled PostgreSQL server is 18.x, but the client tools shipped in
the images lagged behind (Debian: 17, Alpine/nginx: 16). pg_dump refuses
to dump a server newer than itself, so `manage.py dbbackup` failed with
"aborting because of server version mismatch".

Align the client to the server (v18):
- Alpine images: bump base to alpine3.23 and use postgresql18-client
  (18 is not available in the alpine3.22 repos).
- Debian image: add the PostgreSQL APT (PGDG) repository and install
  postgresql-client-18 (Debian trixie only ships v17).

Fixes DefectDojo#15301
@valentijnscholten valentijnscholten added this to the 3.1.300 milestone Jul 21, 2026
@valentijnscholten
valentijnscholten marked this pull request as ready for review July 21, 2026 18:36
@Maffooch
Maffooch merged commit 663a7ca into DefectDojo:bugfix Jul 23, 2026
147 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The dbbackup funktion in the manage.py script is not working because of server version mismatch

3 participants