Upgrade Moodle from 4.1.2 version
Name and Version
bitnami/moodle:4.1.2
What steps will reproduce the bug?
compose:
version: '2.2'
services:
mariadb:
image: docker.io/bitnami/mariadb:11.8.2
ports:
- "3306"
environment:
- MARIADB_PASSWORD=<pass>
- MARIADB_ROOT_PASSWORD=<rpass>
- MARIADB_USER=bn_moodle
- MARIADB_DATABASE=bitnami_moodle
- MARIADB_CHARACTER_SET=utf8mb4
- MARIADB_COLLATE=utf8mb4_unicode_ci
volumes:
- 'mariadb_data:/bitnami/mariadb'
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u $$MARIADB_USER --password=$$MARIADB_PASSWORD
moodle:
build:
dockerfile: ./moodle-server/Dockerfile
ports:
- '80:8080'
- '443:8443'
environment:
- MOODLE_DATABASE_HOST=mariadb
- MOODLE_DATABASE_PORT_NUMBER=3306
- MOODLE_DATABASE_USER=bn_moodle
- MOODLE_DATABASE_NAME=bitnami_moodle
- MOODLE_DATABASE_PASSWORD=<dpass>
- MOODLE_USERNAME=idp-admin
- MOODLE_PASSWORD=<mpass>
- MOODLE_EMAIL=<email>
- MOODLE_SITE_NAME=<site>
- MOODLE_LANG=pt_br
- PHP_MAX_INPUT_VARS=5000
- BITNAMI_DEBUG=true
volumes:
- 'moodle_data:/bitnami/moodle'
- 'moodledata_data:/bitnami/moodledata'
restart: on-failure
depends_on:
mariadb:
condition: service_healthy
jobe:
build:
dockerfile: ./jobe-server/Dockerfile
ports:
- '4000:80'
volumes:
mariadb_data:
driver: local
moodle_data:
driver: local
moodledata_data:
driver: local
dockerfile:
FROM docker.io/bitnami/moodle:4.1.2
RUN apt-get update
RUN apt-get install vim wget curl -y
RUN apt-get install certbot -y
What is the expected behavior?
I have this current version running OK, but every other version I try to upgrade Moodle (debian or not), the current version can't be upgraded.
What do you see instead?
moodle 06:54:28.50 DEBUG ==> Executing SQL command:
moodle 06:54:28.50 DEBUG ==> Executing SQL command:
SELECT 1
1
moodle 06:54:28.53 INFO
==> Running database upgrade
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of navigation_node_collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/navigationlib.php on line 1257
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of navigation_node_collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/navigationlib.php on line 1246
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of moodle_recordset::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/dml/moodle_recordset.php on line 61
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of context::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/accesslib.php on line 5219
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of cm_info::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/modinfolib.php on line 1568
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of section_info::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/modinfolib.php on line 3206
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of mysqli_native_moodle_recordset::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/dml/mysqli_native_moodle_recordset.php on line 65
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of mysqli_native_moodle_recordset::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/dml/mysqli_native_moodle_recordset.php on line 78
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of mysqli_native_moodle_recordset::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/dml/mysqli_native_moodle_recordset.php on line 69
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of mysqli_native_moodle_recordset::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/dml/mysqli_native_moodle_recordset.php on line 82
[22-Jul-2025 06:54:28 UTC] PHP Fatal error:
Type of xml_format_exception::$line must be int (as in class Exception) in /bitnami/moodle/lib/xmlize.php on line 42SELECT 1
1
moodle 06:54:28.53 INFO
==> Running database upgrade
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of navigation_node_collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/navigationlib.php on line 1257
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of navigation_node_collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/navigationlib.php on line 1246
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of moodle_recordset::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/dml/moodle_recordset.php on line 61
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of context::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/accesslib.php on line 5219
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of cm_info::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/modinfolib.php on line 1568
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of section_info::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/modinfolib.php on line 3206
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of mysqli_native_moodle_recordset::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/dml/mysqli_native_moodle_recordset.php on line 65
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of mysqli_native_moodle_recordset::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/dml/mysqli_native_moodle_recordset.php on line 78
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of mysqli_native_moodle_recordset::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/dml/mysqli_native_moodle_recordset.php on line 69
[22-Jul-2025 06:54:28 UTC] PHP Deprecated:
Return type of mysqli_native_moodle_recordset::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /bitnami/moodle/lib/dml/mysqli_native_moodle_recordset.php on line 82
[22-Jul-2025 06:54:28 UTC] PHP Fatal error:
Type of xml_format_exception::$line must be int (as in class Exception) in /bitnami/moodle/lib/xmlize.php on line 42
Additional information
I tried to upgrade to 4.1.3, 4.1.2-debian-11-r16, and 4.2.0. But none of these versions worked properly with the same errors in the database upgrade step.
Are there any following path of versions to upgrade to the current version?
Did you follow the steps at https://github.com/bitnami/containers/tree/main/bitnami/moodle#upgrade-this-image for upgrading to a newer version?
Did you follow the steps at https://github.com/bitnami/containers/tree/main/bitnami/moodle#upgrade-this-image for upgrading to a newer version?
Thanks, this is exactly what I was looking for. I already tried, but it says I need to upgrade PHP to a newer version (from 8.0.28 to 8.1.0). Since PHP is a custom installation:
root@630402e1a759:/# which php
/opt/bitnami/php/bin/php
Are there any specific steps or references I should consult?
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.
Hi @j3r3mias
I have been checking the images you have mentioned and these are the PHP version included in each of them:
- Moodle 4.1.2 - PHP 8.0.28
- Moodle 4.1.3 - PHP 8.1.20
- Moodle 4.2.0 - PHP 8.1.20
According to the official Moodle 4.2.0 website, our PHP version meets the requirements. We recommend you to double check this issue with the Moodle developers.
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.