Page 1 of 1

post 2024R1 uprade error

Posted: Wed Mar 06, 2024 5:35 pm
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?

Re: post 2024R1 uprade error

Posted: Thu Mar 07, 2024 12:57 pm
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

Re: post 2024R1 uprade error

Posted: Thu Mar 07, 2024 3:11 pm
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?

Re: post 2024R1 uprade error

Posted: Fri Mar 08, 2024 4:18 pm
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/

Re: post 2024R1 uprade error

Posted: Mon Mar 11, 2024 10:54 am
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

Re: post 2024R1 uprade error

Posted: Tue Mar 12, 2024 4:02 pm
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