borgbackupserver icon indicating copy to clipboard operation
borgbackupserver copied to clipboard

PostgreSQL backup stopped working after updating to v2.63.0

Open theborg72 opened this issue 4 months ago • 2 comments

Description

Failed to list databases: psql: error: connection to server at "192.168.1.41", port 5432 failed: FATAL: database "dbuserName" does not exist

reverting to the previous version solved the problem v2.62.0

Backup failed: job #1589 — Pre-backup plugin failed: Failed to list databases: psql: error: connection to server at "192.168.1.41", port 5432 failed: FATAL: database "dbuserName" does not exist

dbuserName is the user not database

It seems like it sees the login name as a database and then the login doesn't work. Going back a version and it works fine but going to the latest then I get the error

Steps to Reproduce

Update

Installation Type

Docker

BBS Version

2.63.0

Agent Version (if applicable)

2.63.0

Agent OS (if applicable)

Ubuntu / Debian

Relevant Logs


theborg72 avatar Jul 13 '26 18:07 theborg72

v2.62.0

Manual backup triggered for plan "PostgreSQL-BK" (job #1601) Jul 13 7:50:00 PM Backup command: 'borg' 'create' '--json' '--log-json' '--list' '--progress' '--lock-wait=600' '--compression=lz4' '--exclude-caches' '--noatime' '--exclude' '.tmp' '--exclude' '.cache' '--exclude' 'Thumbs.db' '--exclude' '.DS_Store' 'ssh://[email protected]///var/bbs/stw05/4/STW05::plan8-2026-07-13_17-50-01' '/home/thomas' '/home/bbs/pgdump' Jul 13 7:50:01 PM Plugins: pg_dump Jul 13 7:50:01 PM Job #1601 (backup) sent to agent queue Jul 13 7:50:01 PM Agent started backup job #1601 for plan "PostgreSQL-BK" Jul 13 7:50:17 PM PostgreSQL dump: 5 database(s) (davinci, joplindb, maillog, plankan2025, sso) dumped to /home/bbs/pgdump (226.0 MB) Jul 13 7:50:40 PM Backup completed: job #1601, 11 files, 32s Jul 13 7:50:49 PM Archive created: "plan8-2026-07-13_17-50-17" — 226 MB original, 226 MB deduplicated Jul 13 7:50:49 PM Repository stats updated for job #1601 Jul 13 7:50:49 PM Importing file catalog (1.3 KB)... Jul 13 7:50:49 PM Catalog TSV generated: 13 rows, 0 MB in 0s — loading into ClickHouse Jul 13 7:50:49 PM Catalog ClickHouse load complete: 0.1s Jul 13 7:50:49 PM Catalog dirs index: 4 directories indexed Jul 13 7:50:50 PM File catalog imported: 13 entries in 0.9s Jul 13 7:50:50 PM

theborg72 avatar Jul 13 '26 18:07 theborg72

Thanks for the sharp report — your diagnosis was exactly right. The v2.63.0 change that switched database enumeration from parsing psql -l to a catalog query dropped the implicit database connection that -l provided: without a database name, psql uses the username as the dbname, which fails for a dedicated backup user like yours (it worked in our testing only because we tested as the postgres superuser, whose name matches a real database). Fixed by connecting to the postgres maintenance database explicitly — the same database psql -l always used, so no new permission requirements. Verified against PostgreSQL 17 with a dedicated backup role. Will ship in a point release shortly; staying on v2.62.0 until then is the right call.

marcpope avatar Jul 15 '26 18:07 marcpope