Failed upgrade to 5.6.2

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
drug
Posts: 86
Joined: Wed Apr 03, 2013 3:19 pm

Failed upgrade to 5.6.2

Post by drug »

While attempting to upgrade (manually) from 5.5.9 to 5.6.2 I received an error (that I did not record) that indicated the MySQL db user defined did not have permissions to create a table in the (nagiosxi) database. That was the final error reported before the _upgrade_ script exited (it still reports 5.5.9). I believe it referenced a table containing "mibs".

I subsequently ran the manual _upgrade_ script again, only this time I'm receiving the following error:

Code: Select all

Done!
INSTALL: Dashlets installed/updated OK.
ERROR 1060 (42S21) at line 25: Duplicate column name 'dependent_servicegroup_name'
I'm guessing it was able to make some schema changes previously and now won't continue a second time. Nagios appears to be functioning properly but I don't know what might be in a weird state somewhere in the background. What actions should I take to complete the upgrade?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Failed upgrade to 5.6.2

Post by npolovenko »

Hello, @drug. You should still have the upgrade.log file in the /tmp/nagiosxi/ directory. Can you upload it in this thread? Also, can you upload some DB logs from the remote server. Such as /var/log/mysql log or /var/log/mariadb.
MySQL db user defined did not have permissions to create a table in the database.
Did you change the root password on your offloaded mysql server?

First, try repairing the offloaded db by logging in to the DB server and running the repair command:

Code: Select all

mysqlcheck -r -f -uroot -pnagiosxi --all-databases --use_frm
Then rerun the installation.

If you see the same duplicate table errors, you can try commenting out some lines in the upgrade script that push the new schema into mysql:
Untitled.png
These lines should be somewhere between 860 to 867, but may differ a bit in your script.
Once you commend out these lines, rerun the installation.

Please backup XI before you follow my instruction or create a snapshot of the VM+DB, so you can revert if something unexpected happens.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
drug
Posts: 86
Joined: Wed Apr 03, 2013 3:19 pm

Re: Failed upgrade to 5.6.2

Post by drug »

Just wanted to update to let you know that our next window for testing the above is tomorrow (Wednesday) PM. I'll update with results.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Failed upgrade to 5.6.2

Post by npolovenko »

@drug, Sounds good!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
drug
Posts: 86
Joined: Wed Apr 03, 2013 3:19 pm

Re: Failed upgrade to 5.6.2

Post by drug »

After touching the file *mysql.5600.updated* in the install directory, the upgrade was able to succeed. Thanks for your help.
rrustamSAI
Posts: 17
Joined: Wed Jun 01, 2016 11:53 am

Re: Failed upgrade to 5.6.2

Post by rrustamSAI »

@drug,

Could you please elaborate some more on how you resolved the issue, I ran it into exact same issue

Tkx much in adv.
drug wrote:After touching the file *mysql.5600.updated* in the install directory, the upgrade was able to succeed. Thanks for your help.
drug
Posts: 86
Joined: Wed Apr 03, 2013 3:19 pm

Re: Failed upgrade to 5.6.2

Post by drug »

Hi @rrustamSAI, reading through the upgrade script I noticed several conditionals for MySQL upgrades, e.g.:

Code: Select all

 
# Do not re-run the MySQL upgrades if they have already been applied
        if [ ! -f 'mysql.530.updated' ]; then
To prevent those MySQL changes from trying to execute again (per @npolovenko's recommendation), for each of those mysql.XXX.updated files, I created it in the install directory (e.g. touch mysql.530.updated) and ran the upgrade script. It continued to fail until I created mysql.5600.updated.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Failed upgrade to 5.6.2

Post by npolovenko »

@rrustamSAI, The upgrade script runs the ./get-version script first to check the current XI version and then runs specific MySQL commands based on the current XI version.

Can you run the script and show me the output?
/tmp/nagiosxi/get-version
@ drug, Glad this worked for you.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rrustamSAI
Posts: 17
Joined: Wed Jun 01, 2016 11:53 am

Re: Failed upgrade to 5.6.2

Post by rrustamSAI »

@npolovenko,

that script output = 5511

Pls let me know if you think touching the same file will let me finish the upgrade

Tkx!
npolovenko wrote:@rrustamSAI, The upgrade script runs the ./get-version script first to check the current XI version and then runs specific MySQL commands based on the current XI version.

Can you run the script and show me the output?
/tmp/nagiosxi/get-version
@ drug, Glad this worked for you.
Last edited by rrustamSAI on Thu May 23, 2019 1:45 pm, edited 4 times in total.
rrustamSAI
Posts: 17
Joined: Wed Jun 01, 2016 11:53 am

Re: Failed upgrade to 5.6.2

Post by rrustamSAI »

Tkx much @drug!
drug wrote:Hi @rrustamSAI, reading through the upgrade script I noticed several conditionals for MySQL upgrades, e.g.:

Code: Select all

 
# Do not re-run the MySQL upgrades if they have already been applied
        if [ ! -f 'mysql.530.updated' ]; then
To prevent those MySQL changes from trying to execute again (per @npolovenko's recommendation), for each of those mysql.XXX.updated files, I created it in the install directory (e.g. touch mysql.530.updated) and ran the upgrade script. It continued to fail until I created mysql.5600.updated.
Last edited by rrustamSAI on Thu May 23, 2019 1:42 pm, edited 1 time in total.
Locked