Page 1 of 2

Failed upgrade to 5.6.2

Posted: Thu May 16, 2019 4:30 pm
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?

Re: Failed upgrade to 5.6.2

Posted: Thu May 16, 2019 4:52 pm
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.

Re: Failed upgrade to 5.6.2

Posted: Tue May 21, 2019 3:13 pm
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.

Re: Failed upgrade to 5.6.2

Posted: Tue May 21, 2019 3:26 pm
by npolovenko
@drug, Sounds good!

Re: Failed upgrade to 5.6.2

Posted: Wed May 22, 2019 4:11 pm
by drug
After touching the file *mysql.5600.updated* in the install directory, the upgrade was able to succeed. Thanks for your help.

Re: Failed upgrade to 5.6.2

Posted: Wed May 22, 2019 4:25 pm
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.

Re: Failed upgrade to 5.6.2

Posted: Thu May 23, 2019 9:19 am
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.

Re: Failed upgrade to 5.6.2

Posted: Thu May 23, 2019 12:59 pm
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.

Re: Failed upgrade to 5.6.2

Posted: Thu May 23, 2019 1:34 pm
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.

Re: Failed upgrade to 5.6.2

Posted: Thu May 23, 2019 1:35 pm
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.