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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
Psihawk
Posts: 31
Joined: Wed May 13, 2020 9:29 pm

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

Post 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'
jsimon
Posts: 117
Joined: Wed Aug 23, 2023 11:27 am

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

Post 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.
Psihawk
Posts: 31
Joined: Wed May 13, 2020 9:29 pm

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

Post 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?
Psihawk
Posts: 31
Joined: Wed May 13, 2020 9:29 pm

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

Post 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'
jsimon
Posts: 117
Joined: Wed Aug 23, 2023 11:27 am

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

Post 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?
Psihawk
Posts: 31
Joined: Wed May 13, 2020 9:29 pm

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

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
swolf
Developer
Posts: 314
Joined: Tue Jun 06, 2017 9:48 am

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

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
Psihawk
Posts: 31
Joined: Wed May 13, 2020 9:29 pm

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

Post 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?
User avatar
swolf
Developer
Posts: 314
Joined: Tue Jun 06, 2017 9:48 am

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

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
Psihawk
Posts: 31
Joined: Wed May 13, 2020 9:29 pm

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

Post 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?
Post Reply