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

UI database migration not fully compatible with PostgreSQL #5129

Closed
jlammrs opened this issue Sep 27, 2023 · 2 comments · Fixed by #5130
Closed

UI database migration not fully compatible with PostgreSQL #5129

jlammrs opened this issue Sep 27, 2023 · 2 comments · Fixed by #5130
Assignees
Labels
area/installation Affects the installation bug Something isn't working
Milestone

Comments

@jlammrs
Copy link

jlammrs commented Sep 27, 2023

Describe the bug

In the web interface I get an error
SQLSTATE[22023]: Invalid parameter value: 7 ERROR: unrecognized privilege type: "CREATE", query was: SELECT has_table_privilege(:user, :table, :privilege) AS table_privilege_granted
PostgreSQL doesn't have the CREATE privilege.

In the postgres log I see:
2023-09-27 09:09:54.232 UTC [4154218] icinga2@icinga2 ERROR: unrecognized privilege type: "CREATE" 2023-09-27 09:09:54.232 UTC [4154218] icinga2@icinga2 STATEMENT: SELECT has_table_privilege($1, $2, $3) AS table_privilege_granted

I removed 'CREATE' in the public function getRequiredDatabasePrivileges() in /usr/share/php/Icinga/Application/MigrationManager.php
return ['CREATE','SELECT','INSERT','UPDATE','DELETE','DROP','ALTER','CREATE VIEW','INDEX','EXECUTE'];
-> return ['SELECT','INSERT','UPDATE','DELETE','DROP','ALTER','CREATE VIEW','INDEX','EXECUTE'];
which fixed the problem for me. I leave it up to someone else to find a more generic solution.

To Reproduce

1.In the web interface an error occurs when clicking on the settings icon -> system -> migrate

Expected behavior

Status screen

Screenshots

If applicable, add screenshots to help explain your problem.
image

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Icinga Web 2 version and modules (System - About): 2.12.0
  • Web browser used: Firefox
  • Icinga 2 version used (icinga2 --version): r2.14.0-1
  • PHP version used (php --version): 8.1.2-1ubuntu2.14
  • Server operating system and version: Ubuntu 22.04.3 LTS
  • Database: Postgres 14

Additional context

--

@nilmerg nilmerg added this to the 2.12.1 milestone Sep 27, 2023
@nilmerg nilmerg added bug Something isn't working area/installation Affects the installation labels Sep 27, 2023
@yhabteab yhabteab self-assigned this Sep 28, 2023
@bisontim
Copy link

It happens with (PostgreSQL) 15.3 as well

nilmerg added a commit that referenced this issue Oct 27, 2023
@mbanck
Copy link

mbanck commented Nov 14, 2023

Will there be a point release to fix this soon?

@nilmerg nilmerg changed the title check in MigrationManager.php not compatible with postgresql UI database migration not fully compatible with PostgreSQL Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/installation Affects the installation bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants