OJS upgrade error on event_log_settings table, locale field

Hi,

I’m trying to upgrade OJS 3.2.1-4 to 3.4.0.8 but i get an error:

PHP Warning: Undefined property: stdClass::$locale in /ojs-3.4.0-8/lib/pkp/classes/migration/upgrade/PKPv3_3_0UpgradeMigration.php on line 905
ERROR: Upgrade failed: DB: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘locale’ in ‘WHERE’ (SQL: update event_log_settings set setting_value = “blabla” where setting_name = originalFileName and locale is null and log_id = 51166)

So, this was already asked in this post and @asmecher advised to do clean install. I did the clean install but i still get this error. @asmecher do you have some other hint? Should i add this field to the event_log_settings table and try again? Thx.

Regards,

Nino

Hi @orcalator,

Have you cleared your file cache before starting to run the upgrade? I suspect something is getting cached by the Doctrine schema inspection tools.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

By file cache you mean on “Clear Data Caches” and/or “Clear Template Cache”? I didn’t do that but i can try. I tried new 3.4.0-9 upgrade but same thing happened.

Regards,

Nino

So, i’m investigating this a bit further…

In PKPv3_3_0UpgradeMigration.php there is this function:

private function _settingsAsJSON()
 {
         $serializedSettings = $this->getSerializedSettings();
         $processedTables = [];
         foreach ($serializedSettings as $tableName => $settings) {
             $processedTables[] = $tableName;
             foreach ($settings as $setting) {
               DB::table($tableName)->where('setting_name', $setting)->get()->each(function ($row) use ($tableName) {
                    $this->_toJSON($row, $tableName, ['setting_name', 'locale'], 'setting_value');
                });
           }
        }

so:

$this->_toJSON($row, $tableName, [‘setting_name’, ‘locale’], ‘setting_value’);

is calling _toJSON with locale field parameter. That field doesn’t exist in 3.2.1-4 database, so i’m assuming upgrade should first add it or it should not call this function. Really don’t know what to do, i’m getting a bit frustrated since i’ve done at least 50 DB exports/imports, trying upgrade to intermediate versions 3.3.0-17 / 3.3.0-19, trying directly to 3.4.0-8 / 3.4.0-9, doing all sort of fixes but no go. Only thing that worked for me was upgrade from 3.2.1-4 to 3.3.0-17 to 3.4.0-8 but then we found out that there is a big bug with reviews described here so i had to revert all back to start.

Regards,

Nino

Hi @orcalator,

The odd thing about this is that the 3.2.1 to 3.4.0 upgrade path is well tested, including via our automated tests (see lines 8544 to 10352). What DBMS and version are you using?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

We are using MariaDB 10.11. My 3.2.1-4 DB is MyISAM DB so first thing i do is convert all tables to InnoDB using ALTER TABLE queries. After that i proceed to upgrade, but i’m stuck with this error. As i said, only way i found it to work is to upgrade first to 3.3.0-17 (still MyISAM), then i do conversion to InnoDB and upgrade to 3.4.0-7. Theoretically i might try doing this and applying patches that will fix issues that have been found, but i’d rather not do that.

Regards,

Nino