Page 1 of 6

Upgrade from 5.2.7 to 5.5.0 failed

Posted: Thu Jul 12, 2018 7:29 am
by blueagle
Hi, I hope you'll be able to help. I attempted to upgrade one of our Nagios XI instance which is currently running 5.2.7 to 5.5.0 but it failed. I tried both the automated (within the Nagios XI interface) and manual process using this guide:
https://assets.nagios.com/downloads/nag ... ctions.pdf

First time when I ran the manual update it failed with these errors:
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:2: ERROR: column "api_key" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:3: ERROR: column "api_enabled" of relation "xi_users" already exists
UPDATE 9
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:8: ERROR: column "login_attempts" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:9: ERROR: column "last_attempt" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:10: ERROR: column "last_password_change" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:13: ERROR: column "last_login" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:14: ERROR: column "last_edited" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:15: ERROR: column "last_edited_by" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:16: ERROR: column "created_by" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:17: ERROR: column "created_time" of relation "xi_users" already exists
ERROR 1060 (42S21) at line 27: Duplicate column name 'exclude'

I did a bit of search on internet and found a suggestion on Nagios support forum to comment out a small section of upgrade.sh and it started working but never completed and I didn't get any errors.

However, Nagios XI is still the same version and "Monitoring Engine" won't start.

I've attached the upgrade.log so you can help me figure out why its failed.

Re: Upgrade from 5.2.7 to 5.5.0 failed

Posted: Thu Jul 12, 2018 7:50 am
by scottwilkerson
After the Extra Plugins you should be getting a prompt:

Code: Select all

		===================
		XI 5.3.0 Updates
		===================
		NOTICE: This upgrade script will update ALL XI components, wizards, and dashlets
		to the latest available versions. Before running this upgrade the currently 
		installed versions will be backed up to the /tmp directory. 

Are you sure you want to continue? [y/N] 
Are you not getting this on the screen?

Re: Upgrade from 5.2.7 to 5.5.0 failed

Posted: Thu Jul 12, 2018 8:01 am
by blueagle
Scott thanks for your prompt response.

I just ran the upgrade to see what I get and these are the last few lines I see in the terminal when I run upgrade script.

t/check_stuff.t .............................. ok
t/Nagios-Monitoring-Plugin-01.t .............. ok
t/Nagios-Monitoring-Plugin-02.t .............. ok
t/Nagios-Monitoring-Plugin-03.t .............. ok
t/Nagios-Monitoring-Plugin-04.t .............. ok
t/Nagios-Monitoring-Plugin-Functions-01.t .... ok
t/Nagios-Monitoring-Plugin-Functions-02.t .... ok
t/Nagios-Monitoring-Plugin-Functions-03.t .... ok
t/Nagios-Monitoring-Plugin-Getopt-01.t ....... ok
t/Nagios-Monitoring-Plugin-Getopt-02.t ....... ok
t/Nagios-Monitoring-Plugin-Getopt-03.t ....... ok
t/Nagios-Monitoring-Plugin-Getopt-04.t ....... ok
t/Nagios-Monitoring-Plugin-Performance-02.t .. ok
t/Nagios-Monitoring-Plugin-Performance.t ..... ok
t/Nagios-Monitoring-Plugin-Range.t ........... ok
t/Nagios-Monitoring-Plugin-Threshold.t ....... ok
All tests successful.
Files=16, Tests=975, 4 wallclock secs ( 0.18 usr 0.05 sys + 3.53 cusr 0.20 csys = 3.96 CPU)
Result: PASS
Appending installation info to /usr/lib64/perl5/perllocal.pod
Extra Plugins upgraded OK
./upgrade: line 1414: syntax error: unexpected end of file

The upgrade just exits at this stage.

Re: Upgrade from 5.2.7 to 5.5.0 failed

Posted: Thu Jul 12, 2018 1:58 pm
by scottwilkerson
5.5.1 was just release and will get past a few upgrade hurdles, can you re-download the new tarball and try with that.

Re: Upgrade from 5.2.7 to 5.5.0 failed

Posted: Fri Jul 13, 2018 3:59 am
by blueagle
Thanks for updating me with 5.5.1 release.

I rang the upgrade script after downloading 5.5.1, I saw this:
===================
XI 5.3.0 Updates
===================
NOTICE: This upgrade script will update ALL XI components, wizards, and dashlets
to the latest available versions. Before running this upgrade the currently
installed versions will be backed up to the /tmp directory.

Are you sure you want to continue? [y/N]

Went ahead with y and after little while I got the same error:

Done!
INSTALL: Dashlets installed/updated OK.
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:2: ERROR: column "api_key" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:3: ERROR: column "api_enabled" of relation "xi_users" already exists
UPDATE 9
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:8: ERROR: column "login_attempts" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:9: ERROR: column "last_attempt" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:10: ERROR: column "last_password_change" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:13: ERROR: column "last_login" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:14: ERROR: column "last_edited" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:15: ERROR: column "last_edited_by" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:16: ERROR: column "created_by" of relation "xi_users" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_01.sql:17: ERROR: column "created_time" of relation "xi_users" already exists
ERROR 1060 (42S21) at line 27: Duplicate column name 'exclude'
[root@nagios nagiosxi]#

Re: Upgrade from 5.2.7 to 5.5.0 failed

Posted: Fri Jul 13, 2018 12:37 pm
by jomann
Before you re-run the upgrade can you run:

Code: Select all

touch mysql.530.updated
This should stop that part of the MySQL upgrade from running, since it has already been applied.

Re: Upgrade from 5.2.7 to 5.5.0 failed

Posted: Thu Jul 19, 2018 5:24 am
by blueagle
I touched the file as you suggested in /tmp/nagiosxi directory where I've untarred the NagiosXI 5.5.1 download file.
The upgrade process definitely went further this time but it didn't complete as I was expecting. I've attached the new upgrade.log file.
Your help would be really appreciated.

Re: Upgrade from 5.2.7 to 5.5.0 failed

Posted: Thu Jul 19, 2018 4:32 pm
by scottwilkerson
I'm not really sure why it stopped here without error.

Please update the upgrade script and on line 22 change

Code: Select all

CORE_UPDATED=0
to

Code: Select all

CORE_UPDATED=1
then run upgrade again

Re: Upgrade from 5.2.7 to 5.5.0 failed

Posted: Fri Jul 20, 2018 2:55 am
by blueagle
I made the change as you suggested:

[root@nagios nagiosxi]# grep 'CORE_UPDATED=' upgrade
CORE_UPDATED=1

However, it ended in the same way. I've uploaded the log file.

Re: Upgrade from 5.2.7 to 5.5.0 failed

Posted: Fri Jul 20, 2018 8:14 am
by scottwilkerson
Not in the same spot, very odd your system is exiting without cause after these compiling, we have never seen this, one more change

Please update the upgrade script and on line 23 change

Code: Select all

NDO_UPDATED=0
to

Code: Select all

NDO_UPDATED=1
then run upgrade again