Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"could not create any Unix-domain sockets" #83

Open
pat-s opened this issue Nov 17, 2023 · 2 comments
Open

"could not create any Unix-domain sockets" #83

pat-s opened this issue Nov 17, 2023 · 2 comments

Comments

@pat-s
Copy link

pat-s commented Nov 17, 2023

I am trying to update a PG-HA deployed via bitnami in k8s. I have extracted the data as usual. The call looks like

docker run -it -v /tmp/pg-15-16/:/var/lib/postgresql/ tianon/postgres-upgrade:15-to-16 --link

Due to how bitnami creates their structure, I also had to apply the following first:

echo "host all all all md5" > /tmp/pg-15-16/15/data/pg_hba.conf
touch /tmp/pg-15-16/15/data/postgresql.conf

So, so good.
However, it fails and inspecting the logs shows:

-----------------------------------------------------------------
  pg_upgrade run on Fri Nov 17 15:56:43 2023
-----------------------------------------------------------------

command: "/usr/lib/postgresql/15/bin/pg_ctl" -w -l "/var/lib/postgresql/16/data/pg_upgrade_output.d/20231117T155643.248/log/pg_upgrade_server.log" -D "/var/lib/postgresql/15/data" -o "-p 50432 -b  -c listen_addresses='' -c unix_socket_permissions=0700 -c unix_socket_directories='/var/lib/postgresql'" start >> "/var/lib/postgresql/16/data/pg_upgrade_output.d/20231117T155643.248/log/pg_upgrade_server.log" 2>&1
waiting for server to start....2023-11-17 15:56:43.404 GMT [106] LOG:  starting PostgreSQL 15.4 (Debian 15.4-2.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2023-11-17 15:56:43.405 GMT [106] LOG:  could not set permissions of file "/var/lib/postgresql/.s.PGSQL.50432": Invalid argument
2023-11-17 15:56:43.405 GMT [106] WARNING:  could not create Unix-domain socket in directory "/var/lib/postgresql"
2023-11-17 15:56:43.406 GMT [106] FATAL:  could not create any Unix-domain sockets
2023-11-17 15:56:43.408 GMT [106] LOG:  database system is shut down
 stopped waiting
pg_ctl: could not start server
Examine the log output.

I can't wrap my head around what's going on. Checked permissions (all owned by postgres), checked no leftovers of other sockets in the data dirs. (NB: using my own arm64 image but also checked with the official tianon image). Any ideas or pointers are welcome!

(Q: Does it make a difference if the data got extracted from a PG-HA instance? It looks identical to a non-HA one on the first look.)

@yosifkit
Copy link
Collaborator

Seeing arm64, are you running this on a Mac? I would bet that the filesystem share from macOS to the Docker Desktop VM doesn't support the file type of a Unix socket. Maybe change the config to put the sockets elsewhere in the container like /var/run/postgresql/?

@genslein
Copy link

genslein commented Feb 23, 2024

@yosifkit is correct. The new chipsets require that:

docker run --rm \
	-v DIR:/var/lib/postgresql \
	tianon/postgres-upgrade:12-to-15 \
	-c '--socketdir=/var/run/postgresql' \
	--link

I can confirm works. @tianon can you maybe add a little blurb in the README? This should also be fine for alternate chipset distributions that have a hard time with unix socket files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants