Problems restoring TimescaleDB

I am trying to restore a sizeable dump file (100GB) from a TimeScaleDB (Postgres) database, but the restore appears to catastrophically fail after a few hours with the following error:

pg_restore: error: could not uncompress data: (null)

I have no idea why this is, and would like advice on possible causes/workarounds/solutions.

I naively assumed if I created an appropriate instance of a TimeScale/Postgres database and restored from the dump file, I’d restore the original database.

Accordingly, listing the dump file contents (running a "pg_restore -l ) yielded:

;     TOC Entries: 10710
;     Compression: 9
;     Dump Version: 1.14-0
;     Format: CUSTOM
;     Integer: 4 bytes
;     Offset: 8 bytes
;     Dumped from database version: 13.6 (Ubuntu 13.6-1.pgdg20.04+1)
;     Dumped by pg_dump version: 13.6 (Ubuntu 13.6-1.pgdg20.04+1)

I subsequently span up a docker container instance based on the “timescale/timescaledb:2.1.0-pg13” image, installed “postgresql-client-13” client tools, and then attempted a clean restore (-C option) using:

pg_restore -h localhost -p 5432 -U postgres -C -d postgres <path to my dump file>

After 5 or so hours (460GB into restore based on postgres data folder volume), I get the aforementioned error:

pg_restore: error: could not uncompress data: (null)

I have repeated this exercise by pre-creating an appropriately named template0 database, and skipping the -C restore option and specifying the correct target database instance name (-d option - as per instructions on TSDB documentation

Same result.

I’m clutching at straws trying to understand and resolve what is going on. I can’t rule out file corruption, but also can’t think why corruption may have happened (I’ve hash’d all copies of the file and they all match)

It would be nice to understand how far into the restore process it is progressing before it fails (in terms of % completion). Or the specific area of the dump file where it fails?

I’d appreciate any sage advice on what might be going wrong / potential workarounds.

Thanks in advance.

Hey @docf!

Tbh, I don’t think this is an issue specific to timescaledb. I normally dump the database using pg_dump (in binary form) and replay it with just psql directly. No need to use pg_backup and pg_restore.

For the actual problem, sorry no idea :frowning: