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

[Thu May 15 20:47:17.812497 2025] [php:error] [pid 17:tid 17] [client 172.20.0.1:49184] PHP Fatal error: Uncaught Error: Call to a member function getOption() on null in /var/www/html/cache/t_compile/00a0a0910209607cb33eb0fe6474f30ed7399ed7^e64e579388e5615e11e939b12134d6ae8679eba6_0.app.frontendpagesindexJournal.tpl.php:36\nStack trace:\n#0 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_682636b5bf4ba2_60849309()\n#1 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()\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/sysplugins/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_TemplateBase->_execute()\n#5 /var/www/html/lib/pkp/classes/template/PKPTemplateManager.php(1372): Smarty_Internal_TemplateBase->display()\n#6 /var/www/html/pages/index/IndexHandler.php(83): PKP\template\PKPTemplateManager->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/PKPPageRouter.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/core/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/00a0a0910209607cb33eb0fe6474f30ed7399ed7^e64e579388e5615e11e939b12134d6ae8679eba6_0.app.frontendpagesindexJournal.tpl.php on line 36

this is the error message

OJS_IMAGE=ojs
OJS_VERSION=stable-3_4_0

Hosted using docker

ojs:
  image: "pkpofficial/${OJS_IMAGE:-ojs}:${OJS_VERSION:-latest}"
  env_file:
    - .env
  container_name: "ojs_app_${COMPOSE_PROJECT_NAME:-demo}"
  hostname: "${COMPOSE_PROJECT_NAME:-demo}"
  ports:
    - "${HTTP_PORT:-8081}:80"
    - "${HTTPS_PORT:-443}:443"
  volumes:
    - /etc/localtime:/etc/localtime
    - ./volumes/private:/var/www/files
    - ./volumes/public:/var/www/html/public
    - ./volumes/logs/app:/var/log/apache2
    - ./volumes/config/ojs.config.inc.php:/var/www/html/config.inc.php
    - ./volumes/config/apache.htaccess:/var/www/html/.htaccess
    - ./volumes/php.custom.ini:/usr/local/etc/php/conf.d/custom.ini

  networks:
    - inside
  depends_on:
    - db
  restart: unless-stopped

I use ojs pragma theme

Steps to Reproduce

Host using docker compose
and try to upgrade from 3.3 to 3.4 and you may get Php mailer error and since 3.4 uses lavedel system, once you change the config you may get this error.
I use ojs pragma theme

I raised this issue in the github repo. They asked me to upgrade the theme in the plugin gallery but the problem is app itself is not starting in the docker container. I dont know to upgrade the theme manually.
https://github.com/pkp/pkp-lib/issues/11396

Hi @Mouhamed_Noordeen, I don’t have much docker experience so I can’t speak to the specifics of docker issues, but if you can replace your existing theme (usually located in your OJS directory under plugins/themes/pragma) with the latest release files for 3.4, that may resolve this for you.

Here’s the latest 3.4 release (the tar.gz file): Release 1.1.2.2 · pkp/pragma · GitHub

1 Like

Hi!

I’m the one that is maintaining the oficial docker images.

The error it’s wired because you don’t have the plugins folder mapped as a persistent volume so the image should include the pragma theme relased with ojs.

Didn’t have much time tomorrow but I will check the upgrade issue on Monday.

But please @Mouhamed_Noordeen if you can try the solution proposed by Kaitlin, it will let us know if there is a problem with the image and it need to be rebuilt.

To do this, you only need to log intro the container with docker exec or even easier:

docker compose exec ojs sh

Inside the image, you will be able to download the pragma plugin manually (with curl) and uncompress it in the themes folder.

Let me know if you need help with that.

BTW, new 3.3.0-21 will be released tomorrow, so if we can confirm there is a problem with the prama theme included in the image, it’s a great oportunity to fix it.

Cheers,
m.

Hey @kaitlin @marc Thanking you for responding.

I checked the container. Under plugin/themes/ there is only default directory and no pragma directory, so I added pragma like @kaitlin said. Still I get the same error.

[Sat May 24 11:05:46.817614 2025] [php:error] [pid 408:tid 408] [client 172.20.0.1:59102] PHP Fatal error: Uncaught Error: Call to a member function getOption() on null in /var/www/html/cache/t_compile/00a0a0
910209607cb33eb0fe6474f30ed7399ed7^e64e579388e5615e11e939b12134d6ae8679eba6_0.app.frontendpagesindexJournal.tpl.php:36\nStack trace:\n#0 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_te
mplate_resource_base.php(123): content_682636b5bf4ba2_60849309()\n#1 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRendered
TemplateCode()\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/s
ysplugins/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_Tem
plateBase->_execute()\n#5 /var/www/html/lib/pkp/classes/template/PKPTemplateManager.php(1372): Smarty_Internal_TemplateBase->display()\n#6 /var/www/html/pages/index/IndexHandler.php(83): PKP\\template\\PKPTemp
lateManager->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/PKPPa
geRouter.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/c
ore/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/00a0a0910209607cb33e
b0fe6474f30ed7399ed7^e64e579388e5615e11e939b12134d6ae8679eba6_0.app.frontendpagesindexJournal.tpl.php on line 36

Hi @Mouhamed_Noordeen, can you also try deleting the cached files (e.g. all the files in the directory /var/www/html/cache/t_compile/) and see if that helps?

Nope. I removed the all the file in t_complie. I still get the same error. I get 500 error and new file are generated in t_complie.


Hi all,

I think we can quickly and easily make OJS/OMP/OPS resilient to situations where theme plugins are expected but not available; there are only a couple of calls that result in fatal errors like this. I’ll re-open I get plugin/theme error when I upgraded OJS from 3.3 to 3.4 · Issue #11396 · pkp/pkp-lib · GitHub and add a couple proposed PRs there.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher. @marc Does new patches included in the official docker images? if yes, I can deploy and see if it resolves my issues.

Hi @Mouhamed_Noordeen

I hope I will be able to work on 3.3.0-21 images today (sorry for the delay. I got the flu).

As usual, the images will be released with exactly the same code tagged with this version number (it need to be this way for consistency) so, if you are asking about the patches created by Alec 19 hours ago, I’m sorry but they won’t be included because 3.3.0-21 was released last Friday.

You can apply those specific patches manualy inside your container or (if you like to have a permanent solution) “map” the modified files creating a file-volume.

As far I can see from this thread, the patch created by Alec is to make ojs resilent when you don’t have the right plugins so… why not exploring this part first?

If I understood the problem is you installation don’t include pragma plugin. Two things I would check:

  1. Confirm the plugin is in the plugins/theme/pragma folder and it’s updated to last version.
  2. Change your DB to load the default plugin instead of the pragma one.

If we have problems with more plugins, we can fix them one by one.

Cheers,
m.

I changed ojs version from 3.3.0-20 to stable-3.4.0. and did docker compose pull and up. Since then, My app is down.

I checked docker logs shows 500 status code error.
ojs_app_readingarchive | 172.20.0.1 - - [28/May/2025:14:49:38 +0200] “GET /ria HTTP/1.0” 500 - “-” “Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0”

and then i checked app logs and showed that php fatal error.

I checked /plugin/themes/ and pragma theme was missing and I did curl the latest pragma themes and still it wasnt fixed.

I dont know how to change the db in OJS. if you can guide me or if there is any document to change themes in the DB or to revert back OJS to previous version, would be useful to bring back the app.

Thanks

Do you have a backup of your DB and files to rollback to 3.3.0-20 till I got time to check if something is wrong in 3.4.0?

BTW, docker images for 3.3.0-21 are now available in dockerHub.
Building 3.4 ones right now.

There is some problem with backup. Thats why I want to revert manually in the DB.

Thats great. How much time does it take to build and test 3.4?

Hey @asmecher @kaitlin Do you think this new patch would fix my issue since even when I curl the latest pragma theme inside the container, it didnt fix it.

Hi @Mouhamed_Noordeen, yes this patch should resolve your issue as it will allow you to get past that error and then download the theme from the plugin gallery, which is usually how we recommend installing the theme plugins.

If you’d rather try to get the theme downloaded instead of the patch, can you outline the full steps you are following to download the theme?

@Mouhamed_Noordeen

Images built but not yet tested, so please backup what you have now to avoid losing anything.

@asmecher @kaitlin @marc I tested this new patch.

I still get the 500 status code and same php fatal error.

I checked the plugin/themes. Pragma wasnt there. I did curl the latest one and tried. Nothing changed.

Do I have to manually change the DB to set it to default?
or am I missing something?

thanks

Sorry for the delay with this @Mouhamed_Noordeen but till now I didn’t got time to check.

I have only been able to do a few quick tests.
Tomorrow I will follow up on your answer.

From my tests:

  • I confirm that the pragma theme is not included in the docker images (because actually it is not included in the original release either).
  • I was able to upgrade from 3.3 to 3.4 without problems.

Some doubts I still have:

  • Can you access your ojs backend (index.php/index/login) or do you always get error 500?
    • If you can access the backend… try changing the theme to default there and see what happens.
  • Can you access your database with adminer or phpmysadmin?
    • If you can access the database, try changing the theme from “pragma” to “default”, clear cache and see if the error changes.

Read you tomorrow,
m.

Hi @Mouhamed_Noordeen,

Can you check your log and post the exact error message? It might be subtly different.

Regards,
Alec Smecher
Public Knowledge Project Team

app log

[Fri May 30 06:11:34.337322 2025] [php:error] [pid 19:tid 19] [client 172.20.0.1:60010] 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_6838cc29ac04a4_06619082()\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

[Fri May 30 06:11:34.336040 2025] [php:notice] [pid 19:tid 19] [client 172.20.0.1:60010] Missing locale key "{$loggedInUsername}" for the locale "en"

docker logs

ojs_app_readingarchive  | 172.20.0.1 - - [30/May/2025:06:11:28 +0200] "GET /ria HTTP/1.0" 500 - "-" "Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"
ojs_app_readingarchive  | 172.20.0.1 - - [30/May/2025:06:11:33 +0200] "GET /ria HTTP/1.0" 500 - "-" "Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"

@marc

  1. /index/login loads the page. Once logged in, it goes to the journal home page and gives 500 error. Can we share other URLs so that I can go there and try to change?

  2. Once the above step is not possible, I will try phpmysadmin