Closed s4ke closed 2 years ago
These are the logs from the log/ dir:
2022-03-25 17:20:08.612 UTC [17941] LOG: starting PostgreSQL 14.2 (Ubuntu 14.2-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
2022-03-25 17:20:08.612 UTC [17941] LOG: could not bind IPv4 address "0.0.0.0": Address already in use
2022-03-25 17:20:08.612 UTC [17941] HINT: Is another postmaster already running on port 5433? If not, wait a few seconds and retry.
2022-03-25 17:20:08.612 UTC [17941] LOG: listening on IPv6 address "::", port 5433
2022-03-25 17:20:08.618 UTC [17941] FATAL: lock file "/var/run/postgresql/.s.PGSQL.5433.lock" already exists
2022-03-25 17:20:08.618 UTC [17941] HINT: Is another postmaster (PID 17083) using socket file "/var/run/postgresql/.s.PGSQL.5433"?
2022-03-25 17:20:08.619 UTC [17941] LOG: database system is shut down
2022-03-25 17:20:18.259 UTC [17944] LOG: starting PostgreSQL 14.2 (Ubuntu 14.2-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
2022-03-25 17:20:18.260 UTC [17944] LOG: could not bind IPv4 address "0.0.0.0": Address already in use
2022-03-25 17:20:18.260 UTC [17944] HINT: Is another postmaster already running on port 5433? If not, wait a few seconds and retry.
2022-03-25 17:20:18.260 UTC [17944] LOG: listening on IPv6 address "::", port 5433
2022-03-25 17:20:18.267 UTC [17944] FATAL: lock file "/var/run/postgresql/.s.PGSQL.5433.lock" already exists
2022-03-25 17:20:18.267 UTC [17944] HINT: Is another postmaster (PID 17083) using socket file "/var/run/postgresql/.s.PGSQL.5433"?
2022-03-25 17:20:18.268 UTC [17944] LOG: database system is shut down
2022-03-25 17:20:28.257 UTC [17951] LOG: starting PostgreSQL 14.2 (Ubuntu 14.2-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
2022-03-25 17:20:28.257 UTC [17951] LOG: could not bind IPv4 address "0.0.0.0": Address already in use
2022-03-25 17:20:28.257 UTC [17951] HINT: Is another postmaster already running on port 5433? If not, wait a few seconds and retry.
2022-03-25 17:20:28.257 UTC [17951] LOG: listening on IPv6 address "::", port 5433
2022-03-25 17:20:28.262 UTC [17951] FATAL: lock file "/var/run/postgresql/.s.PGSQL.5433.lock" already exists
2022-03-25 17:20:28.262 UTC [17951] HINT: Is another postmaster (PID 17083) using socket file "/var/run/postgresql/.s.PGSQL.5433"?
2022-03-25 17:20:28.263 UTC [17951] LOG: database system is shut down
2022-03-25 17:20:38.273 UTC [17958] LOG: starting PostgreSQL 14.2 (Ubuntu 14.2-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
2022-03-25 17:20:38.273 UTC [17958] LOG: could not bind IPv4 address "0.0.0.0": Address already in use
2022-03-25 17:20:38.273 UTC [17958] HINT: Is another postmaster already running on port 5433? If not, wait a few seconds and retry.
2022-03-25 17:20:38.273 UTC [17958] LOG: listening on IPv6 address "::", port 5433
2022-03-25 17:20:38.279 UTC [17958] FATAL: lock file "/var/run/postgresql/.s.PGSQL.5433.lock" already exists
2022-03-25 17:20:38.279 UTC [17958] HINT: Is another postmaster (PID 17083) using socket file "/var/run/postgresql/.s.PGSQL.5433"?
2022-03-25 17:20:38.280 UTC [17958] LOG: database system is shut down
2022-03-25 17:20:48.514 UTC [17963] LOG: starting PostgreSQL 14.2 (Ubuntu 14.2-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
2022-03-25 17:20:48.514 UTC [17963] LOG: could not bind IPv4 address "0.0.0.0": Address already in use
2022-03-25 17:20:48.514 UTC [17963] HINT: Is another postmaster already running on port 5433? If not, wait a few seconds and retry.
2022-03-25 17:20:48.514 UTC [17963] LOG: listening on IPv6 address "::", port 5433
2022-03-25 17:20:48.520 UTC [17963] FATAL: lock file "/var/run/postgresql/.s.PGSQL.5433.lock" already exists
2022-03-25 17:20:48.520 UTC [17963] HINT: Is another postmaster (PID 17083) using socket file "/var/run/postgresql/.s.PGSQL.5433"?
2022-03-25 17:20:48.521 UTC [17963] LOG: database system is shut down
2022-03-25 17:20:58.313 UTC [17966] LOG: starting PostgreSQL 14.2 (Ubuntu 14.2-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
2022-03-25 17:20:58.313 UTC [17966] LOG: could not bind IPv4 address "0.0.0.0": Address already in use
2022-03-25 17:20:58.313 UTC [17966] HINT: Is another postmaster already running on port 5433? If not, wait a few seconds and retry.
2022-03-25 17:20:58.313 UTC [17966] LOG: listening on IPv6 address "::", port 5433
2022-03-25 17:20:58.318 UTC [17966] FATAL: lock file "/var/run/postgresql/.s.PGSQL.5433.lock" already exists
2022-03-25 17:20:58.318 UTC [17966] HINT: Is another postmaster (PID 17083) using socket file "/var/run/postgresql/.s.PGSQL.5433"?
2022-03-25 17:20:58.319 UTC [17966] LOG: database system is shut down
closing this as it seems unrelated
issue was caused by postgres 10 somehow being initialized and running:
Ah, this seems to be caused by installing pg-auto-failover-cli-1.6 before installing postgresql-14-auto-failover-1.6
On Ubuntu 18.04 this automatically pulls in:
Is this correct?
postgresql-12-auto-failover-1.6 is fine:
same goes for postgresql-13-auto-failover-1.6:
If it helps, this was from a Ubuntu 20.04 machine which had a related error:
There we had to reorder the installation so that the cli got installed first, but there was no postgres-10 pulled in:
Hi @s4ke ; thanks for diving into the issue that deep. It looks like a debian package dependency issue. Are you using the package from Citus or the package from apt.postgresql.org? The latter is maintained at https://github.com/dimitri/pgaf_debian and PRs are welcome of course!
Is it possible that the trouble is from Ubuntu installing the Recommends
packages automatically?
Got this from a similar host, but essentially we are using the file from https://install.citusdata.com/community/deb.sh to configure the apt packages after also setting up the postgres package repo.
500 https://repos.citusdata.com/community/ubuntu bionic/main amd64 Packages
release v=1,o=packagecloud.io/citusdata/community,a=bionic,n=bionic,l=community,c=main,b=amd64
origin repos.citusdata.com
500 http://apt.postgresql.org/pub/repos/apt bionic-pgdg/main amd64 Packages
release o=apt.postgresql.org,a=bionic-pgdg,n=bionic-pgdg,l=PostgreSQL for Debian/Ubuntu repository,c=main,b=amd64
origin apt.postgresql.org
Additionally, we are using these policies:
When trying tests for our ansible scripts we stumbled across this failure:
We are running on a non standard port (5433).
It seems as if the first try to start postgres is marked as failed and then we try again, but then the try that was marked as failed is up and running and all subsequent tries fail again.