I get plugin/theme error when I upgraded OJS from 3.3.0-20 to stable-3.4 using docker

Some urls to give a try (although I don’t hold out much hope that this will solve anything for us)

  1. Theme selection config page: /management/settings/website#appearance
  • Try changing the theme to “default”.
  1. Back issues page: /manageIssues#back
  • Be sure you have an issue set as “Current issue”.
  1. Submissions list: /submissions
  • Check if you can reach your submissions.
  1. Administration: /index/admin
  • Try reaching journal settings (theme) from there. Also an easier way to clear cache.

If you can reach your DB (I suggest you using adminer because is like a phpmyadmin in a single php file that you only need to upload and then REMOVE), we can try to change your theme from pragma to default.

But please, be sure you backup your OJS (DB, files and configs) before making any change in your DB.

So, once your backup is secured and your adminer.php uploaded, the query to reset all your journals to default should be something like:

UPDATE `journal_settings` SET
`setting_value` = 'default'
WHERE `setting_name` = 'themePluginPath'
AND `setting_value` = 'pragma';

After this, clean your server’s and client cache and let’s see what happens.
If still fails, forward your log with the error.

Cheers,
m.

I executed the SQL command through adminer and restarted docker container. Still I get the same error.

[Fri May 30 13:32:28.575265 2025] [php:notice] [pid 20:tid 20] [client 172.20.0.1:34880] Missing locale key “{$loggedInUsername}” for the locale “en”
[Fri May 30 13:32:28.576608 2025] [php:error] [pid 20:tid 20] [client 172.20.0.1:34880] PHP Fatal error: Uncaught Error: Call to a member function getOption() on null in /var/www/html/cache/t_compile/00a0a091
0209607cb33eb0fe6474f30ed7399ed7^e64e579388e5615e11e939b12134d6ae8679eba6_0.app.frontendpagesindexJournal.tpl.php:36\nStack trace:\n#0 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_temp
late_resource_base.php(123): content_68399726e39365_81543118()\n#1 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTe
mplateCode()\n#2 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render()\n#3 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sys
plugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render()\n#4 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_Templ
ateBase->_execute()\n#5 /var/www/html/lib/pkp/classes/template/PKPTemplateManager.php(1373): Smarty_Internal_TemplateBase->display()\n#6 /var/www/html/pages/index/IndexHandler.php(83): PKP\template\PKPTempla
teManager->display()\n#7 [internal function]: APP\pages\index\IndexHandler->index()\n#8 /var/www/html/lib/pkp/classes/core/PKPRouter.php(334): call_user_func()\n#9 /var/www/html/lib/pkp/classes/core/PKPPage
Router.php(278): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest()\n#10 /var/www/html/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPPageRouter->route()\n#11 /var/www/html/lib/pkp/classes/cor
e/PKPApplication.php(395): PKP\core\Dispatcher->dispatch()\n#12 /var/www/html/index.php(21): PKP\core\PKPApplication->execute()\n#13 {main}\n thrown in /var/www/html/cache/t_compile/00a0a0910209607cb33eb0
fe6474f30ed7399ed7^e64e579388e5615e11e939b12134d6ae8679eba6_0.app.frontendpagesindexJournal.tpl.php on line 36

Through URL I tried to upgrade pragma theme in the plugin gallery.

API call gives 500 error

ojs_app_readingarchive      | 172.20.0.1 - - [30/May/2025:13:51:03 +0200] "POST /ria/$$$call$$$/grid/plugins/plugin-gallery-grid/upgrade-plugin?rowId=60 HTTP/1.0" 500 - "https://readingarchive.janastu.org/ria/management/settings/website" "Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"

App logs

[Fri May 30 13:52:13.911068 2025] [php:error] [pid 21:tid 21] [client 172.20.0.1:45650] PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'context_id' cannot
be null in /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php:570\nStack trace:\n#0 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection
.php(570): PDOStatement->execute()\n#1 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}()\n#2 /v
ar/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(720): Illuminate\\Database\\Connection->runQueryCallback()\n#3 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Ill
uminate/Database/Connection.php(577): Illuminate\\Database\\Connection->run()\n#4 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(469): Illuminate\\Database\\Conn
ection->affectingStatement()\n#5 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): Illuminate\\Database\\DatabaseManager->__call()\n#6 /var/www/html/lib/pkp/cla
sses/db/DAO.php(179): Illuminate\\Support\\Facades\\Facade::__callStatic()\n#7 /var/www/html/lib/pkp/classes/notification/NotificationDAO.php(150): PKP\\db\\DAO->update()\n#8 /var/www/html/lib/pkp/classes/noti
fication/PKPNotificationOperationManager.php(206): PKP\\notification\\NotificationDAO->insertObject()\n#9 /var/www/html/lib/pkp/controllers/grid/plugins/PluginGalleryGridHandler.php(344): PKP\\notification\\PK
PNotificationOperationManager->createTrivialNotification()\n#10 /var/www/html/lib/pkp/controllers/grid/plugins/PluginGalleryGridHandler.php(276): PKP\\controllers\\grid\\plugins\\PluginGalleryGridHandler->inst
allPlugin()\n#11 [internal function]: PKP\\controllers\\grid\\plugins\\PluginGalleryGridHandler->upgradePlugin()\n#12 /var/www/html/lib/pkp/classes/core/PKPRouter.php(334): call_user_func()\n#13 /var/www/html/
lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\\core\\PKPRouter->_authorizeInitializeAndCallRequest()\n#14 /var/www/html/lib/pkp/classes/core/Dispatcher.php(165): PKP\\core\\PKPComponentRouter->route()\
n#15 /var/www/html/lib/pkp/classes/core/PKPApplication.php(395): PKP\\core\\Dispatcher->dispatch()\n#16 /var/www/html/index.php(21): PKP\\core\\PKPApplication->execute()\n#17 {main}\n\nNext Illuminate\\Databas
e\\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'context_id' cannot be null (SQL: INSERT INTO notifications\n\t\t\t\t\t(user_id, level, date_created, context_id, type, assoc_typ
e, assoc_id)\n\t\t\t\tVALUES\n\t\t\t\t\t(1, 1, '2025-05-30 11:52:13', ?, 3, 0, 0)) in /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760\nStack trace:\n#0 /var/www/ht
ml/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(720): Illuminate\\Database\\Connection->runQueryCallback()\n#1 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/D
atabase/Connection.php(577): Illuminate\\Database\\Connection->run()\n#2 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(469): Illuminate\\Database\\Connection->a
ffectingStatement()\n#3 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): Illuminate\\Database\\DatabaseManager->__call()\n#4 /var/www/html/lib/pkp/classes/db/D
AO.php(179): Illuminate\\Support\\Facades\\Facade::__callStatic()\n#5 /var/www/html/lib/pkp/classes/notification/NotificationDAO.php(150): PKP\\db\\DAO->update()\n#6 /var/www/html/lib/pkp/classes/notification/
PKPNotificationOperationManager.php(206): PKP\\notification\\NotificationDAO->insertObject()\n#7 /var/www/html/lib/pkp/controllers/grid/plugins/PluginGalleryGridHandler.php(344): PKP\\notification\\PKPNotifica
tionOperationManager->createTrivialNotification()\n#8 /var/www/html/lib/pkp/controllers/grid/plugins/PluginGalleryGridHandler.php(276): PKP\\controllers\\grid\\plugins\\PluginGalleryGridHandler->installPlugin(
)\n#9 [internal function]: PKP\\controllers\\grid\\plugins\\PluginGalleryGridHandler->upgradePlugin()\n#10 /var/www/html/lib/pkp/classes/core/PKPRouter.php(334): call_user_func()\n#11 /var/www/html/lib/pkp/cla
sses/core/PKPComponentRouter.php(291): PKP\\core\\PKPRouter->_authorizeInitializeAndCallRequest()\n#12 /var/www/html/lib/pkp/classes/core/Dispatcher.php(165): PKP\\core\\PKPComponentRouter->route()\n#13 /var/w
ww/html/lib/pkp/classes/core/PKPApplication.php(395): PKP\\core\\Dispatcher->dispatch()\n#14 /var/www/html/index.php(21): PKP\\core\\PKPApplication->execute()\n#15 {main}\n thrown in /var/www/html/lib/pkp/lib
/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 760, referer: https://readingarchive.janastu.org/ria/management/settings/website

and I shows 3.3 even when i use 3.4 docker image

@marc @kaitlin @asmecher

https://readingarchive.janastu.org/ria/index

Now many words are in Arabic. Even though the language settings was English and Hindi.

many api calls gives 500 error. like submissions, plugin updates, etc

Looks like you replaced the code to OJS 3.4, but you never upgraded the installation.

To confirm this is the issue, please run and post the output of:

docker compose exec ojs php tools/upgrade.php check

Cheers,
m.

Code version: 3.4.0.9
Database version: 3.3.0.20
Latest version: 3.4.0.9
Database version is older than code version
Run “tools/upgrade.php upgrade” to update

Should I have to run upgrade now?

1 Like

Exactly. As you see, your code is 3.4 but your BD is 3.3 so the errors came from this discrepancy.

Now that your code is 3.4, you only need to upgrade the DB and files.

IMPORTANT: Be sure you backup your files, DB and configs (hopefully you did before).

Then, you can safely upgrade with with:

docker compose exec ojs php -d memory_limit=2G php tools/upgrade.php upgrade

(or with docker exec or with a login into the ojs container and running the upgrade command).

Notice I extended the memory php can use to 2G, to be sure you don’t reach any limits.

Cheers,
m.

/var/www/html # php -d memory_limit=2G php tools/upgrade.php upgrade
Could not open input file: php
/var/www/html # php tools/upgrade.php upgrade
2025-06-01 07:27:42 [pre-install]
2025-06-01 07:27:42 [load: upgrade.xml]
2025-06-01 07:27:42 [version: 3.4.0.9]
2025-06-01 07:27:42 [code: Installer Installer::checkPhpVersion]
2025-06-01 07:27:42 [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.
2025-06-01 07:27:42 [code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
2025-06-01 07:27:42 [migration: PKP\migration\upgrade\v3_4_0\I10249_FixProfileImageDataLoss]
2025-06-01 07:27:42 [migration: APP\migration\upgrade\v3_4_0\PreflightCheckMigration]
2025-06-01 07:27:44 [Cleaning orphaned entries from “submission_files” with an invalid value for the column “source_submission_file_id”. The following IDs do not exist at the reference table “submission_files” and will be reset to NULL:
1]
2025-06-01 07:27:44 [1 entries updated]
2025-06-01 07:27:44 [Cleaning orphaned entries from “submission_files” with an invalid value for the column “genre_id”. The following IDs do not exist at the reference table “genres” and will be reset to NULL:
0]
2025-06-01 07:27:44 [6 entries updated]
2025-06-01 07:27:44 [Cleaning orphaned entries from “sections” with an invalid value for the column “review_form_id”. The following IDs do not exist at the reference table “review_forms” and will be reset to NULL:
0]
2025-06-01 07:27:44 [8 entries updated]
2025-06-01 07:27:44 [migration: PKP\migration\upgrade\v3_4_0\I8060_UpdateUserLocalesDefaultToEmptyArrayFromNull]
2025-06-01 07:27:45 [migration: PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString]
2025-06-01 07:27:47 [migration: APP\migration\upgrade\v3_4_0\I7129_IssueEntityDAORefactor]
2025-06-01 07:27:49 [migration: APP\migration\upgrade\v3_4_0\I6091_AddFilterNamespaces]
2025-06-01 07:27:50 [revert migration: APP\migration\upgrade\v3_4_0\I7129_IssueEntityDAORefactor]
2025-06-01 07:27:51 [revert migration: PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString]
2025-06-01 07:27:51 [downgrade for “PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString” unsupported: Downgrade not supported]
ERROR: Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘PKP\task\ReviewReminder’ for key ‘scheduled_tasks_pkey’ (SQL: UPDATE scheduled_tasks SET class_name = PKP\task\ReviewReminder WHERE class_name = lib.pkp.classes.task.ReviewReminder)
/var/www/html #

Hey @marc @kaitlin @asmecher

Migration script was trying to change the class_names and since migration didnt happen completely. I got a lot of duplicate entry error. I was trying to resolve it manually in the db and then I got this issue which I think I need your attention to resolve it.

/var/www/html # php tools/upgrade.php upgrade

2025-06-04 12:43:02 [pre-install]

2025-06-04 12:43:02 [load: upgrade.xml]

2025-06-04 12:43:02 [version: 3.4.0.9]

2025-06-04 12:43:02 [code: Installer Installer::checkPhpVersion]

2025-06-04 12:43:02 [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.

2025-06-04 12:43:02 [code: Installer Installer::migrateStaticPagesToNavigationMenuItems]

2025-06-04 12:43:02 [migration: PKP\migration\upgrade\v3_4_0\I10249_FixProfileImageDataLoss]

2025-06-04 12:43:02 [migration: APP\migration\upgrade\v3_4_0\PreflightCheckMigration]

2025-06-04 12:43:02 [Removing orphaned announcement type ID 1 with no matching context ID.]

2025-06-04 12:43:03 [Removing orphaned announcement type ID 2 with no matching context ID.]

2025-06-04 12:43:03 [Removing orphaned announcement type ID 3 with no matching context ID.]

2025-06-04 12:43:03 [migration: PKP\migration\upgrade\v3_4_0\I8060_UpdateUserLocalesDefaultToEmptyArrayFromNull]

2025-06-04 12:43:03 [migration: PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString]

2025-06-04 12:43:03 [migration: APP\migration\upgrade\v3_4_0\I7129_IssueEntityDAORefactor]

2025-06-04 12:43:03 [revert migration: PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString]

2025-06-04 12:43:03 [downgrade for “PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString” unsupported: Downgrade not supported]

ERROR: Upgrade failed: DB: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘current_issue_id’ (SQL: alter table journals add current_issue_id bigint null)

/var/www/html #

DESCRIBE journals
Field Type Null Key Default Extra
journal_id bigint(20) NO PRI NULL auto_increment
path varchar(32) NO UNI NULL
seq double(8,2) NO 0.00
primary_locale varchar(14) NO NULL
enabled smallint(6) NO 1
current_issue_id bigint(20) YES MUL NULL

Hi Mouhamed,

By duplicates, you mean messages like this?

ERROR: Upgrade failed: DB: SQLSTATE[42S21]: 
Column already exists: 1060 Duplicate column name ‘current_issue_id’ (SQL: alter table journals add current_issue_id bigint null)

Those errors are not normal and from my experience, it usually happens when you are trying to upgrade a broken OJS or something is wrong in your dump.

So, before trying to modify the DB by your own, please rollback to your last backup (config, database and files) and be sure all works fine with 3.3.0-20.

Once you are back to 3.3, run this to check:

docker compose exec ojs php php tools/upgrade.php check > ojs33.log;
docker compose exec ojs php -d memory_limit=2G php tools/upgrade.php check >> ojs33.log;

Upload the resulting ojs33.log file to https://filebin.net (or wherever you like) and post the link here.

After this, ONLY IF you are sure all goes well with 3.3, try to upgrade again to 3.4 with but with the following commands:

  1. Edit your docker-compose.yml to be sure you are running stable-3_4_0 image (or 3_4_0-9 if you prefer using pinned versions).
  2. Download the new config.inc.php.TEMPLATE for 3.4 and adapt with your own data (or modify your former config.inc.php to include the new 3.4 vars).
  3. Pull the last image with docker compose pull
  4. Restart your containers to run the new code docker compose down && docker compose up -d
  5. Check your versions with docker compose exec ojs php php tools/upgrade.php check > ojs34.log;
  6. Upgrade your system with docker compose exec ojs php -d memory_limit=-1 php tools/upgrade.php check >> ojs34.log;

Upload the resulting ojs34.log file to https://filebin.net (or wherever you like) and post the link here.

Cheers,
m.

Hey @marc

This is the error I get when i try to do docker compose exec ojs php -d memory_limit=-1 tools/upgrade.php upgrade > ojs34.log

2025-06-08 10:05:00 [migration: PKP\migration\upgrade\v3_4_0\I8060_UpdateUserLocalesDefaultToEmptyArrayFromNull]
2025-06-08 10:05:01 [migration: PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString]
2025-06-08 10:05:03 [migration: APP\migration\upgrade\v3_4_0\I7129_IssueEntityDAORefactor]
2025-06-08 10:05:05 [migration: APP\migration\upgrade\v3_4_0\I6091_AddFilterNamespaces]
2025-06-08 10:05:06 [revert migration: APP\migration\upgrade\v3_4_0\I7129_IssueEntityDAORefactor]
2025-06-08 10:05:07 [revert migration: PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString]
2025-06-08 10:05:07 [downgrade for “PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString” unsupported: Downgrade not supported]
ERROR: Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘PKP\task\ReviewReminder’ for key ‘scheduled_tasks_pkey’ (SQL: UPDATE scheduled_tasks SET class_name = PKP\task\ReviewReminder WHERE class_name = lib.pkp.classes.task.ReviewReminder)

full log is here
https://filebin.net/8pb1db436fsz4dzu

@marc @asmecher @kaitlin

hey,

any suggestions for this ?