pgcopydb icon indicating copy to clipboard operation
pgcopydb copied to clipboard

Failed to parse Archive TOC

Open prasadchavan487 opened this issue 1 year ago • 1 comments

We are working on POC to migrate PostgreSQL version 10.23 to PostgreSQL version 15 using pgcopydb 0.15. (Online)

We are getting below issue

Error:

11:33:57.002 101150 INFO   STEP 3: restore the pre-data section to the target database
11:33:57.019 101150 ERROR  Failed to parse Archive TOC: 2259; 1262 16504 DATABASE - demo2 ************
11:33:57.019 101150 ERROR  Failed to parse line 15 of "/tmp/pgcopydb/schema/pre-out.list", see above for details
11:33:57.019 101150 ERROR  Failed to prepare the pg_restore --use-list catalogs, see above for details
11:33:57.019 101150 ERROR  Failed to prepare schema on the target database, see above for details
11:33:57.019 101150 ERROR  Failed to clone source database, see above for details
11:33:57.116 101146 ERROR  clone process 101150 has terminated [6]
11:33:57.266 101146 WARN   Failed to clone the source database, see above for details
11:33:57.266 101146 FATAL  Terminating all processes in our process group

Output for pg_restore --list

;
; Archive created at 2024-04-29 11:33:56 UTC
;     dbname: demo2
;     TOC Entries: 16
;     Compression: -1
;     Dump Version: 1.13-0
;     Format: CUSTOM
;     Integer: 4 bytes
;     Offset: 8 bytes
;     Dumped from database version: 10.23
;     Dumped by pg_dump version: 10.23
;
;
; Selected TOC Entries:
;
2259; 1262 16504 DATABASE - demo2 sqltestuser
7; 2615 16529 SCHEMA - fms_migration_data sqltestuser
3; 2615 2200 SCHEMA - public postgres
2260; 0 0 COMMENT - SCHEMA public postgres
1; 3079 12333 EXTENSION - plpgsql
2261; 0 0 COMMENT - EXTENSION plpgsql
214; 1259 16530 TABLE fms_migration_data synthetic_transaction_table sqltestuser
211; 1259 16511 TABLE public pgbench_accounts sqltestuser
212; 1259 16514 TABLE public pgbench_branches sqltestuser
209; 1259 16505 TABLE public pgbench_history sqltestuser
210; 1259 16508 TABLE public pgbench_tellers sqltestuser
213; 1259 16524 TABLE public rep_test sqltestuser
215; 1259 16824 TABLE public transactions sqltestuser

prasadchavan487 avatar Apr 29 '24 13:04 prasadchavan487

demo2.dump.zip

PFA.. Schema dump for demo2 database

prasadchavan487 avatar Apr 30 '24 10:04 prasadchavan487

The provided dump is not useful, because it does not contain the DATABASE entry and the dump is in the SQL format rather than the pg_dump custom format. Also, I failed to reproduce the situation: what Postgres version are you using for pg_dump and pg_restore? Can you share the exact command that was used to generate a dump with the DATABASE item in it?

Meanwhile I think it's easy enough to come-up with the parsing support and also always comment-out the item, see attached PR.

dimitri avatar May 21 '24 13:05 dimitri