Page 1 of 1
Upgrading fails Duplicate column name 'locale'
Posted: Fri Oct 18, 2013 1:29 am
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
Re: Upgrading fails Duplicate column name 'locale'
Posted: Fri Oct 18, 2013 8:33 am
by BanditBBS
Re: Upgrading fails Duplicate column name 'locale'
Posted: Fri Oct 18, 2013 10:11 am
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'.
Re: Upgrading fails Duplicate column name 'locale'
Posted: Mon Oct 21, 2013 2:49 am
by Zystorm
Worked like a dream

Thanks
Re: Upgrading fails Duplicate column name 'locale'
Posted: Mon Oct 21, 2013 10:14 am
by slansing
Excellent, do you have any other questions on this?