A clear and concise description of what the issue is.
We are performing a manual install of Icingaweb2. During the installation wizard (the webinterface) we have to validate our database credentials. The initial validation succeeds, but the page after says that there is something wrong with validating the credentials. I have an option here to skip validation, but if I do so the user to login to Icingaweb2 is not created.
In a database log, we see this query being executed:
SELECT COUNT(*) as matches FROM information_schema.schema_privileges WHERE grantee = '\'icingaweb_7d\'@\'127.0.0.1\'' AND table_schema = 'icingaweb\\_7d' AND privilege_type IN ('CREATE','ALTER','REFERENCES');
The matches count here is 0, which is why I think Icinga thinks the validation fails.
If I edit the query to this, it works as expected:
SELECT COUNT(*) as matches FROM information_schema.schema_privileges WHERE grantee = '\'icingaweb_7d\'@\'127.0.0.1\'' AND table_schema = 'icingaweb_7d' AND privilege_type IN ('CREATE','ALTER','REFERENCES');
This gives a matches result of 3.
I have managed to work around the issue like this:
Describe the bug
A clear and concise description of what the issue is.
We are performing a manual install of Icingaweb2. During the installation wizard (the webinterface) we have to validate our database credentials. The initial validation succeeds, but the page after says that there is something wrong with validating the credentials. I have an option here to skip validation, but if I do so the user to login to Icingaweb2 is not created.
In a database log, we see this query being executed:
The
matches
count here is0
, which is why I think Icinga thinks the validation fails.If I edit the query to this, it works as expected:
This gives a
matches
result of3
.I have managed to work around the issue like this:
modules/setup/library/Setup/Utils/DbTool.php
escapeTableWildcards
return str_replace(array('_', '%'), array('\_', '\%'), $tableName);
return $tableName;
To Reproduce
Provide a link to a live example, or an unambiguous set of steps to reproduce this issue. Include configuration, logs, etc. to reproduce, if relevant.
Expected behavior
Installing Icingaweb2 with a database that has an underscore in it works.
Screenshots
If applicable, add screenshots to help explain your problem.
Your Environment
Include as many relevant details about the environment you experienced the problem in
icinga2 --version
): N/Aphp --version
): 8.2Additional context
Add any other context about the problem here.