We installed the Nagios XI 5.2.9 manually on a new VM with Red Hat Enterprise Linux Server release 7.2 and it was working OK.
We saw the new package 5.3.0 & tried to upgrade it, but the error below occurred at the end:
......
Done!
Dashlets installed/updated OK
ERROR 1060 (42S21) at line 5: Duplicate column name 'api_key'
The web UI is still working and stating that we are still at v5.2.9. I have no idea where to start to fix it.
Thanks,
Steve Ho
Duplicate column name 'api_key' on 5.3.0 upgrade
Re: Duplicate column name 'api_key' on 5.3.0 upgrade
Did you by chance upgrade more than once or was this the first shot at an upgrade?
It looks like the database part of the upgrade threw the error. I would bet in the upgrade script between 809 and 825 somewhere where the nagiosql or mysql schema updates are being applied. (eg: nagiosxi/nagiosxi-db/mods/mysql/schema_01.sql) Did you change the database at all by chance?
Also if you could, please attach your install.log so we can take a peek. (redacted for privacy)
It looks like the database part of the upgrade threw the error. I would bet in the upgrade script between 809 and 825 somewhere where the nagiosql or mysql schema updates are being applied. (eg: nagiosxi/nagiosxi-db/mods/mysql/schema_01.sql) Did you change the database at all by chance?
Also if you could, please attach your install.log so we can take a peek. (redacted for privacy)
/Luke
Re: Duplicate column name 'api_key' on 5.3.0 upgrade
First, thanks for the quick reply to my post.
The first time I ran the upgrade, the error below occurred:
Dashlets installed/updated OK
Attempting to read global hard/soft nofile limits failed. Check /etc/security/limits.conf and try again!
Our Unix admin helped to modified the /etc/security/limits.conf and I tried again. This time it pass the previous error, I got the api_key error. Then, I tried again from the Web console & got the same error.
I'm new to Nagios, so let me know where to find the install.log. Plus, in the
/tmp/nagiosxi/nagiosxi/nagiosxi-db/mods/mysql/schema_01.sql, the only line I can find with the "api_key" is the line below:
ALTER TABLE xi_users ADD COLUMN api_key varchar(128) NULL;
The first time I ran the upgrade, the error below occurred:
Dashlets installed/updated OK
Attempting to read global hard/soft nofile limits failed. Check /etc/security/limits.conf and try again!
Our Unix admin helped to modified the /etc/security/limits.conf and I tried again. This time it pass the previous error, I got the api_key error. Then, I tried again from the Web console & got the same error.
I'm new to Nagios, so let me know where to find the install.log. Plus, in the
/tmp/nagiosxi/nagiosxi/nagiosxi-db/mods/mysql/schema_01.sql, the only line I can find with the "api_key" is the line below:
ALTER TABLE xi_users ADD COLUMN api_key varchar(128) NULL;
Re: Duplicate column name 'api_key' on 5.3.0 upgrade
It looks like, according to the first error you posted, you've already made it past the MySQL additions - meaning you've already applied those upgrades. You can comment out lines 820-828 in the upgrade script and then re-run the upgrade. If you still have problems with limits, you can comment out that portion of the upgrade also on line 834. The limit changes are not required for your upgrade to be successful.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Duplicate column name 'api_key' on 5.3.0 upgrade
Jomann,
Your recommendation is right on the spot. I comment out the line 820-828 and 834, then run the upgrade again. It worked with 2 warnings:
Total Warnings: 2
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Warning: nagios.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Fixing php-mcrypt bug...
PHP Notice: Use of undefined constant CURL_SSLVERSION_TLSv1_2 - assumed 'CURL_SSLVERSION_TLSv1_2' in /usr/local/nagiosxi/html/includes/utilsx.inc.php on line 180
Nagios XI Upgrade Complete!
After that, I also ran the 'systemctl daemon-reload' to reload units.
Thank you both for the great support today.
Your recommendation is right on the spot. I comment out the line 820-828 and 834, then run the upgrade again. It worked with 2 warnings:
Total Warnings: 2
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Warning: nagios.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Fixing php-mcrypt bug...
PHP Notice: Use of undefined constant CURL_SSLVERSION_TLSv1_2 - assumed 'CURL_SSLVERSION_TLSv1_2' in /usr/local/nagiosxi/html/includes/utilsx.inc.php on line 180
Nagios XI Upgrade Complete!
After that, I also ran the 'systemctl daemon-reload' to reload units.
Thank you both for the great support today.
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Duplicate column name 'api_key' on 5.3.0 upgrade
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
Re: Duplicate column name 'api_key' on 5.3.0 upgrade
Sure, please close this thread. Thank you.