Upgrade from 5.4.2 to 5.6.3 fails

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
johnbrodhurstadm
Posts: 4
Joined: Fri Jun 21, 2019 6:01 am

Upgrade from 5.4.2 to 5.6.3 fails

Post by johnbrodhurstadm »

Attempting to take over an old Nagios XI installation that has been un-maintained for some time. I've been asked to update to the latest version, and after fixing an issue of dirty databases with a repair script, I'm now stuck receiving the following error when I try to update in the web interface:

Code: Select all

ERROR 1060 (42S21) at line 25: Duplicate column name 'dependent_servicegroup_name'
I've checked using touch mysql.5600.updated which has allowed the upgrade to get this far - it failed much earlier before I did that - it gets that far and stops. I've used the upgrade script on the shell which completes, but the web UI still says that it's on 5.4.2 and needs to be updated. I'm not sure what to do next, as I'm quite new to Nagios full stop.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Upgrade from 5.4.2 to 5.6.3 fails

Post by benjaminsmith »

Hi John,

Let's try upgrading this server using the manual process. Log in as root in the terminal and run the following commands:

Code: Select all

cd /tmp
rm -rf nagiosxi xi*.tar.gz
wget http://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz
tar xzf xi-latest.tar.gz
cd nagiosxi
./upgrade
If the upgrade fails again, please post the upgrade log at /usr/local/nagiosxi/tmp/upgrade.log, and PM your system profile.

To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and share in a private message or upload it to the post/ticket.

Let me know if you have any questions or need clarification on anything.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
johnbrodhurstadm
Posts: 4
Joined: Fri Jun 21, 2019 6:01 am

Re: Upgrade from 5.4.2 to 5.6.3 fails

Post by johnbrodhurstadm »

Hi Benjamin Smith
Thank you for your instructions. Unfortunately it's the result same again, ERROR 1060 (42S21) at line 25: Duplicate column name 'dependent_servicegroup_name'.

The Nagios XI server VM is to a certain extent isolated with no SSH available (plus ajaxterm won't authenticate the nagiosadmin account), and I'm only able to access the terminal via the VM console. In order to get the logfile, I've re-run the upgrade from the web UI as it has exactly the same result, and it's attached. I'll PM you the profile.zip presently.

Looking through the (extensive) log, I can see these lines (15552-15559) which seem likely to be problematic:

Code: Select all

psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_03.sql:11: ERROR:  relation "xi_cmp_trapdata_trapdata_id_seq" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_03.sql:17: ERROR:  relation "xi_cmp_trapdata_trapdata_log_id_seq" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_03.sql:34: ERROR:  relation "xi_cmp_trapdata" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_03.sql:54: ERROR:  relation "xi_cmp_trapdata_log" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_03.sql:61: ERROR:  relation "xi_auth_tokens_id_seq" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_03.sql:75: ERROR:  relation "xi_auth_tokens" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_03.sql:82: ERROR:  relation "xi_sessions_id_seq" already exists
psql:nagiosxi/nagiosxi-db/mods/pgsql/schema_03.sql:96: ERROR:  relation "xi_sessions" already exists
TIA, KR
You do not have the required permissions to view the files attached to this post.
johnbrodhurstadm
Posts: 4
Joined: Fri Jun 21, 2019 6:01 am

Re: Upgrade from 5.4.2 to 5.6.3 fails

Post by johnbrodhurstadm »

Actually, I may have cracked it.

Followed instructions from https://support.nagios.com/forum/viewto ... =6&t=54047, namely
  • deleted and downloaded as you instructed
  • Code: Select all

    cd /tmp/nagiosxi/
    touch mysql.5600.updated
  • Got different error, this time about snmptt user account, so then did:
  • useradd snmptt
  • finally ran upgrade script again
Now it reports that it's on 5.6.3 although there is a PHP warning on the console: PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/components/nagiosim/nagiosim.inc.php on line 491 However it seems to be working...
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Upgrade from 5.4.2 to 5.6.3 fails

Post by benjaminsmith »

Hi John,

Good to hear and thanks for posting the solution.

You can safely ignore the PHP message. That product has been deprecated and if you're not using Nagios Incident Manager, you can remove the whole directory.

Code: Select all

rm -rf /usr/local/nagiosxi/html/includes/components/nagiosim
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
johnbrodhurstadm
Posts: 4
Joined: Fri Jun 21, 2019 6:01 am

Re: Upgrade from 5.4.2 to 5.6.3 fails

Post by johnbrodhurstadm »

Apologies for the delay to reply, but thank you very much for your assistance. I now have a very happy customer :lol:
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Upgrade from 5.4.2 to 5.6.3 fails

Post by scottwilkerson »

johnbrodhurstadm wrote:Apologies for the delay to reply, but thank you very much for your assistance. I now have a very happy customer :lol:
Glad to hear it is working!

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked