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

Check if database user and databases exists before attempting to create them #26126

Closed
ypid opened this issue Sep 16, 2016 · 4 comments
Closed

Comments

@ypid
Copy link

ypid commented Sep 16, 2016

Steps to reproduce

Run the DebOps CI test suite using the versions as of 2016-09-14.
The test includes sudo cat /var/www/owncloud/data/owncloud.log.

ownCloud does not have permissions to create the database nor to create the user. Those things are prepared by debops.mariadb previous to occ maintenance:install.

Expected behaviour

No SQL errors in owncloud.log in case the database and db user already exist.

Actual behaviour

The following SQL errors in owncloud.log:

[

    {
      "reqId": "K513erzsU15KWTu6PjW2",
      "remoteAddr": "",
      "app": "mysql.setup",
      "message": "Specific user creation failed: An exception occurred while executing 'SELECT user FROM mysql.user WHERE user=?' with params [\"oc_admin-travis\"]:\n\nSQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'owncloud'@'localhost' for table 'user'",
      "level": 3,
      "time": "2016-09-14 22:00:41.901700",
      "method": "--",
      "url": "--",
      "user": "--"
    },
    {
      "reqId": "K513erzsU15KWTu6PjW2",
      "remoteAddr": "",
      "app": "mysql.setup",
      "message": "Database creation failed: An exception occurred while executing 'GRANT ALL PRIVILEGES ON `owncloud` . * TO 'owncloud'':\n\nSQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'owncloud'@'localhost' to database 'owncloud'",
      "level": 3,
      "time": "2016-09-14 22:00:41.902500",
      "method": "--",
      "url": "--",
      "user": "--"
    }
]

Server configuration

https://travis-ci.org/debops/ansible-owncloud/builds/160004834#L1

ownCloud version: 9.0.4 and tried it locally with 9.1.0.15 -> Same problem.

Updated from an older ownCloud or fresh install: The installation is as fresh as it can get 😉

Where did you install ownCloud from: deb packages

Client configuration

https://travis-ci.org/debops/ansible-owncloud/builds/160004834#L1

Refs

Related to: debops/ansible-owncloud#59

@DeepDiver1975
Copy link
Member

works as designed from my pov. Our intention in terms of easy and fault tolerant setup is to create a user for operations with owncloud only in case an admin user is used.

This is what we do from the very first day and I see no real need in changing this behavior.
Errors in the log can simply be ignored - there is no real issue.

@ypid
Copy link
Author

ypid commented Sep 16, 2016

Errors in the log can simply be ignored - there is no real issue.

How would a user know when to ignore the log entires which say that something "failed"? Sure, me as the one who maintained the Ansible config management code I know how my database server is configured but I am sure this error will continue to raise suspicion as it did recently for a thoughtful tester of the Ansible role.

Why not try to avoid false errors in the log?

@ypid
Copy link
Author

ypid commented Sep 16, 2016

Our intention in terms of easy and fault tolerant setup is to create a user for operations with owncloud only in case an admin user is used.

I don’t have a problem with that. Just with the false error messages when the db and user already exist and ownCloud has no permissions to change that.

@lock
Copy link

lock bot commented Aug 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants