[OJS 3.5] PHP Fatal error on installation process

Hi awesome PKP team, I am installing OJS v3.5.0.0 using the docker official image and I found the following error after clicked the install button.

PHP Fatal error:  Uncaught AssertionError: assert(false) in /var/www/html/lib/pkp/classes/scheduledTask/ScheduledTask.php:67
Stack trace:
#0 /var/www/html/lib/pkp/classes/scheduledTask/ScheduledTask.php(67): assert(false, 'assert(false)')
#1 /var/www/html/lib/pkp/classes/install/Installer.php(957): PKP\\scheduledTask\\ScheduledTask->__construct()
#2 [internal function]: PKP\\install\\Installer->updateRorRegistryDataset(Object(APP\\install\\Install), Array)
#3 /var/www/html/lib/pkp/classes/install/Installer.php(491): call_user_func(Array, Object(APP\\install\\Install), Array)
#4 /var/www/html/lib/pkp/classes/install/Installer.php(298): PKP\\install\\Installer->executeAction(Array)
#5 /var/www/html/lib/pkp/classes/install/Installer.php(207): PKP\\install\\Installer->executeInstaller()
#6 /var/www/html/lib/pkp/classes/install/form/InstallForm.php(198): PKP\\install\\Installer->execute()
#7 /var/www/html/lib/pkp/pages/install/InstallHandler.php(93): PKP\\install\\form\\InstallForm->execute()
#8 [internal function]: PKP\\pages\\install\\InstallHandler->install(Array, Object(APP\\core\\Request))
#9 /var/www/html/lib/pkp/classes/core/PKPRouter.php(327): call_user_func(Array, Array, Object(APP\\core\\Request))
#10 /var/www/html/lib/pkp/classes/core/PKPPageRouter.php(249): PKP\\core\\PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(APP\\core\\Request), Array, false)
#11 /var/www/html/lib/pkp/classes/core/Dispatcher.php(157): PKP\\core\\PKPPageRouter->route(Object(APP\\core\\Request))
#12 /var/www/html/lib/pkp/classes/core/PKPApplication.php(426): PKP\\core\\Dispatcher->dispatch(Object(APP\\core\\Request))
#13 /var/www/html/index.php(21): PKP\\core\\PKPApplication->execute()
#14 {main}
  thrown in /var/www/html/lib/pkp/classes/scheduledTask/ScheduledTask.php on line 67, referer: http://servicioseditoriales.unam.mx:8087/index.php/index/en/install

I need to set up a previous requirement?

Hola Juan,

Tras crear la imagen probé de instalarla y no tuve ningún problema… pero el testing que hice es muy pobre (la 3.5 no es todavía LTS), así que puede ser que se me haya pasado algo.

Algunas preguntas:

  • Estás haciendo una instalaciĂłn limpia o un upgrade de un site existente?
  • Haces un build de la imagen o usas las de dockerHub?
  • Tienes algĂşn volumen bind (por ejemplo el de plugins) o son volĂşmenes que gestiona docker?

Por el error que reportas, parece que está instanciando la clase sheduledTasks directamente y por eso salta el asset, pero no acabo de entender como puede ser posible.

Lo Ăşnico que se me ocurre es que tengas plugins viejos.

Si puedes compartir tu docker-compose o darnos más info sobre el caso, le echo un ojo.

Un saludo,
m.

Hi @juancure,

This looks related to an issue that should already be corrected:

https://github.com/pkp/pkp-lib/issues/11171

I’ll ask the developer who worked on that to have a look.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hola que tal @marc estoy utlizando la imagen oficial disponible en dockerhub. Es una instalación limpia la que estoy realizando. También estoy utilizando la estructura de archivos que se encuentra disponibles en GitHub - pkp/docker-ojs: Open Journal Systems (OJS) is a journal management and publishing system.

Y el docker-compose.yml es el siguiente:


networks:
  inside:
    external: false

services:
  db:
    image: mariadb:11.4
    env_file:
      - .env
    container_name: "ojs_db_${COMPOSE_PROJECT_NAME:-demo}"
    environment:
      MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:-ojsPwd}"
      MYSQL_DATABASE: "${OJS_DB_NAME:-ojs}"
      MYSQL_USER: "${OJS_DB_USER:-ojs}"
      MYSQL_PASSWORD: "${OJS_DB_PASSWORD:-ojsPwd}"
    volumes:
      - ./volumes/db:/var/lib/mysql
      - ./volumes/db-import:/docker-entrypoint-initdb.d
      - ./volumes/logs/db:/var/log/mysql
      - ./volumes/config/db.charset.conf:/etc/mysql/conf.d/charset.cnf
    networks:
      - inside
    restart: unless-stopped

  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
#      # WARNING: You can only enable file-volumes if file exists in the container.
      - ./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

El archivo .env que estoy utilizando tiene lo siguiente:

# Set your journal Tag:
COMPOSE_PROJECT_NAME=journal
PROJECT_DOMAIN=journal.localhost
SERVERNAME=$PROJECT_DOMAIN

OJS_IMAGE=ojs
OJS_VERSION=3_5_0-0

# IMPORTANT: Set a non used port.
HTTP_PORT=8087
HTTPS_PORT=8487

# Remember this to fill your installation form in a clean installatio
# MYSQL_VERSION=10.3
MYSQL_ROOT_PASSWORD="xxxx"

# OJS variables
OJS_CLI_INSTALL=0
OJS_DB_HOST=db
OJS_DB_DRIVER=mysqli
OJS_DB_USER=ojs_user
OJS_DB_PASSWORD="xxxx"
OJS_DB_NAME=prueba_ojs3500

SĂłlo tengo los volumenes definidos en el docker-compose.yml.

Espero sea de utilidad, saludos.

1 Like

Hi the the line that point in the error log specify the for some reason , when need to generate the schedule take log and store it , it can not store it as unable to get the location or generate the proper folder in that location due to permission issue . it is possible to check what set in the config.inc.php for the files_dir of files settings configuration ? is that path available or writeable in the docker image ?

1 Like

Hi @marc and @touhidur

I tested building a local image using the GitLab repository and selecting the following Dockerfile: versions/stable-3_5_0/alpine/apache/php82/Dockerfile

I had to modify the Dockerfile to add the following line and avoid an error with php not found during the image building process.

Creating alias from php82 to php
RUN ln -s /usr/bin/php82 /usr/bin/php

Just above the ENV BUIILDERS

After that I got a built-in local image, so using this local image I set up the OJS within containers. I got the installation wizard process and I filled up all the form fields,

Finally the installation process finish successfully; however testing the OJS 3.5.0-0, I found that the user which was created in the installation process, doesn’t have the admin role, so I couldn’t create a new journal.

So I have some doubts:

Go inside the GitLab repository specifically the versions directory, there are 2 directories: 3_5_0rc2 and stable-3_5_0, what is the difference between them?

Is it possible that the docker oficial image pkpofficial/ojs:3_5_0-0 has missing something during it making process?

Is it possiblte to know why the admin user created during the installation process (using a local image) doesn’t have admin role?

Thanks in advance. Best regards.

Hi @juancure,

Regarding admin roles, you’re probably encountering this issue:

https://github.com/pkp/pkp-lib/issues/11532

There will be a patch there soon, and we’ll release a 3.5.0-1 build in the coming week or two including a fix.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Sorry for been late with this thread.
Weekend + holiday days in my country.

Happy to see you finally make it run. Some comments to clarify:

First, Juan I’m sorry but you are catching us in a middle of a migration.
gitLab repository is deprecated and we are moving all work to pkp/containers where the full project is been refactored. So please:

  • Don’t use gitLab images because they are not tested and suite for 3.5.
  • Use dockerHub or (if you like to build them) the Dockerfile in pkp/containers.

when need to generate the schedule take log and store it , it can not store it as unable to get the location or generate the proper folder in that location due to permission issue . it is possible to check what set in the config.inc.php for the files_dir of files settings configuration ? is that path available or writeable in the docker image ?

Anyway, this would be the first place to start. Did you check config and your files* variables are set and are writable by www-data user? Best way to ensure is jumping into the “ojs” container and make a recursive chown -R www-data:www-data /var/www/*.

I tested building a local image using the GitLab repository and selecting the following Dockerfile: versions/stable-3_5_0/alpine/apache/php82/Dockerfile

Added banners the different deprecated repos to avoid confusions.
Use this repo instead: GitHub - pkp/containers: OCI-compliant images for PKP applications

Finally the installation process finish successfully; however testing the OJS 3.5.0-0, I found that the user which was created in the installation process, doesn’t have the admin role, so I couldn’t create a new journal.

As said, nice you have the resources to make it run, but I won’t recommend use this method.
DockerHub is the easiest path and if you like to build your own images… use the pkp/containers repo instead.

Go inside the GitLab repository specifically the versions directory, there are 2 directories: 3_5_0rc2 and stable-3_5_0, what is the difference between them?

  • RC2 is the relase candidate.
  • stable-3_5_0 is an alias that will always point to the last stable version of the release (now 3.5.0-0… that is newer thatn 3_5_0rc2).

Is it possible that the docker oficial image pkpofficial/ojs:3_5_0-0 has missing something during it making process?

Sorry but I’m not catching you here. My guess is, if you got any error probably it’s because you use gitLab Dockerfile instead (that is deprecated) or you use the right DockerHub but you didn’t got the right permissions.

Is it possiblte to know why the admin user created during the installation process (using a local image) doesn’t have admin role?

Alec comment points this is a know issue: Install form time zone is not considered during initial installation · Issue #11532 · pkp/pkp-lib · GitHub
Take in consideration we are still in first stages of 3.5, so this kind of errors are usual.

Anything please, let us know.

Cheers,
m.

1 Like

Hi @marc thanks for your answers, now I understand what was my mistake.

Firstly I was using the docker hub oficial image for OJS 3.5.0.0 and following the documentation from docker hub page. When I set up the permissions for the directory private which maps to /var/www/files, I used the following from outside the containers:


chown 100:101 ./volumes -R
chown 999:999 ./volumes/db -R
chown 999:999 ./volumes/logs/db -R

But going inside the ojs container I noticed the web user (www-data) wasn’t set up as owner to files directory, instead was setting up Debian-exim as owner and crontab as group to files directory.

So I setting up the permissions with

chown -R www-data: /var/www/files
chown -R www-data: /var/www/html
chmod 777 /var/www/html/config.inc.php

After that finally I got the OJS 3.5.0.0 running on containers. I didn’t know about the pkp/containers repository, so it’s very important to me, because it’s very probable that I have to create my own local images to modify settings as for instance: integrating nginx and modsecurity as a security layer for deploying our journals here at UNAM or use postgreSQL because there are several journals which use this as database.

Now my team and me will explore the new features of OJS 3.5.0.0, hoping the LTS version, Thanks a lot for all the shared knowledge with us.

1 Like

I’m sorry to have caught you in the crossfire of image and repository changes.

I posted this a few days ago with a summary of the changes, but the documentation is not yet updated and unified for 3.5:

But give us a month to reorganize things a bit more, as (together with Jonr) we are responding to requests from the community that have been pending for years, and I am convinced that the improvement will be significant.

BTW, the pkp/containers repository is not yet public. We will communicate it properly as soon we finish with the refactoring.

Regarding building your images, I usually ask first to what extent it is necessary (can’t you solve it with a file-volume?), of if you could build upon the existing official image as our colleagues at the University of Bordeaux are already doing:

https://gitub.u-bordeaux.fr/openujournals/ojs/Kubernetes/helm/-/tree/main/charts/ojs#dockerfile

Notice 3.5 images are still apache but include postgreSQL support.

So, in your case, as you need nginx+mod_security variants, building is justified, but would be better if you like to join the group as far as nginx images is something we have in the roadmap. :wink:

Note that working over the official images has advantages and disadvantages.

The advantage is clear: you don’t have to worry about the base image… the PHP version, the PHP extensions, the operating system update, the testing, etc., because that’s something we’ll do for you.

The disadvantage? Well, you’ll be dependent on our official images to generate your own.