LMSouq
general-dev Open

pg_restore: [archiver] unsupported version (1.14) in file header

BE
Bernd Wechner
1 month ago
3 views
Problem Description
I have a live server and development box, call them live and dev respectively both running postgresql. I can see both and manage both with pgadmin4 without trouble, and both are fully functional the one being a live website and the other where I run my website in debug mode on the my dev box. Pretty ordinary setup. For years I have been running the same bash script I wrote that dumps the live database then restores it on the dev box so I have the latest live snapshot to work with. Today this fails me with the titled message: ``` pg_restore: [archiver] unsupported version (1.14) in file header ``` I have tried to diagnose this, and searched extensively on-line but am bedeviled and have failed so here I am cap in hand for expertise. To help I will share the following: ``` $ pg_dump --version pg_dump (PostgreSQL) 10.11 (Ubuntu 10.11-1.pgdg18.04+1) $ pg_restore --version pg_restore (PostgreSQL) 10.11 (Ubuntu 10.11-1.pgdg18.04+1) $ pg_dump --host=live.lan --port=5432 --dbname=mydb --username=myuser --format=custom > test.backup $ ls -l test.backup -rw-r--r-- 1 bernd bernd 2398358 Dec 23 23:40 test.backup $ file test.backup test.backup: PostgreSQL custom database dump - v1.14-0 $ pg_restore --dbname=mydb test.backup pg_restore: [archiver] unsupported version (1.14) in file header ``` Given pg_dump and pg_restore are identical versions and: ``` $ which pg_dump /usr/bin/pg_dump $ which pg_restore /usr/bin/pg_restore $ ls -l /usr/bin/pg_dump /usr/bin/pg_restore lrwxrwxrwx 1 root root 37 Nov 14 23:23 /usr/bin/pg_dump -> ../share/postgresql-common/pg_wrapper lrwxrwxrwx 1 root root 37 Nov 14 23:23 /usr/bin/pg_restore -> ../share/postgresql-common/pg_wrapper ``` I can see they are not just identical versions but are run by the same wrapper script (which happens to be a perl script - now that's a language you don't see much anymore and I used to code in extensively) So I'm left totally perplexed. Thinking there may be a version issue with the live machine: ``` $ ssh live.lan Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-72-generic x86_64) $ which pg_dump /usr/bin/pg_dump $ which pg_restore /usr/bin/pg_restore $ pg_dump --version pg_dump (PostgreSQL) 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) $ pg_restore --version pg_restore (PostgreSQL) 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) ``` I can see the live box does have slightly older version of pg_dump (which would only matter if pg_dump on my dev box somehow used a RPC to the live box to run its pg_dump). Now there is maybe a small clue in the fact that my dev box has seen a few postgresql upgrades come through and so for example: ``` $ pg_lsclusters Ver Cluster Port Status Owner Data directory Log file 10 main 5432 online postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log 11 main 5433 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.l...

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base