Page 1 of 1

Nagios XI 2024R1 upgrade issue " Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'"

Posted: Wed Dec 20, 2023 10:39 am
by Psihawk
We are running a MariaDB and get this error during upgrade which stops the upgrade.. Anyone have thoughts? The user does already exist in the DB
Should we delete it?

Done!
INSTALL: Dashlets installed/updated OK.
tr: write error: Broken pipe
tr: write error
ERROR 1396 (HY000) at line 2: Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'

Re: Nagios XI 2024R1 upgrade issue " Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'"

Posted: Wed Dec 20, 2023 12:26 pm
by jsimon
Hi @Psihawk,

The upgrade script uses "mysqlpass" in both

Code: Select all

/usr/local/nagiosxi/etc/xi-sys.cfg
and

Code: Select all

/usr/local/nagiosxi/var/xi-sys.cfg
as the default value for the database root password. If you have updated your root password you would need to update that value in both of the above scripts so that it matches the root password you are using, and then try running the upgrade again.

Let us know if this does not work to fix your situation.

Re: Nagios XI 2024R1 upgrade issue " Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'"

Posted: Wed Dec 20, 2023 6:56 pm
by Psihawk
The passwords in that file seem to be the correct one as I am able to login to the mariadb using
mysql -p nagios and entering the password in that file.

Is there something else I should check? Do you mean the root password I login into the SSH terminal to access nagios SSH term?

Re: Nagios XI 2024R1 upgrade issue " Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'"

Posted: Wed Dec 20, 2023 10:53 pm
by Psihawk
Attempted upgrade again.. Same error at same spot

Done!
INSTALL: Dashlets installed/updated OK.
tr: write error: Broken pipe
tr: write error
ERROR 1396 (HY000) at line 2: Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'

Re: Nagios XI 2024R1 upgrade issue " Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'"

Posted: Thu Dec 21, 2023 10:56 am
by jsimon
When you say "that file", can you be more specific about which file you mean?

In both xi-sys files there is a value like this:

Code: Select all

mysqlpass=<ROOT PASSWORD>
This <ROOT PASSWORD> value needs to match what you log into the mariadb with.

If this isn't the issue, can you please follow up and let us know what OS/version you are on and what version of XI you are upgrading from?

Re: Nagios XI 2024R1 upgrade issue " Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'"

Posted: Thu Dec 21, 2023 11:35 am
by Psihawk
Yes the root password value that shows in both files match and that is what I login to the MariaDB with
Screenshot 2023-12-21 113106.png
Interesting those is the mysql shows tables.. the nagios database when querying SHOW TABLES shows no tables.
Running the repair_databases.sh though shows all the tables its repairing in multiple Nagios databases


We do have another Linux box named similarly that may hold the DBs? Sorry I took this over from another admin. Not sure how to check if mysql is running there or if there is some link between the two servers.

Re: Nagios XI 2024R1 upgrade issue " Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'"

Posted: Thu Dec 21, 2023 12:32 pm
by swolf
Hi @Psihawk, I think you're onto something here.

The next place I'd have you look is in /usr/local/nagiosxi/html/config.inc.php. Around line 45, you should see an array-of-arrays that has a dbserver entry. If that entry is blank or localhost, we might have trouble, but if it's that second linux box, then you have an offloaded database set up. We have a known issue in 2024R1 where we didn't handle upgrades correctly for offloaded databases - if you're able to revert to 5.11.x for now, I'd encourage that, and we should have this addressed in 2024R1.0.1, which should be out in mid-January.

I've added this thread to the bugtracker for that issue, but please update us with your findings.

Re: Nagios XI 2024R1 upgrade issue " Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'"

Posted: Thu Dec 21, 2023 1:19 pm
by Psihawk
Yes those entries are there and point to the other Nagios box. Now since I was using the UI to update this.. i am not sure how to revert back?
UI still shows me on version 5.9.3 and Nagios seems to be working. Is there an easy way to revert back to backups made by the UI upgrade tool or can I run this way for now?

Re: Nagios XI 2024R1 upgrade issue " Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'"

Posted: Thu Dec 21, 2023 2:59 pm
by swolf
The UI update does automatically take a snapshot and reverts to it if the update failed, so I think you're okay for now.

Re: Nagios XI 2024R1 upgrade issue " Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'"

Posted: Tue May 07, 2024 12:22 pm
by Psihawk
swolf wrote: Thu Dec 21, 2023 12:32 pm Hi @Psihawk, I think you're onto something here.

The next place I'd have you look is in /usr/local/nagiosxi/html/config.inc.php. Around line 45, you should see an array-of-arrays that has a dbserver entry. If that entry is blank or localhost, we might have trouble, but if it's that second linux box, then you have an offloaded database set up. We have a known issue in 2024R1 where we didn't handle upgrades correctly for offloaded databases - if you're able to revert to 5.11.x for now, I'd encourage that, and we should have this addressed in 2024R1.0.1, which should be out in mid-January.

I've added this thread to the bugtracker for that issue, but please update us with your findings.
Question my upgrade completed but in that config.inc.php there still is no entry for dbmaint_nagiosxi. When I try and run dbmaint I get an error about permissions.. Should I have an entry in this file for dbmaint_nagiosxi?