tianon / docker-postgres-upgrade

a PoC for using "pg_upgrade" inside Docker -- learn from it, adapt it for your needs; don't expect it to work as-is!
https://hub.docker.com/r/tianon/postgres-upgrade/
MIT License
1.04k stars 114 forks source link

Failure, exiting. Can't find log. #38

Closed eriktelepovsky closed 2 years ago

eriktelepovsky commented 2 years ago

Hello. I am trying to use this image with the following arguments:

docker run --rm 
-e POSTGRES_INITDB_ARGS="--wal-segsize=1024"
-v /home/user/db/12/main:/var/lib/postgresql/12/data 
-v /home/user/db/13/main:/var/lib/postgresql/13/data 
tianon/postgres-upgrade:12-to-13

but it fails with this output:

Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
Checking database user is the install user                  ok
Checking database connection settings                       ok
Checking for prepared transactions                          ok
Checking for system-defined composite types in user tables  ok
Checking for reg* data types in user tables                 ok
Checking for contrib/isn with bigint-passing mismatch       ok
Creating dump of global objects                             ok
Creating dump of database schemas
  postgres
  my_database

*failure*

Consult the last few lines of "pg_upgrade_dump_116017.log" for
the probable cause of the failure.
Failure, exiting

Where can I found that logfile pg_upgrade_dump_116017.log please?

tess1o commented 2 years ago

you can mount a folder in your host to /var/lib/postgresql and then you'll see the log. Example: docker run --rm -e POSTGRES_INITDB_ARGS="--wal-segsize=1024" -v /home/user/db/12/main:/var/lib/postgresql/12/data -v /home/user/db/13/main:/var/lib/postgresql/13/data -v /home/user/:/var/lib/postgresql tianon/postgres-upgrade:12-to-13

DeoLeung commented 2 years ago

also u can do something like

# find out the hash of  the last run docker
docker ps -a | head
docker commit THE_HASH test1
docker run -it --rm --entrypoint=sh test1

# in the container
ls -l
cat pg_upgrade_dump_116017.log