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

Install fails if database user has no grant permission #13628

Closed
thomasheller opened this issue Jan 16, 2019 · 0 comments · Fixed by #14501 or #16408
Closed

Install fails if database user has no grant permission #13628

thomasheller opened this issue Jan 16, 2019 · 0 comments · Fixed by #14501 or #16408
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@thomasheller
Copy link

thomasheller commented Jan 16, 2019

Steps to reproduce

  1. Install Apache and MariaDB through apt
  2. Create database user:
create user 'next'@'localhost' identified by 'secret';
grant all privileges on *.* to 'next'@'localhost';
flush privileges;
  1. Create database:
create database next;
  1. Attempt to install Nextcloud in Web browser:

Username: [any]

Password: [any]

Data directory: [default]

Database user: next

Database password: secret

Database name: next

Database host: localhost:5432

Expected behaviour

Install should happen as normal, with the specified database user. Nextcloud should not attempt to add its own user if grant permission is missing.

Actual behaviour

Error message in Web browser:

Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1044] Access denied for user 'oc_next'@'localhost' to database 'next'

Subsequent error messages:

Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1044] Access denied for user 'oc_next1'@'localhost' to database 'next'

oc_next2 etc.

Server configuration

Operating system: Ubuntu 16.04.5 LTS

Web server: Apache/2.4.18

Database: mysql Ver 15.1 Distrib 10.0.36-MariaDB

PHP version: PHP 7.2.14

Nextcloud version: (see Nextcloud admin page) 53c077afc9077dcadcaf4b8ad62590fb549947b0

Updated from an older Nextcloud/ownCloud or fresh install: fresh install

Where did you install Nextcloud from: directly from GitHub repository

Details

This bug occurs because the database user created for Nextcloud has permission to create new users, but is not allowed to grant permissions.

If privileges are granted with grant option, the install proceeds as expected (Nextcloud adds its own user):

grant all privileges on *.* to 'next'@'localhost' with grant option;

The bug is also described by this user: https://help.nextcloud.com/t/mariadb-refuse-me-sqlstate-hy000-1044-access-denied-for-user-oc-sylvain-to-database-nextcloud/35677

@thomasheller thomasheller added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jan 16, 2019
thomasheller added a commit to thomasheller/server that referenced this issue Jan 16, 2019
…ud#13628

Signed-off-by: Thomas Heller <thomas.m.heller@gmail.com>
@MorrisJobke MorrisJobke mentioned this issue Mar 4, 2019
45 tasks
@MorrisJobke MorrisJobke mentioned this issue Mar 6, 2019
9 tasks
@MorrisJobke MorrisJobke mentioned this issue Jul 16, 2019
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
1 participant