Could not connect to target postmaster
See original GitHub issueHello,
Getting below error while trying to upgrade pg13 to pg14 using 2.1-p5 Image version.
postgres@pg-test-1:~$ env | grep -i PGVERSION PGVERSION=14
`postgres@pg-test-1:~$ python3 /scripts/inplace_upgrade.py 2 2022-05-26 05:01:04,688 inplace_upgrade INFO: No PostgreSQL configuration items changed, nothing to reload. 2022-05-26 05:01:04,732 inplace_upgrade INFO: establishing a new patroni connection to the postgres cluster 2022-05-26 05:01:04,799 inplace_upgrade INFO: Cluster pg-test is ready to be upgraded 2022-05-26 05:01:04,800 inplace_upgrade INFO: initdb config: [{‘locale’: ‘en_US.UTF-8’}, {‘encoding’: ‘UTF8’}, ‘data-checksums’] The files belonging to this database system will be owned by user “postgres”. This user must also own the server process.
The database cluster will be initialized with locale “en_US.UTF-8”. The default text search configuration will be set to “english”.
Data page checksums are enabled.
creating directory /home/postgres/pgdata/pgroot/data_new … ok creating subdirectories … ok selecting dynamic shared memory implementation … posix selecting default max_connections … 100 selecting default shared_buffers … 128MB selecting default time zone … Etc/UTC creating configuration files … ok running bootstrap script … ok performing post-bootstrap initialization … ok syncing data to disk … ok
initdb: warning: enabling “trust” authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or –auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
/usr/lib/postgresql/14/bin/pg_ctl -D /home/postgres/pgdata/pgroot/data_new -l logfile start
2022-05-26 05:01:06,067 inplace_upgrade INFO: Dropping extensions from the cluster which could be incompatible 2022-05-26 05:01:06,073 inplace_upgrade INFO: Executing “DROP EXTENSION IF EXISTS amcheck_next” in the database=“postgres” 2022-05-26 05:01:06,079 inplace_upgrade INFO: Executing “DROP EXTENSION IF EXISTS amcheck_next” in the database=“demosession” 2022-05-26 05:01:06,085 inplace_upgrade INFO: Executing “DROP EXTENSION IF EXISTS amcheck_next” in the database=“template1” 2022-05-26 05:01:06,086 inplace_upgrade INFO: Executing pg_upgrade --check Performing Consistency Checks on Old Live Server
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 Checking for user-defined encoding conversions ok Checking for user-defined postfix operators ok
failure Consult the last few lines of “pg_upgrade_server.log” for the probable cause of the failure.
connection to server on socket “/home/postgres/pgdata/pgroot/data_upgrade/.s.PGSQL.50432” failed: No such file or directory Is the server running locally and accepting connections on that socket?
could not connect to target postmaster started with the command: “/usr/lib/postgresql/14/bin/pg_ctl” -w -l “pg_upgrade_server.log” -D “/home/postgres/pgdata/pgroot/data_new” -o “-p 50432 -b -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c vacuum_defer_cleanup_age=0 -c timescaledb.restoring=‘on’ -c listen_addresses=‘’ -c unix_socket_permissions=0700 -c unix_socket_directories=‘/home/postgres/pgdata/pgroot/data_upgrade’” start Failure, exiting 2022-05-26 05:01:06,803 inplace_upgrade ERROR: pg_upgrade --check failed, more details in the /home/postgres/pgdata/pgroot/data_upgrade`
shared_preload_libraries
shared_preload_libraries: pgaudit,bg_mon,pg_stat_statements,pgextwlist,pg_auth_mon,set_user,pg_cron,pg_stat_kcache
pg_upgrade_server.log
`
pg_upgrade run on Thu May 26 05:01:06 2022
command: “/usr/lib/postgresql/13/bin/pg_ctl” -w -l “pg_upgrade_server.log” -D “/home/postgres/pgdata/pgroot/data” -o “-p 50432 -c autovacuum=off -c autovacuum_freeze_max_age=2000000000 -c listen_addresses=‘’ -c unix_socket_permissions=0700” start >> “pg_upgrade_server.log” 2>&1 pg_ctl: another server might be running; trying to start server anyway waiting for server to start…2022-05-26 05:01:06 UTC [1730]: [1-1] 628f0992.6c2 0 FATAL: lock file “postmaster.pid” already exists 2022-05-26 05:01:06 UTC [1730]: [2-1] 628f0992.6c2 0 HINT: Is another postmaster (PID 76) running in data directory “/home/postgres/pgdata/pgroot/data”? stopped waiting pg_ctl: could not start server Examine the log output.
command: “/usr/lib/postgresql/14/bin/pg_ctl” -w -l “pg_upgrade_server.log” -D “/home/postgres/pgdata/pgroot/data_new” -o “-p 50432 -b -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c vacuum_defer_cleanup_age=0 -c timescaledb.restoring=‘on’ -c listen_addresses=‘’ -c unix_socket_permissions=0700 -c unix_socket_directories=‘/home/postgres/pgdata/pgroot/data_upgrade’” start >> “pg_upgrade_server.log” 2>&1 waiting for server to start…2022-05-26 05:01:06 UTC [1764]: [1-1] 628f0992.6e4 0 LOG: pgaudit extension initialized 2022-05-26 05:01:06 UTC [1764]: [2-1] 628f0992.6e4 0 LOG: Auto detecting pg_stat_kcache.linux_hz parameter… 2022-05-26 05:01:06 UTC [1764]: [3-1] 628f0992.6e4 0 LOG: pg_stat_kcache.linux_hz is set to 500000 2022-05-26 05:01:06 UTC [1764]: [4-1] 628f0992.6e4 0 LOG: redirecting log output to logging collector process 2022-05-26 05:01:06 UTC [1764]: [5-1] 628f0992.6e4 0 HINT: Future log output will appear in directory “…/pg_log”. stopped waiting pg_ctl: could not start server Examine the log output.`
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
It fails to start the new cluster (data_new). You have to figure out why. Details are in postgres logs (“…/pg_log”).
Changed
clientcert:verify-ca
inpg_hba.conf
is worked finehostssl all all all md5 clientcert=1
to
hostssl all all all md5 clientcert=verify-ca