Nagios upgrade failing with DB error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
blaing
Posts: 3
Joined: Thu Dec 03, 2020 4:36 pm

Nagios upgrade failing with DB error

Post by blaing »

Hey all,

Having some issues trying to upgrade an instance of Nagios XI from version 5.8.1 to 2024R1.0.1 running on a RHEL7 server. I've tried from both the UI and command line, and am hitting the same error both ways.

INSTALL: Dashlets installed/updated OK.
Saved password worked...
ERROR 1396 (HY000) at line 2: Operation CREATE USER failed for 'dbmaint_nagiosxi'@'localhost'

This happens quite a ways into the process, after what seems like the majority of the updates are done.

The MySQL instance runs on the server. We've never connected to the DB manually or made any changes to it whatsoever, so everything DB related is default. I have no idea what to do with this error or how to get around it.

Any suggestions on next steps, or ways to find out why it's failing?
User avatar
danderson
Posts: 111
Joined: Wed Aug 09, 2023 10:05 am

Re: Nagios upgrade failing with DB error

Post by danderson »

Thanks for reaching out @blaing,

According to this stack overflow here:
https://stackoverflow.com/questions/555 ... klocalhost

Try logging in as the root user and doing a FLUSH PRIVILEGES; command.

Let me know if this helps.
blaing
Posts: 3
Joined: Thu Dec 03, 2020 4:36 pm

Re: Nagios upgrade failing with DB error

Post by blaing »

No luck after running FLUSH PRIVILEGES; unfortunately, I still get the same error. I do see some others on the stack overflow page saying that just running that doesn't always do it. Some had to remove the user in question first.

So now my question is, do I have to try removing the existing dbmaint_nagiosxi user and running a flush before trying to upgrade script? The user is already there, which would have to have been created by Nagios at some point earlier. Is the script failing because the user is already there? My worry of course is removing the user and then having the upgrade still fail and then my Nagios system starts having issues. I of course do have Nagios backups, and will take a snapshot of the VM before making any changes.

Thoughts?
User avatar
danderson
Posts: 111
Joined: Wed Aug 09, 2023 10:05 am

Re: Nagios upgrade failing with DB error

Post by danderson »

You can delete that user before the upgrade without any problems because that user was created in 2024R1 I believe.

After trying to delete the dbmaint_nagiosxi user and flushing the privileges, I would try the upgrade with a new tarball on the command line as well.

You can get the tarball here
https://assets.nagios.com/downloads/nag ... 0.1.tar.gz

Code: Select all

cd /tmp
rm -rf nagioxi* xi*
wget https://assets.nagios.com/downloads/nagiosxi/2024/xi-2024R1.0.1.tar.gz
tar xzf xi-2024R1.0.1.tar.gz
cd nagiosxi/
./upgrade
This process is documented in the following pdf in the manual section
https://assets.nagios.com/downloads/nag ... ctions.pdf
blaing
Posts: 3
Joined: Thu Dec 03, 2020 4:36 pm

Re: Nagios upgrade failing with DB error

Post by blaing »

That's pretty much what I did earlier today, just without removing the old files first. I'm not sure how the user was created, but it must have happened during 1 of the prior failed upgrade attempts. I dropped the user and flushed privileges again and re-ran the upgrade script, and this time it worked.
User avatar
danderson
Posts: 111
Joined: Wed Aug 09, 2023 10:05 am

Re: Nagios upgrade failing with DB error

Post by danderson »

That is great to hear, I'm glad you got it worked out!
Post Reply