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

Allow nextcloud to create the postgres db #784

Merged
merged 1 commit into from
Jul 5, 2019

Conversation

tilosp
Copy link
Member

@tilosp tilosp commented Jun 26, 2019

Fixes #345
Closes #516

Signed-off-by: Tilo Spannagel <development@tilosp.de>
@tilosp tilosp added bug examples Compose/Dockerfile/etc labels Jun 26, 2019
@tilosp tilosp requested review from J0WI and SnowMB June 26, 2019 11:09
@tilosp
Copy link
Member Author

tilosp commented Jun 26, 2019

Let's wait a few days for nextcloud/server#15187 and nextcloud/server#16064.

sure let's wait for the rc

postgres has superuser privileges. NextCloud should use the oc_ prefixed user:

It already does so with this pr, nextcloud automatically creates a user oc_test.

@J0WI J0WI merged commit 4df6f79 into master Jul 5, 2019
@delete-merged-branch delete-merged-branch bot deleted the allow-nextcloud-create-the-db branch July 5, 2019 11:50
@lukasmrtvy
Copy link

lukasmrtvy commented Aug 3, 2019

What should be fixed?

docker run -d \
--name nextcloud-postgres \
--network nexcloud-network \
--restart=unless-stopped \
-e POSTGRES_DB=nextcloud \
-e POSTGRES_PASSWORD=nextcloud \
-e POSTGRES_USER=nextcloud \
-e TZ=Europe/Prague \
postgres:11-alpine


docker run -d \
--name nextcloud \
--network nexcloud-network \
--restart=unless-stopped \
-e POSTGRES_DB=nextcloud \
-e POSTGRES_HOST=nextcloud-postgres \
-e POSTGRES_PASSWORD=nextcloud \
-e POSTGRES_USER=nextcloud \
-e NEXTCLOUD_ADMIN_PASSWORD=admin \
-e NEXTCLOUD_ADMIN_USER=admin \
-e NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.example.com \
nextcloud:16.0.3-apache 

Nextcloud log:

retrying install...
Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[08006] [7] FATAL:  permission denied for database "nextcloud"
DETAIL:  User does not have CONNECT privilege.
 -> 
retrying install...
Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[08006] [7] FATAL:  permission denied for database "nextcloud"
DETAIL:  User does not have CONNECT privilege.
 -> 
retrying install...
Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[08006] [7] FATAL:  permission denied for database "nextcloud"
DETAIL:  User does not have CONNECT privilege.
 -> 
installing of nextcloud failed!

Its not possible to use POSTGRES_USER other than postgres ?

EDIT: Nvm,
maybe there is problem not with #784, but nextcloud/server#15187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug examples Compose/Dockerfile/etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to connect to Postgres with docker-compose
3 participants