Database error - Update ID:236
- FOG Version: 1.2.0 => 1.3.1
- OS: Ubuntu 16.04 server
- Service Version:
Error when database is updated/installed.
Update ID: 236
Failed to query: Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘igaPrimary’ in 'imageGroupAssoc’
(  =>  => ALTER TABLE
igaPrimaryENUM(‘0’,‘1’) NOT NULL  => ALTER TABLE
sgaPrimaryENUM(‘0’,‘1’) NOT NULL
igaPrimaryENUM(‘0’,‘1’) NOT NULL
For all to see and understand what’s happening.
1.3.0 had some strangeness I was unaware of. This things were:
- It had no error reporting on schema updates.
- Because of no error reporting, even a bad schema (bad sql) would appear as if all ran ok.
1.3.1 corrected these issues. Apparently at schema version point 136 and 140 there was an issue in creating the primary fields. These two schema versions handled the creation of imageGroupAssoc and snapinGroupAssoc.
These issues have been corrected for in 1.3.1 (and are of course present in 1.3.2). If you’re running into these issues, please open mysql and run:
ALTER TABLE `fog`.`imageGroupAssoc` ADD COLUMN `igaPrimary` ENUM('0','1') NOT NULL; ALTER TABLE `fog`.`snapinGroupAssoc` ADD COLUMN `sgaPrimary` ENUM('0','1') NOT NULL;
This would only pose a problem for those that were running on trunk builds that had a schema after these points. If either of them error on the command line (or in phpMyAdmin if that’s what you’re using) please just let me know. If you’re getting the Database ID 236 issue though, I’m pretty sure at the least the alter table of the igaPrimary above will work without any errors.
@sapeurorca Trying to hit you on chat.
Now fog it is in 1.3.1.
mysql> describe table imageGroupAssoc
Please post the contents of mysql:
describe table imageGroupAssoc
So I just installed FOG 1.2.0 “fresh” and then told it to update to 1.3.2.
I did not see the issue in regards to ID 236. I’m going to guess you may have been on a trunk version of fog? That or mysql is doing things fast, but php is passing it info even faster.
I don’t know what’s causing this, but if you can replicate would you mind hitting me up in chat? I’d really prefer to take a look at the database before upgrade so I might be able to figure out what’s causing this.
I, myself, cannot replicate. 1.2.0 -> 1.3.0 works. 1.2.0 -> 1.3.1 works. 1.2.0 -> 1.3.2 works.
sapeurorca last edited by sapeurorca
I went directly from V1.2.0 to V1.3.1, and i had an error of database.
Following your remark I tried to install the V1.3.0 and I installed the V1.3.1 and now the V1.3.2.
Installation is OK.
Thank you for your help.
I was on Ubuntu 13.10 and Fog 1.2.0. I updated Ubuntu in 16.04 and then I updated Fog in 1.3.1.
Now that Fog is in 1.3.1, how can I fix the error?
Are you sure you’re upgrading from 1.2.0?
1.2.0 would not have worked on Ubuntu 16.04 unless you knew what to change for PHP 7.
This seems to be more like an upgrade issue from one of the trunk releases (pre RC maybe) of 1.3.0 then an upgrade to 1.3.1.