server icon indicating copy to clipboard operation
server copied to clipboard

occ maintenance:install fails when Postgres is socket-only

Open monochromec opened this issue 6 years ago • 4 comments

Steps to reproduce

  1. Prepare s/w per Linux installations instructions with Postgres using a local socket only (port access is disabled)
  2. Try to install NC using sudo -u www-data php occ maintenance:install --database=pgsql --database-name=... --database-user=... --database-pass=... --admin-user=... --admin-pass=... --database- host='localhost:/run/postgresql/.s.PGSQL.5432'
  3. Error message: SQLSTATE[08006] [7] could not connect to server: Connection refused
  4. --database-host points to PG socket directory, pg_hba.conf is set up correctly as psql connection works with same credentials 5: If port access is enabled on 5432, occ installation works.

Expected behaviour

Tell us what should happen Nextcloud should install w/o error

Actual behaviour

Tell us what happens instead

Server configuration

Operating system: Debian Buster on amd64 Web server: Apache 2.4.38

Database: PostgreSQL 11.7 PHP version: 7.3 Nextcloud version: (see Nextcloud admin page) 19 Updated from an older Nextcloud/ownCloud or fresh install: Fresh install Where did you install Nextcloud from: zip archive

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/... No Are you using encryption: yes/no HTTPS Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... No

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

monochromec avatar Jul 03 '20 16:07 monochromec

Hi,

I'm using unix socket and postgres and my configuration in config.php is just

'dbhost' => '/var/run/postgresql', 'dbport' => '',

so i guess you should remove '.s.PGSQL.5432'

hope that helps ;)

Walterfilms avatar Jul 15 '20 21:07 Walterfilms

To add to this, also remove 'localhost:' in --database-host on the command line. Just keeping the path to the postgresql socket directory works.

gauravjuvekar avatar May 31 '21 09:05 gauravjuvekar

Thank you for taking the time to report a bug! 👍

As this seems to be a setup issue I would like to ask you to raise your question in the forums: https://help.nextcloud.com If you wish support with setup issues from Nextcloud GmbH we offer this as part of the Nextcloud subscription. Learn more about this at https://nextcloud.com/enterprise/

szaimen avatar Jul 06 '21 16:07 szaimen

I had the same issue, needed to set '/run/postgresql' as dbhost to fix

JensTimmerman avatar Aug 27 '21 20:08 JensTimmerman