Upgrading fails Duplicate column name 'locale'

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Zystorm
Posts: 2
Joined: Thu Oct 10, 2013 4:01 am

Upgrading fails Duplicate column name 'locale'

Post by Zystorm »

Hi
I'm trying to upadte my 2011 to the latest 2012 version
Latest Available Version: 2012R2.5
Installed Version: 2011R3.3

Upgrading stops with ;

Stopping nagios : done
Starting nagios : done
NagiosQL failed to update user table!
Duplicate column name 'locale'

Any hints to resolving this ?

Thanks
User avatar
BanditBBS
Posts: 2460
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Upgrading fails Duplicate column name 'locale'

Post by BanditBBS »

2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrading fails Duplicate column name 'locale'

Post by abrist »

Yep. I presume the column exists, correct? (its DEFAULT value should be 'EN_en') If it does, you can comment out lines #26-42 of the file:

Code: Select all

/tmp/nagiosxi/subcomponents/nagiosql/db_upgrades.php
The lines to comment out are:

Code: Select all

if(intval($oldversion) < 304) {
        if(db_connect_select($dba)) {
                $query = "ALTER TABLE tbl_user ADD COLUMN locale VARCHAR(6) DEFAULT 'en_EN'";
                if(!mysql_query($query)) {
                        echo "NagiosQL failed to update user table!\n".mysql_error()."\n";
                        exit(1);
                }
                else {
                        echo "NagiosQL user table updated successfully!\n";
                        exit(0);
                }
        }
        else {
                "Unable to connect to NagiosQL database!\n";
                exit(1);
        }
}
Let me be clear here. Only comment out these lines if the 'locale' column exists in the nagiosql database and it is populated with 'EN-en'.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Zystorm
Posts: 2
Joined: Thu Oct 10, 2013 4:01 am

Re: Upgrading fails Duplicate column name 'locale'

Post by Zystorm »

Worked like a dream :) Thanks
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Upgrading fails Duplicate column name 'locale'

Post by slansing »

Excellent, do you have any other questions on this?
Locked