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

[Bug] Installation can be continued with missing database privileges #22187

Closed
4 tasks done
textagroup opened this issue May 5, 2024 · 5 comments · Fixed by #22208
Closed
4 tasks done

[Bug] Installation can be continued with missing database privileges #22187

textagroup opened this issue May 5, 2024 · 5 comments · Fixed by #22208
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@textagroup
Copy link
Contributor

textagroup commented May 5, 2024

What happened?

Installed Matomo on a develolment laptop and received an Access Denied error on the dashboard for the VisitFrequency plugin

visitFrequencyError

What should happen?

The system check should gives some information about the datbase user not being granted the create permission.

How can this be reproduced?

Create a new database user and do not grant them the Create permission and install Matomo using the new database user.

Matomo version

5.1.0-b1

PHP version

8.1.2

Server operating system

Ubuntu 22.04.1 LTS

What browsers are you seeing the problem on?

Chrome

Computer operating system

Ubuntu 22.04.1 LTS

Relevant log output

No response

Validations

@textagroup textagroup added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels May 5, 2024
@textagroup textagroup mentioned this issue May 5, 2024
11 tasks
@michalkleiner
Copy link
Contributor

Hi @textagroup, can you please provide some more information on how you installed Matomo? Did you went through the standard installation process and that worked and then it showed the error on the dashboard? I would expect the installation process to fail earlier if it couldn't create the db tables.

@sgiehl
Copy link
Member

sgiehl commented May 6, 2024

The installation should already fail when your user doesn't have the CREATE TABLE permission. Also Matomo already has a check for CREATE TEMPORARY TABLE. And I guess this implies CREATE TABLE

@textagroup
Copy link
Contributor Author

I have just reinstalled Matomo again to try and replicate the issue with a DB user who does not have the "CREATE TEMPORARY TABLES" permission.
I am not able to replicate the issue which could have been related to how I installed it initially.

One thing I did notice is that the alert for the necesary database permissions does not appear when selecting the MYSQLI (video attached) adapter however it does seem to work correctly.
Screencast from 10-05-24 09:23:15.webm

@sgiehl
Copy link
Member

sgiehl commented May 10, 2024

@textagroup The installation checks for all permissions that are required for using Matomo. But the CREATE TEMPORARY TABLE privilege isn't required for the installation. It will be required for being able to run archiving later.
But it should indeed not be the case, that you can simply continue with missing privileges, so that is something we might need to check in detail.

@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels May 10, 2024
@sgiehl sgiehl added this to the For Prioritization milestone May 10, 2024
@sgiehl sgiehl changed the title [Bug] Access denied Mysqli error related to VisitFrequency plugin [Bug] Installation can be continued with missing database privileges May 10, 2024
@textagroup
Copy link
Contributor Author

@sgiehl The validateOwner method in FormDatabaseSetup expects an exception to be thrown when running the requiredPrivileges SQL statements.
The MYSQLI adapter does not throw an exception but returns -1 instead.
The following PR resolves this and the video below is of the testing that I performed.
checkSqlReturn.webm

@sgiehl sgiehl modified the milestones: For Prioritization, 5.1.0 May 27, 2024
@sgiehl sgiehl added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. and removed not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants