Can't Install Nextcloud - pgsql CONNECT privilege

Hello all–

I’m trying to install the latest Nextcloud on Debian Stretch with postgresql and nginx. I installed all of the required dependencies, however I keep getting this error when trying to create the admin account:

Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[08006] [7] FATAL: permission denied for database “nextcloud”
DETAIL: User does not have CONNECT privilege.

I have no problems logging into phpPgAdmin with this user. I also altered my pg_ha.conf by adding this line:

local all all trust

I also tried to execute this as the postgres user in the psql console

GRANT ALL PRIVILEGES ON DATABASE nextcloud TO nuser;

… all to no avail.

I have no idea what more I could try. I’d very much appreciate any sort of guidance.

I fought with issue like yours for two days strait. And I found cause in my case. I created database manually. But installer script doesn’t like that and fails to assign proper privileges for user is creates in database.
After I dropped database allowing installer to create it its way setup was completed successfully. I strongly feel that all nuances like this should be mentioned in manual.

4 Likes

@sergey_a You are totally right about manual! I spent a day for it! Thank you, man, for the answer!

Worked for me - thanks a lot!

IF fixed, please report this bug to github as it is devell related and close thread, thanks.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.