2014R1.0 upgrade fail

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
XenoPhage
Posts: 56
Joined: Sun Jun 03, 2012 11:37 am

2014R1.0 upgrade fail

Post by XenoPhage »

Greetings,

I'm trying to upgrade a 2012R2.9 system to 2014R1.0 and I've run into a problem. The error message is as follows :

Code: Select all

Current database version: 1.5.2
** DB upgrade required for 2.0.0
     Using mysql-upgrade-2.0.0.sql for upgrade...
ERROR 1062 (23000) at line 17: Duplicate entry '1-2014-04-15 00:00:00-2014-04-15 00:00:00-186172' for key 'instance_id'
Upgrade from mysql-upgrade-2.0.0.sql failed at ./upgradedb line 106.
This refers specifically to the alter table line that adds a new unique index to the table. The problem is, you've assumed that there will not be a table entry that matches all four fields. In fact, I have a bunch of these entries in the nagios_logentries table. There are 578700 rows in the table and over 143000 instances where there are two or more rows that match those four fields.

Truncating the nagios_logentries table resolves the problem, but, of course, results in no log data. I would also expect that this will result in errors moving forward as the system attempts to add more "duplicate" entries. You also need to back out the other SQL updates before re-running the upgrade or else it fails when trying to alter the tables and add columns.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: 2014R1.0 upgrade fail

Post by slansing »

Thank you for pointing this out, the dev team is looking into this.
rentsys
Posts: 98
Joined: Wed Oct 16, 2013 11:57 am

Re: 2014R1.0 upgrade fail

Post by rentsys »

Can you also tell the dev team to look into this error? Truncating the nagios_logentries table does not fix this error.

Code: Select all

Current database version: 1.5.2
** DB upgrade required for 2.0.0
     Using mysql-upgrade-2.0.0.sql for upgrade...
ERROR 1060 (42S21) at line 8: Duplicate column name 'minimum_importance'
Upgrade from mysql-upgrade-2.0.0.sql failed at ./upgradedb line 106.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: 2014R1.0 upgrade fail

Post by jkinning »

I tried upgrading and it keeps giving me this error:

Code: Select all

make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/nagiosplugins/nagios-plugins-2.0.1/po'
make[1]: Entering directory `/tmp/nagiosxi/subcomponents/nagiosplugins/nagios-plugins-2.0.1'
make[2]: Entering directory `/tmp/nagiosxi/subcomponents/nagiosplugins/nagios-plugins-2.0.1'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/nagiosxi/subcomponents/nagiosplugins/nagios-plugins-2.0.1'
make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/nagiosplugins/nagios-plugins-2.0.1'

real	0m0.719s
user	0m0.423s
sys	0m0.086s
Nagios Plugins upgraded OK
Upgrading Extra Plugins...
 cd . && /bin/sh /var/www/html/products/xi/subcomponents/extraplugins/check_mysql_health-2.1/missing --run automake-1.10 --gnu 
/bin/sh: /var/www/html/products/xi/subcomponents/extraplugins/check_mysql_health-2.1/missing: No such file or directory
make: *** [Makefile.in] Error 1
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: 2014R1.0 upgrade fail

Post by tmcdonald »

Thank you guys for all the input. There are a few upgrade issues that were not encountered during our internal testing and were not found in any of the beta releases. We're looking into this and starting to see some connections, and when we have a fix we will let you all know.
Former Nagios employee
rentsys
Posts: 98
Joined: Wed Oct 16, 2013 11:57 am

Re: 2014R1.0 upgrade fail

Post by rentsys »

I commented about it during the beta test. I only got one reply, and when I replied back nobody answered.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: 2014R1.0 upgrade fail

Post by tmcdonald »

rentsys wrote:I commented about it during the beta test. I only got one reply, and when I replied back nobody answered.
If you were referring to this thread it was somewhat hectic and with so many different people posting different things in one thread, I think your second post got drowned out.
Former Nagios employee
rentsys
Posts: 98
Joined: Wed Oct 16, 2013 11:57 am

Re: 2014R1.0 upgrade fail

Post by rentsys »

Yup that's the one. When do you think this problem will be addressed?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: 2014R1.0 upgrade fail

Post by tmcdonald »

There are currently two issues. One is the same that you saw with the db issue and we aren't entirely sure of the cause right now. The second issue seems to be related to ghost hosts leftover from 2012, and is a bit easier to fix although we haven't pinpointed exactly what causes it. We're currently looking for a pattern to try and identify the root cause for each issue. It's my personal hope to have this fixed by the end of the week, but at this time I can't really give a solid ETA.
Former Nagios employee
XenoPhage
Posts: 56
Joined: Sun Jun 03, 2012 11:37 am

Re: 2014R1.0 upgrade fail

Post by XenoPhage »

rentsys wrote:Can you also tell the dev team to look into this error? Truncating the nagios_logentries table does not fix this error.

Code: Select all

Current database version: 1.5.2
** DB upgrade required for 2.0.0
     Using mysql-upgrade-2.0.0.sql for upgrade...
ERROR 1060 (42S21) at line 8: Duplicate column name 'minimum_importance'
Upgrade from mysql-upgrade-2.0.0.sql failed at ./upgradedb line 106.
This happened to me as well because I had run the upgrade once already when I recieved the logentries table error. You need to remove the minimum_importance field from the table and re-run the upgrade. Run this against your nagios database before running the upgrade again :

Code: Select all

TRUNCATE TABLE `nagios_logentries`;
ALTER TABLE `nagios_contacts` DELETE `minimum_importance`;
ALTER TABLE `nagios_hosts` DELETE `importance`;
ALTER TABLE `nagios_services` DELETE `importance`;
And that should fix the problem, allowing you to upgrade. Those three fields don't exist prior to the nagiosxi 2014 release.
Locked