Fresh install : data directory "/shared/postgres_data" has wrong ownership

Hi,
On a fresh (standard) install, we get these logs :

2024-10-08 13:55:06.819 UTC [37] FATAL:  data directory "/shared/postgres_data" has wrong ownership
2024-10-08 13:55:06.819 UTC [37] HINT:  The server must be started by the user that owns the data directory.
I, [2024-10-08T13:55:11.815631 #1]  INFO -- : > /usr/local/bin/create_db
createdb: error: could not connect to database template1: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?

I didn’t find any information on this other than PostgreSQL upgrade on an existing installation.

So you ran discourse-setup and when it did the initial rebuild you got that error?

What if you rm -rf /var/discourse/shared (which will delete all data, so don’t do this if you have any data that you dont’ want to lose!) and then do a ./launcher rebuild app

1 Like