Error when trying to upgrade OJS from 2.4.8.0 to 3.3.0-7 or 3.2.1-1

Hi.

I am trying to directly upgrade an OJS currently on version 2.4.8.0 to version 3.3.0-7, but then I hit this:

$ php tools/upgrade.php check
PHP Fatal error:  Uncaught PDOException: SQLSTATE[42703]: Undefined column: 7 ERROR:  column "context_id" does not exist
LINE 1: ...e FROM plugin_settings WHERE plugin_name = $1 AND context_id...
                                                             ^ in /var/www/ojs-3.3.0-7/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115
Stack trace:
#0 /var/www/ojs-3.3.0-7/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute()
#1 /var/www/ojs-3.3.0-7/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(370): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /var/www/ojs-3.3.0-7/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}()
#3 /var/www/ojs-3.3.0-7/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback()
#4 /var/www/ojs-3.3.0-7/lib/pkp/lib/vendor/laravel/framework in /var/www/ojs-3.3.0-7/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671

Note that it’s failing even with a “php tools/upgrade.php check”.

Then I did try with 3.2.1-1.
It properly starts to upgrade but fails with another problem at the middle of the process:

$ php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.2.1.1]
[code: Installer Installer::checkPhpVersion]
[code: Installer Installer::syncSeriesAssocType]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics2.xml (skipped)]
[code: Installer Installer::removeReviewEntries]
[data: dbscripts/xml/upgrade/3.0.0_preupdate.xml]
[data: dbscripts/xml/upgrade/3.0.0_adaptTimedViews.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_adaptReferrals.xml]
[data: dbscripts/xml/upgrade/3.0.0_adaptBooksForReview.xml]
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_preupdate_commentsToEditor.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.xml]
[data: dbscripts/xml/upgrade/3.1.1_preupdate_citations.xml]
[data: dbscripts/xml/upgrade/3.1.2_preupdate_user_author_names.xml]
[code: Installer Installer::migrateSubmissionCoverImages]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_email_templates.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning_articleGalleySettings.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_last_activity.xml]
[data: dbscripts/xml/upgrade/3.2.1_preupdate_subeditor_categories.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/submissionFiles.xml]
[schema: lib/pkp/xml/schema/categories.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/genres.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/libraryFiles.xml]
[schema: lib/pkp/xml/schema/navigationMenus.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]
[code: Installer Installer::installDefaultNavigationMenus]
[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
[code: Installer Installer::migrateSRLocale]
[code: Installer Installer::migrateUserAndAuthorNames]
[code: Installer Installer::concatenateIntoAbout]
[code: Installer Installer::concatenateIntoMasthead]
[code: Installer Installer::migrateCounterPluginUsageStatistics (skipped)]
[code: Installer Installer::migrateTimedViewsUsageStatistics (skipped)]
[code: Installer Installer::migrateDefaultUsageStatistics (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postUsageStatsMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postUsageStatsMigration2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postCounterMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postTimedViewsMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_change_assoc_type.xml]
[data: dbscripts/xml/upgrade/3.0.0_change_assoc_type_metrics.xml]
[data: dbscripts/xml/upgrade/3.0.0_settings.xml]
[code: Installer Installer::installDefaultGenres]
[code: Installer Installer::migrateArticleMetadata]
PHP Fatal error:  Uncaught Error: Call to a member function getId() on null in /var/www/ojs-3.2.1-1/lib/pkp/classes/submission/SubmissionLanguageDAO.inc.php:118
Stack trace:
#0 /var/www/ojs-3.2.1-1/classes/install/Upgrade.inc.php(245): SubmissionLanguageDAO->insertLanguages()
#1 /var/www/ojs-3.2.1-1/lib/pkp/classes/install/Installer.inc.php(417): Upgrade->migrateArticleMetadata()
#2 /var/www/ojs-3.2.1-1/lib/pkp/classes/install/Installer.inc.php(263): Installer->executeAction()
#3 /var/www/ojs-3.2.1-1/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#4 /var/www/ojs-3.2.1-1/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#5 /var/www/ojs-3.2.1-1/lib/pkp/classes/cliTool/UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#6 /var/www/ojs-3.2.1-1/tools/upgrade.php(22): UpgradeTool->execute()
#7 {main}
  thrown in /var/www/ojs-3.2.1-1/lib/pkp/classes/submission/SubmissionLanguageDAO.inc.php on line 118

And I don’t know what should I do here.

Can someone shed some light on how to solve either of the 2 problems, if possible, please?

Thank you!

Hi @naoliv

Unfortunately, it is not possible to upgrade directly from OJS 2.4.x to OJS 3.3.x, it is required a middle step in between. I would recommend that you first give a try upgrading to the latest version of OJS 3.1 => 3.1.2.4, then go to the latest OJS 3.3.

It seems that one of your submission or submission metadata is missing the language/locale info. Could you please check your database, table articles, and check whether you have any value in the column “locale” with a “NULL”?

Best,
Israel Cefrin
PKP Team

1 Like

SELECT * FROM articles WHERE locale IS NULL; is returning 0 results.
Could this be coming from somewhere else?

And I will give a try with series 3.1.

Thanks!