post 2024R1 uprade error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
BenCowan
Posts: 86
Joined: Thu Jul 28, 2011 11:34 am

post 2024R1 uprade error

Post by BenCowan »

Several weeks ago I upgraded to 2024R1, but have not been able to successfully complete another upgrade since. The DB Maint alert stays red. I've tried the repair scripts, but those don't work. I saw this in the dbmaint log:

Database Error: Could not connect to database
Access denied for user 'dbmaint_nagiosxi'@'localhost' (using password: YES)
Mon, 04 Mar 2024 09:15:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' EXISTS - EXITING!
Mon, 04 Mar 2024 09:20:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' EXISTS - EXITING!
Mon, 04 Mar 2024 09:30:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' EXISTS - EXITING!
Mon, 04 Mar 2024 09:35:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' EXISTS - EXITING!
Mon, 04 Mar 2024 09:40:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' EXISTS - EXITING!
Mon, 04 Mar 2024 09:45:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' IS OLD - REMOVING
Mon, 04 Mar 2024 09:45:02 -0800 CREATING: /usr/local/nagiosxi/var/dbmaint.lock
Database Error: Could not connect to database
Access denied for user 'dbmaint_nagiosxi'@'localhost' (using password: YES)

The password has not changed from what I can tell, but I'm not well versed in mysql. Anybody got a tip on how to fix this?
bbahn
Posts: 380
Joined: Thu Jan 12, 2023 5:42 pm

Re: post 2024R1 uprade error

Post by bbahn »

Hello @BenCowan,

You can use the script /usr/local/nagiosxi/scripts/get_mysql_passwords.sh to check your database passwords and verify that those passwords work for accessing your databases
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
BenCowan
Posts: 86
Joined: Thu Jul 28, 2011 11:34 am

Re: post 2024R1 uprade error

Post by BenCowan »

Thanks, that script wasn't on my 2024R1 server, but I did find it on my 2024R1.0.2 server, so I did run it on both, and the password is the same. So, what does that mean? Is the password supposed to be different? If so, how do I change it, or reset it?
jsimon
Posts: 339
Joined: Wed Aug 23, 2023 11:27 am

Re: post 2024R1 uprade error

Post by jsimon »

It sounds like this may have been caused by a known bug involving upgrading via server migration. If this is the case, we are aware of the bug and are currently working to correct it.

For your situation, I would recommend taking those passwords from the get_mysql_passwords.sh script and trying to log into your database with the root@localhost password in that script output. If this works, I would run these commands to make sure that your database passwords match the passwords that XI is trying to use to access the database: (with "yourpasswordhere" being the root@localhost password and "newpasswordhere" being the associated password from the get_mysql_passwords.sh output)

Code: Select all

mysql -u root -p"yourpasswordhere" -e "ALTER USER 'nagiosxi'@'localhost' IDENTIFIED BY 'newpasswordhere';"
mysql -u root -p"yourpasswordhere" -e "ALTER USER 'ndoutils'@'localhost' IDENTIFIED BY 'newpasswordhere';"
mysql -u root -p"yourpasswordhere" -e "ALTER USER 'nagiosql'@'localhost' IDENTIFIED BY 'newpasswordhere';"
mysql -u root -p"yourpasswordhere" -e "ALTER USER 'dbmaint_nagiosxi'@'localhost' IDENTIFIED BY 'newpasswordhere';"
If this does not work, I would recommend opening a case with our support department:
https://answerhub.nagios.com/support/s/
danderson

Re: post 2024R1 uprade error

Post by danderson »

Make sure you can log into each of the users from the get_mysql_passwords.sh script and their corresponding passwords.

Example:

Code: Select all

$ 	/usr/local/nagiosxi/scripts/get_mysql_passwords.sh
MySQL root password:                  		nagiosxi
MySQL nagiosxi password:              		NAGIOSXIPASSWORD
MySQL dbmaint_nagiosxi password:      		DBMAINTPASSWORD
MySQL ndoutils password:              		NDOUTILSPASSWORD
MySQL nagiosql password:              		NAGIOSQLPASSWORD
Then make sure the following work

Code: Select all

$	mysql -u nagiosxi -p"NAGIOSXIPASSWORD"
$	mysql -u dbmaint_nagiosxi -p"DBMAINTPASSWORD"
$	mysql -u ndoutils -p"NDOUTILSPASSWORD"
$	mysql -u nagiosql -p"NAGIOSQLPASSWORD"
If the above doesn't work, you will have to update the passwords using the method that @jsimon specified such that the output of the get_mysql_passwords.sh has the correct passwords.

You may have to update the "pwd" and "dbmaint_pwd" values in /usr/local/nagiosxi/html/config.inc.php
BenCowan
Posts: 86
Joined: Thu Jul 28, 2011 11:34 am

Re: post 2024R1 uprade error

Post by BenCowan »

Thanks guys and sorry for the late reply... I got distracted for a few days.

I reset the password, and issued the following commands, and I think I'm fixed. Thank you, thank you, thank you!

rm /usr/local/nagiosxi/var/dbmaint.lock
php /usr/local/nagiosxi/cron/dbmaint.php
Post Reply