PHP Error after upgrading from 3.3.7 to 3.3.8
Name and Version
docker.io/bitnami/phpbb:3.3.8
What steps will reproduce the bug?
Hi,
I'm running a phpBB (bitnami/phpbb:3.3.8) instance with (bitnami/mariadb:10.7.4) database.
I've recently update my docker compose file to update from 3.3.7 to 3.3.8.
Now when I try accessing the phpBB instance the compose logs gives me this error.
phpbb | [Tue Jun 28 09:24:59.475985 2022] [php:error] [pid 220] [client 127.0.0.1:59308] PHP Fatal error: Uncaught Twig\\Error\\LoaderError: Unable to find template "cron.html" (looked into: /bitnami/phpbb/styles/prosilver/template, /bitnami/phpbb/styles/prosilver/theme, /bitnami/phpbb/styles/all/template). in /opt/bitnami/phpbb/vendor/twig/twig/src/Loader/FilesystemLoader.php:250\nStack trace:\n#0 /opt/bitnami/phpbb/phpbb/template/twig/loader.php(135): Twig\\Loader\\FilesystemLoader->findTemplate()\n#1 /opt/bitnami/phpbb/vendor/twig/twig/src/Loader/FilesystemLoader.php(150): phpbb\\template\\twig\\loader->findTemplate()\n#2 /opt/bitnami/phpbb/vendor/twig/twig/src/Environment.php(299): Twig\\Loader\\FilesystemLoader->getCacheKey()\n#3 /opt/bitnami/phpbb/vendor/twig/twig/src/Environment.php(381): Twig\\Environment->getTemplateClass()\n#4 /opt/bitnami/phpbb/phpbb/template/twig/environment.php(277): Twig\\Environment->loadTemplate()\n#5 /opt/bitnami/phpbb/vendor/twig/twig/src/Environment.php(359): phpbb\\template\\twig\\environment->loadTemplate()\n#6 /opt/bitnami/phpbb/vendor/twig/twig/src/Environment.php(318): Twig\\Environment->load()\n#7 /opt/bitnami/phpbb/phpbb/template/twig/environment.php(224): Twig\\Environment->render()\n#8 /opt/bitnami/phpbb/phpbb/template/twig/environment.php(186): phpbb\\template\\twig\\environment->display_with_assets()\n#9 /opt/bitnami/phpbb/phpbb/template/twig/twig.php(335): phpbb\\template\\twig\\environment->render()\n#10 /opt/bitnami/phpbb/phpbb/cron/task/wrapper.php(129): phpbb\\template\\twig\\twig->assign_display()\n#11 /opt/bitnami/phpbb/phpbb/controller/helper.php(366): phpbb\\cron\\task\\wrapper->get_html_tag()\n#12 /opt/bitnami/phpbb/phpbb/controller/helper.php(315): phpbb\\controller\\helper->set_cron_task()\n#13 /opt/bitnami/phpbb/includes/functions.php(4276): phpbb\\controller\\helper->display_footer()\n#14 /opt/bitnami/phpbb/index.php(253): page_footer()\n#15 {main}\n thrown in /opt/bitnami/phpbb/vendor/twig/twig/src/Loader/FilesystemLoader.php on line 250
phpbb2 | 127.0.0.1 - - [28/Jun/2022:09:24:59 +0200] "GET / HTTP/1.1" 500 -
I can't find any cron.html file.
Regards.
What is the expected behavior?
Upgrade from 3.3.7 to 3.3.8 correctly.
What do you see instead?
A blank page with a 404 error.
Additional information
Reverting to the version 3.3.7 now gives me version 3.3.8 on the ACP and gives me back my acces to the board.
I'm wondering if that is a problem with prosilver theme ?
After upgrading prosilver default style to 3.3.5 to 3.3.7 I still have the same error.
Please, note that the Bitnami team is not actively monitoring GitHub Issues for this project. This issue will stay open for 20 days to allow the community to contribute, after 15 days without activity the issue will be marked as stale, being closed after 5 days.
If you would like to contribute to this container image by fixing a bug or adding a new feature, feel free to create a PR, the Bitnami team will be happy to review it and provide feedback.
I suffered from same problem, but I think I fixed it by restoring styles/all folder from a phpBB 3.3.8 release package.
Hi @pkerwien,
I will try this thanks.
@carrodher,
Following @pkerwien hint, I've made a diff -r -q of a fresh phpBB 3.3.8 packages and the volume /bitnami/phpbb of a 3.3.8 bitnami image.
The file /bitnami/phpbb/styles/all/template/cron.html is missing from the image.
By copying it manually, it has restore my board.
I've deploy a fresh instance of 3.3.8 the file is not missing, so the use case is only when you migrate from 3.3.7 to 3.3.8.
Regards.
Hi, Thanks for coming back and sharing your findings.
@jpoggi Thank you so much. This helped me a lot. Without your research into this issue I would have been stuck with version 3.3.7 forever. Sad that the bitnami team is not actively monitoring such issues.
Thanks @jpoggi for sharing the fix. I'll have a question at the end of this post. Maybe you can have a look?
I'm using this docker image since approximately 5 years and this was the third time that a docker image update took the forum offline. I'm beginning to question if it would not have been wiser to install phpbb the old-fashioned way.
Because I'm modifying the image anyway these days (in order to disallow outdated SSL versions, see bitnami/bitnami-docker-phpbb#73), I will fix this problem by having my own Dockerfile modify the bitnami image:
FROM bitnami/phpbb:latest
# ...
ADD cron.html /bitnami/phpbb/styles/all/template/cron.html
where cron.html has the following content (taken from file cron.html that was added and then deleted from the bitnami 3.3.7 image in the overlay filesystem layers):
{#
Runs the cron task by triggering server request to the URL on load. `img` is
preferred over JS to ensure maximum compatibility. We use `class="sr-only"`
to hide visually and `aria-hidden="true"` to hide from screen-readers; using
`hidden` or `display: none` would prevent the task from running.
#}
<img class="sr-only" aria-hidden="true" src="{{ CRON_TASK_URL|e('html_attr') }}" width="1" height="1" alt="">
An alternative would be to bind-mount this file into a container.
My question is: Why would this file only be missing when upgrading from 3.3.7 to 3.3.8, and not in a fresh installation of 3.3.8?
@jpoggi Thank you so much. This helped me a lot. Without your research into this issue I would have been stuck with version 3.3.7 forever. Sad that the bitnami team is not actively monitoring such issues.
Hi,
In fact if you had try to update and rollback to the previous version the board would have mention that it was up to date.
Even if the image is not, the files are.
Thanks @jpoggi for sharing the fix. I'll have a question at the end of this post. Maybe you can have a look?
I'm using this docker image since approximately 5 years and this was the third time that a docker image update took the forum offline. I'm beginning to question if it would not have been wiser to install phpbb the old-fashioned way.
Because I'm modifying the image anyway these days (in order to disallow outdated SSL versions, see bitnami/bitnami-docker-phpbb#73), I will fix this problem by having my own Dockerfile modify the bitnami image:
FROM bitnami/phpbb:latest # ... ADD cron.html /bitnami/phpbb/styles/all/template/cron.htmlwhere cron.html has the following content (taken from file cron.html that was added and then deleted from the bitnami 3.3.7 image in the overlay filesystem layers):
{# Runs the cron task by triggering server request to the URL on load. `img` is preferred over JS to ensure maximum compatibility. We use `class="sr-only"` to hide visually and `aria-hidden="true"` to hide from screen-readers; using `hidden` or `display: none` would prevent the task from running. #} <img class="sr-only" aria-hidden="true" src="{{ CRON_TASK_URL|e('html_attr') }}" width="1" height="1" alt="">An alternative would be to bind-mount this file into a container.
My question is: Why would this file only be missing when upgrading from 3.3.7 to 3.3.8, and not in a fresh installation of 3.3.8?
I would stick to docker to keep a board up to date even if the update fail from time to time.
I'm not using this software for too long so I can't have a good point of view.
Keeping phpBB up to date the old fashionned way is pretty time consuming I guess, the main pro here is to have all the prerequisites on the image, PHP modules etc...
I'm a huge fan of docker for years now, first reason it's very easy to keep all product up to date.
Regarding the cause of the "crash" during the update and the files missing I have no clue.
We are going to transfer this issue to bitnami/containers
In order to unify the approaches followed in Bitnami containers and Bitnami charts, we are moving some issues in bitnami/bitnami-docker-<container> repositories to bitnami/containers.
Please follow bitnami/containers to keep you updated about the latest bitnami images.
More information here: https://blog.bitnami.com/2022/07/new-source-of-truth-bitnami-containers.html
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.