Open rbonnefoi opened 4 months ago
dbport
isn't a valid directive. The port gets specified as part of dbhost
:
Since UNIX sockets don't have a concept of a port, it's a little weird how PostgreSQL includes the TCP port number in a the UNIX socket file name. If you really are running multiple instances/sockets on the same host, maybe use a dedicated path for each one?
https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES
Thanks for answering so rapidly.
I still have two questions :
'dbport' => '',
which is confusing,'dbhost' => '/var/run/postgresql/.s.PGSQL.1234',
), I can't connect and I can see in the log that Nextcloud is trying to connect to /var/run/postgresql/.s.PGSQL.1234/.s.PGSQL.5432I thing this setup behaviour for socket is not coherent with the ip one, and prevents people from using a non standard port, which is not so unusual.
But I may miss something.
Anyway, thanks for the help, and any further information will be welcome.
Regards.
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
I used the web installer, and the config.php was automatically created, embedding a dbport directive (which is set to empty string) 'dbport' => '', which is confusing,
That's fair. It's a historic relic of the installer (well, there's more to it than that, but yes)..
in config.php set 'dbhost' to '/var/run/postgresql' (which is the debian root path of postgresql socket) and set 'dbport' to '1234' for instance
When I suggested a different path, when using multiple parallel db instances, I was saying that:
/var/run/postgres1
as the db host for the first instance; /var/run/postgres2
for the second, and so on
⚠️ This issue respects the following points: ⚠️
Bug description
Nextcloud doesn't take into account the port setup when constructing the full full postgresql socket path. It always uses 5432, whatever the dbport setup is in config.php. Thus it is not possible to connect through socket way when Postgresql is not running on the default 5432 port.
Steps to reproduce
Expected behavior
Normally, the connection socket should be /var/run/postgresql/.s.PSQL.1234, while it is stuck to /var/run/postgresql/s.PSQL.5432
I think a better way for setup would be to fill the full socket path into dbhost parameter (eg /var/run/postgresql/.s.PSQL.1234) rather than splitting the socket config, as the postgresql config could even use another schema and/or path for the socket full path (for instance in the case when several parallel sockets are used for isolation).
Installation method
Community Web installer on a VPS or web space
Nextcloud Server version
29
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response