Skip to content

Docker PostgreSQL 17: Snapshot restoration is broken #1994

@tedbear2012

Description

@tedbear2012

OS
docker -v
Docker version 28.1.1, build 4eba377

Windows 10 IoT Enterprise LTSC 21H2 19044.6093 and WSL2

Versions
The db-sync version: 13.6.0.5 (ghcr.io/intersectmbo/cardano-db-sync:13.6.0.5)
PostgreSQL version: postgres: 17.2-alpine

Build/Install Method
The method you use to build or install cardano-db-sync: docker

Run method

  1. run postgres in docker container:
docker run -d \
  --restart unless-stopped \
  --name wwt-cardano-node-postgres \
  --network shared-network \
  --expose 5432 \
  -p 5432:5432 \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=<POSTGRES_PASSWORD> \
  -e POSTGRES_DB=cexplorer \
  -e POSTGRES_HOST_AUTH_METHOD=trust \
  -v wwt-ada-postgres-data:/var/lib/postgresql/data \
  postgres:17.2-alpine
  1. get new snapshot db-sync-snapshot-schema-13.6-block-12228199-x86_64.tgz (git bash)
aria2c -s 4 \
--max-overall-upload-limit=5M \
-x 4 \
--max-connection-per-server=4 \
--save-session=session.txt \
--retry-wait=30 \
https://update-cardano-mainnet.iohk.io/cardano-db-sync/13.6/db-sync-snapshot-schema-13.6-block-12228199-x86_64.tgz
  1. run command for restoring snapshot:
docker run `
  --name wwt-cardano-db-sync `
  --network shared-network `
  --env NETWORK=mainnet `
  --env POSTGRES_DB=cexplorer `
  --env POSTGRES_HOST=wwt-cardano-node-postgres `
  --env POSTGRES_USER=postgres `
  --env POSTGRES_PASSWORD=<POSTGRES_PASSWORD> `
  --env POSTGRES_PORT=5432 `
  --env RESTORE_RECREATE_DB=N `
  --env RESTORE_SNAPSHOT=/data/db-sync-snapshot-schema-13.6-block-12228199-x86_64.tgz `
  --volume wwt-ada-db-sync-data-cexplorer:/var/lib/cexplorer `
  --volume C:/shared/wwt-cardano:/data `
  --volume "$(pwd)/node-ipc:/node-ipc" `
  ghcr.io/intersectmbo/cardano-db-sync:13.6.0.5

Problem Report
VARIANT1)
If env parameter RESTORE_RECREATE_DB=N, i get Error (logs from docker container wwt-cardano-db-sync):

db/4277.dat.gz
db/4281.dat.gz
163036784-386a4b593a-574.lstate.gz
pg_restore: error: could not execute query: ERROR:  type "addr29type" already exists
Command was: CREATE DOMAIN public.addr29type AS bytea;

logs from postgres docker container:

UTC [1331] ERROR:  type "addr29type" already exists
UTC [1331] STATEMENT:  CREATE DOMAIN public.addr29type AS bytea;

VARIANT2)
If env parameter RESTORE_RECREATE_DB=Y, i get Error (logs from docker container wwt-cardano-db-sync):

ERROR:  cannot drop objects owned by role postgres because they are required by the database system

logs from postgres docker container:

UTC [1360] ERROR:  cannot drop objects owned by role postgres because they are required by the database system

UTC [1360] STATEMENT:  DROP OWNED BY CURRENT_USER cascade;

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions