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.08k stars 116 forks source link

Could not access file "timescaledb": No such file or directory #63

Closed Dzeri96 closed 2 years ago

Dzeri96 commented 2 years ago

I'm trying to run the 11-to-12 image in order to upgrade a db being run from docker-compose like so:

timescaledb:
  image: timescale/timescaledb:1.7.4-pg11
  volumes:
      - timescale_data:/var/lib/postgresql/data
  ports:
      - 5431:5432
  environment:
      POSTGRES_PASSWORD: REDACTED
      POSTGRES_DB: timescale
  networks:
      - default

Unfortunately, I'm getting the following error:

Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok

*failure*
Consult the last few lines of "pg_upgrade_server.log" for
the probable cause of the failure.

connection to database failed: connection to server on socket "/var/lib/postgresql/.s.PGSQL.50432" failed: No such file or directory
    Is the server running locally and accepting connections on that socket?

could not connect to source postmaster started with the command:
"/usr/lib/postgresql/11/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/var/lib/postgresql/11/data" -o "-p 50432 -b  -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/var/lib/postgresql'" start
Failure, exiting

Looking at pg_upgrade_server.log, I see these lines:

waiting for server to start....2022-09-09 14:37:25.959 UTC [82] FATAL:  could not access file "timescaledb": No such file or directory
2022-09-09 14:37:25.960 UTC [82] LOG:  database system is shut down
 stopped waiting
pg_ctl: could not start server

Any idea what's the cause and how to fix it?

Dzeri96 commented 2 years ago

Solved trough this issue. Turns out that if you have some plugins installed, you'll have to create a custom image with those plugins installed.

As a side-note, I really wish postgres' logging were better in this case. I had to run pg_ctl with -d 5 to get the highest log level possible and figure out that it's looking for a plugin.