bitnami / containers

Bitnami container images
https://bitnami.com
Other
3.41k stars 4.88k forks source link

[bitnami/moodle] Moodle won't start "grep: /opt/bitnami/moodle/config.php: No such file or directory" #74719

Open EDIflyer opened 3 days ago

EDIflyer commented 3 days ago

Name and Version

bitnami/moodle4.5

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Setup new Linode server (Debian 12)
  2. Install Docker
  3. Install nginx proxy manager (for reverse proxy)
  4. Try to setup Moodle

What is the expected behavior?

Containers start and run OK

What do you see instead?

Initially I couldn't get mariadb to work but then read elsewhere that it needs PGID/PUID of 1001 so created a user with that and did a chown for the mariadb folders. It now starts fine.

The main Moodle container boots but then has an issue - see debug logs below. It just keeps restarting. I also note that nothing is written to the mounted volumes (compared to the mariadb ones). I've down the same chown for the moodle folders too.

Additional information

Portainer stack/Docker compose:

# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0

services:
  mariadb:
    image: docker.io/bitnami/mariadb:11.4
    expose:
      - 3306    
    environment:
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_USER=bn_moodle
      - MARIADB_DATABASE=bitnami_moodle
      - MARIADB_CHARACTER_SET=utf8mb4
      - MARIADB_COLLATE=utf8mb4_unicode_ci
    restart: unless-stopped
    networks:
      - nginx-proxy-manager_default
    volumes:
      - /home/ediflyer/containers/moodle/mariadb:/bitnami/mariadb

  moodle:
    image: docker.io/bitnami/moodle:4.5
    expose:
      - 8080
    environment:
      - BITNAMI_DEBUG=true
      - MOODLE_DATABASE_TYPE=mariadb
      - MOODLE_DATABASE_HOST=mariadb
      - MOODLE_DATABASE_PORT_NUMBER=3306
      - MOODLE_DATABASE_USER=bn_moodle
      - MOODLE_DATABASE_NAME=bitnami_moodle
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
      - ALLOW_EMPTY_PASSWORD=yes
      - MOODLE_HOST=sub.domain.tld
      - MOODLE_REVERSEPROXY=true
      - MOODLE_SSLPROXY=true
    volumes:
      - /home/ediflyer/containers/moodle:/bitnami/moodle
      - /home/ediflyer/containers/moodle/data:/bitnami/moodledata
    depends_on:
      - mariadb
    restart: unless-stopped
    networks:
      - nginx-proxy-manager_default

networks:
  nginx-proxy-manager_default:
    external: true
    name: nginx-proxy-manager_default

mariadb container logs:

mariadb 13:06:47.79 INFO  ==> 
mariadb 13:06:47.79 INFO  ==> Welcome to the Bitnami mariadb container
mariadb 13:06:47.80 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
mariadb 13:06:47.81 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
mariadb 13:06:47.81 INFO  ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
mariadb 13:06:47.82 INFO  ==> 
mariadb 13:06:47.83 INFO  ==> ** Starting MariaDB setup **
mariadb 13:06:47.87 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mariadb 13:06:47.87 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
mariadb 13:06:47.88 INFO  ==> Initializing mariadb database
mariadb 13:06:47.90 INFO  ==> Updating 'my.cnf' with custom configuration
mariadb 13:06:47.91 INFO  ==> Setting user option
mariadb 13:06:47.92 INFO  ==> Setting character_set_server option
mariadb 13:06:47.93 INFO  ==> Setting collation_server option
mariadb 13:06:47.94 INFO  ==> Setting slow_query_log option
mariadb 13:06:47.95 INFO  ==> Setting long_query_time option
mariadb 13:06:47.96 INFO  ==> Using persisted data
mariadb 13:06:47.97 INFO  ==> Running mysql_upgrade
mariadb 13:06:47.97 INFO  ==> Starting mariadb in background
2024-11-10 13:06:48 0 [Note] Starting MariaDB 11.4.4-MariaDB source revision e9a502df08bad16aa8a354e854f3c014b1380e32 server_uid waxnTUYIIO4TIiAUHNqSi64pJUA= as process 66
2024-11-10 13:06:48 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2024-11-10 13:06:48 0 [Note] InnoDB: Number of transaction pools: 1
2024-11-10 13:06:48 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-11-10 13:06:48 0 [Note] mysqld: O_TMPFILE is not supported on /opt/bitnami/mariadb/tmp (disabling future attempts)
2024-11-10 13:06:48 0 [Note] InnoDB: Using Linux native AIO
2024-11-10 13:06:48 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2024-11-10 13:06:48 0 [Note] InnoDB: Completed initialization of buffer pool
2024-11-10 13:06:48 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2024-11-10 13:06:48 0 [Note] InnoDB: End of log at LSN=47875
2024-11-10 13:06:48 0 [Note] InnoDB: Opened 3 undo tablespaces
2024-11-10 13:06:48 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
2024-11-10 13:06:48 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2024-11-10 13:06:48 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2024-11-10 13:06:48 0 [Note] InnoDB: log sequence number 47875; transaction id 15
2024-11-10 13:06:48 0 [Note] InnoDB: Loading buffer pool(s) from /bitnami/mariadb/data/ib_buffer_pool
2024-11-10 13:06:48 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-11-10 13:06:48 0 [Note] Plugin 'wsrep-provider' is disabled.
2024-11-10 13:06:48 0 [Note] InnoDB: Buffer pool(s) load completed at 241110 13:06:48
2024-11-10 13:06:49 0 [Note] Server socket created on IP: '127.0.0.1'.
2024-11-10 13:06:49 0 [Warning] 'proxies_priv' entry '@% root@32d97eafd448' ignored in --skip-name-resolve mode.
2024-11-10 13:06:49 0 [Note] mysqld: Event Scheduler: Loaded 0 events
2024-11-10 13:06:49 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: ready for connections.
Version: '11.4.4-MariaDB'  socket: '/opt/bitnami/mariadb/tmp/mysql.sock'  port: 3306  Source distribution

moodle container logs:

moodle 13:02:29.79 INFO  ==> 
moodle 13:02:29.80 INFO  ==> Welcome to the Bitnami moodle container
moodle 13:02:29.80 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
moodle 13:02:29.80 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
moodle 13:02:29.80 INFO  ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
moodle 13:02:29.80 INFO  ==> 
moodle 13:02:29.81 INFO  ==> ** Starting Moodle setup **
moodle 13:02:29.82 DEBUG ==> Validating settings in APACHE_* environment variables
moodle 13:02:29.83 DEBUG ==> Copying files from /opt/bitnami/apache/conf.default to /opt/bitnami/apache/conf
realpath: /bitnami/apache/conf: No such file or directory
moodle 13:02:29.85 INFO  ==> Configuring Apache ServerTokens directive
moodle 13:02:29.85 DEBUG ==> Configuring ServerTokens Prod on file /opt/bitnami/apache/conf/httpd.conf
moodle 13:02:29.88 INFO  ==> Configuring PHP options
moodle 13:02:29.89 INFO  ==> Setting PHP expose_php option
moodle 13:02:29.90 INFO  ==> Setting PHP output_buffering option
moodle 13:02:29.92 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
moodle 13:02:29.92 INFO  ==> Validating settings in POSTGRESQL_CLIENT_* env vars
moodle 13:02:29.95 DEBUG ==> Validating settings in MOODLE_* environment variables...
moodle 13:02:29.95 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
moodle 13:02:30.01 INFO  ==> Restoring persisted Moodle installation
moodle 13:02:30.02 INFO  ==> Trying to connect to the database server
moodle 13:02:30.02 DEBUG ==> Getting $CFG->dbtype from Moodle configuration
grep: /opt/bitnami/moodle/config.php: No such file or directory
4ydan commented 2 days ago

I get a similar error when trying to mount two mods like so

volumes:
      - moodle_data:/bitnami/moodle
      - moodledata_data:/bitnami/moodledata
      - ./mods/grouptool:/bitnami/moodle/mod/grouptool
      - ./mods/organizer:/bitnami/moodle/mod/organizer
javsalgar commented 1 day ago

Hi,

Bind-mounting volumes in a non-root container is a bit problematic. Could you ensure that the initial installation script gets run? I would try ensuring that the volumes moodle_data and moodledata_data are clean? Then run the container with BITNAMI_DEBUG=true

4ydan commented 1 day ago

Thank you, I solved my problem using docker cp instead.

EDIflyer commented 23 hours ago

Bind-mounting volumes in a non-root container is a bit problematic. Could you ensure that the initial installation script gets run? I would try ensuring that the volumes moodle_data and moodledata_data are clean? Then run the container with BITNAMI_DEBUG=true

Yes I've checked the both those volumes are empty. Ownership for the folders is to 1001 too.

Full logs for moodle container (which exits with code 2) are:

moodle 22:20:20.38 INFO  ==> 
moodle 22:20:20.39 INFO  ==> Welcome to the Bitnami moodle container
moodle 22:20:20.39 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
moodle 22:20:20.40 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
moodle 22:20:20.41 INFO  ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
moodle 22:20:20.41 INFO  ==> 
moodle 22:20:20.42 INFO  ==> ** Starting Moodle setup **
moodle 22:20:20.45 DEBUG ==> Validating settings in APACHE_* environment variables
moodle 22:20:20.48 DEBUG ==> Copying files from /opt/bitnami/apache/conf.default to /opt/bitnami/apache/conf
moodle 22:20:20.50 INFO  ==> Generating sample certificates
Certificate request self-signature ok
subject=CN = example.com
realpath: /bitnami/apache/conf: No such file or directory
moodle 22:20:23.89 INFO  ==> Configuring Apache ServerTokens directive
moodle 22:20:23.90 DEBUG ==> Configuring ServerTokens Prod on file /opt/bitnami/apache/conf/httpd.conf
moodle 22:20:23.94 INFO  ==> Configuring PHP options
moodle 22:20:23.94 INFO  ==> Setting PHP expose_php option
moodle 22:20:23.95 INFO  ==> Setting PHP output_buffering option
moodle 22:20:23.98 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
moodle 22:20:23.98 INFO  ==> Validating settings in POSTGRESQL_CLIENT_* env vars
moodle 22:20:24.01 DEBUG ==> Validating settings in MOODLE_* environment variables...
moodle 22:20:24.02 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
moodle 22:20:24.07 INFO  ==> Restoring persisted Moodle installation

MariaDB logs:

mariadb 22:20:20.10 INFO  ==> 
mariadb 22:20:20.10 INFO  ==> Welcome to the Bitnami mariadb container
mariadb 22:20:20.11 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
mariadb 22:20:20.12 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
mariadb 22:20:20.12 INFO  ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
mariadb 22:20:20.12 INFO  ==> 
mariadb 22:20:20.14 INFO  ==> ** Starting MariaDB setup **
mariadb 22:20:20.17 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
mariadb 22:20:20.17 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
mariadb 22:20:20.19 INFO  ==> Initializing mariadb database
mariadb 22:20:20.21 INFO  ==> Updating 'my.cnf' with custom configuration
mariadb 22:20:20.22 INFO  ==> Setting user option
mariadb 22:20:20.23 INFO  ==> Setting character_set_server option
mariadb 22:20:20.24 INFO  ==> Setting collation_server option
mariadb 22:20:20.25 INFO  ==> Setting slow_query_log option
mariadb 22:20:20.26 INFO  ==> Setting long_query_time option
mariadb 22:20:20.26 INFO  ==> Installing database
/opt/bitnami/mariadb/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
mariadb 22:20:21.48 INFO  ==> Starting mariadb in background
2024-11-12 22:20:21 0 [Note] Starting MariaDB 11.4.4-MariaDB source revision e9a502df08bad16aa8a354e854f3c014b1380e32 server_uid waxnTUYIIO4TIiAUHNqSi64pJUA= as process 113
2024-11-12 22:20:21 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2024-11-12 22:20:21 0 [Note] InnoDB: Number of transaction pools: 1
2024-11-12 22:20:21 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-11-12 22:20:21 0 [Note] mysqld: O_TMPFILE is not supported on /opt/bitnami/mariadb/tmp (disabling future attempts)
2024-11-12 22:20:21 0 [Note] InnoDB: Using Linux native AIO
2024-11-12 22:20:21 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2024-11-12 22:20:21 0 [Note] InnoDB: Completed initialization of buffer pool
2024-11-12 22:20:21 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2024-11-12 22:20:21 0 [Note] InnoDB: End of log at LSN=46300
2024-11-12 22:20:21 0 [Note] InnoDB: Opened 3 undo tablespaces
2024-11-12 22:20:21 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
2024-11-12 22:20:21 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2024-11-12 22:20:21 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2024-11-12 22:20:21 0 [Note] InnoDB: log sequence number 46300; transaction id 14
2024-11-12 22:20:21 0 [Note] InnoDB: Loading buffer pool(s) from /bitnami/mariadb/data/ib_buffer_pool
2024-11-12 22:20:21 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-11-12 22:20:21 0 [Note] Plugin 'wsrep-provider' is disabled.
2024-11-12 22:20:21 0 [Note] InnoDB: Buffer pool(s) load completed at 241112 22:20:21
2024-11-12 22:20:23 0 [Note] Server socket created on IP: '127.0.0.1'.
2024-11-12 22:20:23 0 [Warning] 'user' entry 'root@52c9156c23e6' ignored in --skip-name-resolve mode.
2024-11-12 22:20:23 0 [Warning] 'user' entry '@52c9156c23e6' ignored in --skip-name-resolve mode.
2024-11-12 22:20:23 0 [Warning] 'proxies_priv' entry '@% root@52c9156c23e6' ignored in --skip-name-resolve mode.
2024-11-12 22:20:23 0 [Note] mysqld: Event Scheduler: Loaded 0 events
2024-11-12 22:20:23 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: ready for connections.
Version: '11.4.4-MariaDB'  socket: '/opt/bitnami/mariadb/tmp/mysql.sock'  port: 3306  Source distribution
mariadb 22:20:25.56 INFO  ==> Configuring authentication
2024-11-12 22:20:25 5 [Warning] 'proxies_priv' entry '@% root@52c9156c23e6' ignored in --skip-name-resolve mode.
/opt/bitnami/mariadb/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
/opt/bitnami/mariadb/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
/opt/bitnami/mariadb/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
/opt/bitnami/mariadb/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
mariadb 22:20:25.89 INFO  ==> Running mysql_upgrade
find: '/docker-entrypoint-startdb.d/': No such file or directory
mariadb 22:20:26.03 INFO  ==> Stopping mariadb
2024-11-12 22:20:26 0 [Note] /opt/bitnami/mariadb/sbin/mysqld (initiated by: unknown): Normal shutdown
2024-11-12 22:20:26 0 [Note] InnoDB: FTS optimize thread exiting.
2024-11-12 22:20:26 0 [Note] InnoDB: Starting shutdown...
2024-11-12 22:20:26 0 [Note] InnoDB: Dumping buffer pool(s) to /bitnami/mariadb/data/ib_buffer_pool
2024-11-12 22:20:26 0 [Note] InnoDB: Buffer pool(s) dump completed at 241112 22:20:26
2024-11-12 22:20:26 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2024-11-12 22:20:26 0 [Note] InnoDB: Shutdown completed; log sequence number 47875; transaction id 15
2024-11-12 22:20:26 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: Shutdown complete
mariadb 22:20:27.07 INFO  ==> ** MariaDB setup finished! **
mariadb 22:20:27.14 INFO  ==> ** Starting MariaDB **
/opt/bitnami/mariadb/sbin/mysqld: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/sbin/mariadbd' instead
2024-11-12 22:20:27 0 [Note] Starting MariaDB 11.4.4-MariaDB source revision e9a502df08bad16aa8a354e854f3c014b1380e32 server_uid waxnTUYIIO4TIiAUHNqSi64pJUA= as process 1
2024-11-12 22:20:27 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2024-11-12 22:20:27 0 [Note] InnoDB: Number of transaction pools: 1
2024-11-12 22:20:27 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-11-12 22:20:27 0 [Note] mysqld: O_TMPFILE is not supported on /opt/bitnami/mariadb/tmp (disabling future attempts)
2024-11-12 22:20:27 0 [Note] InnoDB: Using Linux native AIO
2024-11-12 22:20:27 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2024-11-12 22:20:27 0 [Note] InnoDB: Completed initialization of buffer pool
2024-11-12 22:20:27 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2024-11-12 22:20:27 0 [Note] InnoDB: End of log at LSN=47875
2024-11-12 22:20:27 0 [Note] InnoDB: Opened 3 undo tablespaces
2024-11-12 22:20:27 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
2024-11-12 22:20:27 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2024-11-12 22:20:27 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2024-11-12 22:20:27 0 [Note] InnoDB: log sequence number 47875; transaction id 15
2024-11-12 22:20:27 0 [Note] InnoDB: Loading buffer pool(s) from /bitnami/mariadb/data/ib_buffer_pool
2024-11-12 22:20:27 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-11-12 22:20:27 0 [Note] Plugin 'wsrep-provider' is disabled.
2024-11-12 22:20:27 0 [Note] InnoDB: Buffer pool(s) load completed at 241112 22:20:27
2024-11-12 22:20:29 0 [Note] Server socket created on IP: '0.0.0.0'.
2024-11-12 22:20:29 0 [Warning] 'proxies_priv' entry '@% root@52c9156c23e6' ignored in --skip-name-resolve mode.
2024-11-12 22:20:29 0 [Note] mysqld: Event Scheduler: Loaded 0 events
2024-11-12 22:20:29 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: ready for connections.
Version: '11.4.4-MariaDB'  socket: '/opt/bitnami/mariadb/tmp/mysql.sock'  port: 3306  Source distribution

After running the MariaDB folders have plenty of files added, the Moodle and Moodle Data both remain empty.