borgbackupserver icon indicating copy to clipboard operation
borgbackupserver copied to clipboard

pg_dump version mismatch

Open Nodonn89 opened this issue 2 months ago • 3 comments

Description

Tried to execute a database backup with PostgreSQL 18 as database server. But pg_dump stopped because of a mismatch of the versions. Looks like the included pd_dump version in the bbs agent is 17.

Following error message was thrown: Backup completed, but 1 plugin(s) failed: pg_dump (Paperless Database) failed: pg_dump failed for paperless: pg_dump: error: aborting because of server version mismatch pg_dump: detail: server version: 18.6 (Debian 18.6-1.pgdg13+2); pg_dump version: 17.11 (Debian 17.11-0+deb13u1)

Steps to Reproduce

Install PostgreSQL 18. Setup Backup plan with plugin for database PostgreSQL dump. Run backup plan.

Used application: Paperless-ngx:latest Installation type: Docker (Paperless and BBS)

Installation Type

Docker

BBS Version

v2.91.3

Agent Version (if applicable)

v2.90.0

Agent OS (if applicable)

Ubuntu / Debian

Relevant Logs

Backup completed, but 1 plugin(s) failed: pg_dump (Paperless Database) failed: pg_dump failed for paperless: pg_dump: error: aborting because of server version mismatch
pg_dump: detail: server version: 18.6 (Debian 18.6-1.pgdg13+2); pg_dump version: 17.11 (Debian 17.11-0+deb13u1)

Nodonn89 avatar Sep 12 '26 17:09 Nodonn89

Fixed on main, in the next release. Two parts:

  • The agent now asks the server its version and uses the matching pg_dump when one is installed (/usr/lib/postgresql/<major>/bin on Debian and Ubuntu, /usr/pgsql-<major>/bin on RHEL, the Homebrew and EDB layouts on macOS), falling back to pg_dump on PATH. A mismatch error now says which client package to install.
  • The agent Docker image installs clients 16, 17 and 18 from the PostgreSQL apt repository instead of Debian's single version, so a PostgreSQL 18 server dumps with pg_dump 18. That lands with the next agent image build.

For a bare-metal agent the same rule applies: install postgresql-client-18 from the PostgreSQL apt repository beside the existing one and the agent picks it up. Thanks for the report.

marcpope avatar Sep 13 '26 02:09 marcpope

Thank you. Very nice for this quick response.

But does this mean, that PostgreSQL14 will not be able to be backup now with the new bbs-release? At the moment, I backup successfully immich with PostgreSQL14, which is still the official recommended version.

Nodonn89 avatar Sep 13 '26 07:09 Nodonn89

@marcpope: I see in the dockerfile of the Agent that really only postgresql-client-16 postgresql-client-17 postgresql-client-18 \ are installed/added. I would requests to add also v14 and v15, because they are still supported. V13 and older have reached their eol.

Nodonn89 avatar Sep 13 '26 08:09 Nodonn89