Issue with Database (MariaDB) upgrade (failed from 3.2.1.3 to 3.3.0.2)

Hey there,

I updated the software from 3.2.1.3 to 3.3.0.2.
When it has been the time of upgrading the db,

I receive this error:

$ php /tools/upgrade.php upgrade

[pre-install]
[load: upgrade.xml]
[version: 3.3.0.2]
[code: Installer Installer::checkPhpVersion]
[code: Installer Installer::installDefaultNavigationMenus]
WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
[migration: PKPv3_3_0UpgradeMigration]
ERROR: Upgrade failed: DB: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'url' in 'field list' (SQL: select `url`, `navigation_menu_item_id` from `navigation_menu_items` where `context_id` = 1)

Could you help to fix it?

p.s.

$ php /tools/upgrade.php check

Code version:      3.3.0.2
Database version:  3.2.1.3
Latest version:    3.3.0.2
1 Like

Hi @ross_s,

Is it possible that you’re trying to run an upgrade a second time after the first attempt failed? If an upgrade attempt fails, you’ll need to restore the database from backup before trying again.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher

The new version software by this link: https://pkp.sfu.ca/ojs/download/ojs-3.3.0.tar.gz

$ php patch/to/tools/upgrade.php upgrade

… and something like:

[pre-install]
[load: upgrade.xml]
[version: 3.3.0.2]
[code: Installer Installer::checkPhpVersion]
[code: Installer Installer::installDefaultNavigationMenus]
WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
[migration: PKPv3_3_0UpgradeMigration]
Removing orphaned submission_files entry ID 2 with submission_id 2
Removing orphaned submission_files entry ID 3 with submission_id 2
Removing orphaned submission_files entry ID 4 with submission_id 2
Removing orphaned submission_files entry ID 42 with submission_id 10
PHP Warning:  array_values() expects parameter 1 to be array, null given in /var/www/patch/to/lib/pkp/classes/migration/upgrade/PKPv3_3_0UpgradeMigration.inc.php on line 187
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Illuminate\Database\Query\Builder::cleanBindings() must be of the type array, null given, called in /var/www/patch/to/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php on line 919 and defined in /var/www/patch/to/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3088
Stack trace:
#0 /var/www/patch/to/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(919): Illuminate\Database\Query\Builder->cleanBindings()
#1 /var/www/patch/to/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(946): Illuminate\Database\Query\Builder->whereIn()
#2 /var/www/patch/to/lib/pkp/classes/migration/upgrade/PKPv3_3_0UpgradeMigration.inc.php(191): Illuminate\Database\Query\Builder->whereNotIn()
#3 /var/www/patch/to/lib/pkp/classes/install/Installer.inc.php(405): PKPv3_3_0UpgradeMigration->up()
#4 /var/www/patch/to/lib/pkp/classes/install/Installer.in in /var/www/patch/to/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php on line 3088

Also in the browser I have “HTTP ERROR 500”

… something like about my Databases

MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| ojs                |
| performance_schema |
+--------------------+
4 rows in set (0.001 sec)

When I try to restore my Database “ojs”

$ mysql -u [user] -p [database_name] < /patch/to/db-backup.sql

I got this error:

ERROR 1005 (HY000) at line 2666: Can't create table `ojs`.`submission_files` (errno: 150 "Foreign key constraint is incorrectly formed")

Hi @ross_s,

See: Upgrade to 3.3.0.2 fails when a journal has no supportedFormLocales · Issue #6710 · pkp/pkp-lib · GitHub

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher, Thank you for your advice! Applied these comments [stable-3_3_0] pkp/pkp-lib#6710 upgrade unused journal/press localized settings by Vitaliy-1 · Pull Request #6721 · pkp/pkp-lib · GitHub helped to make updates successfully up to 3.3.0.2.

(just replaced line 179-195 from the file pkp-lib/PKPv3_3_0UpgradeMigration.inc.php at d01d26e7a43daa83db77a7811f9148fc8c66eba9 · pkp/pkp-lib · GitHub in to /ojs-3.3.0/lib/pkp/classes/migration/upgrade/PKPv3_3_0UpgradeMigration.inc.php)

But I got just three warning messages:

WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.

Could you provide any solutions for resolve these warnings messages?

Thank you again for your help!
Best,
Rostysav

@asmecher Unfortunately HTTP ERROR 500 still present ;(
The error log indicated that the errors related with custom theme in the plugin module.
The default theme work, but access to “Administration” denied or “404 Not Found”
Also, static pages disappeared.

Hi @ross_s,

What are the log entries for the 500 errors you’re still encountering?

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher This error related to custom theme. In my case the custom theme use DAO library. I think the new version (3.3.0) use Laravel/Illuminate library. Is it correct about Laravel/Illuminate library? Thanks! Ross

Hi @ross_s,

Yes, the new release depends a lot more on Illuminate/Database. See the 3.3 Release Notebook for details on how database interaction might need to be adjusted.

Regards,
Alec Smecher
Public Knowledge Project Team