bitnami / containers

Bitnami container images
https://bitnami.com
Other
3.43k stars 4.89k forks source link

Install script crash with MOODLE_USERNAME and MOODLE_PASSWORD set #72747

Closed celliern closed 2 weeks ago

celliern commented 1 month ago

Name and Version

docker.io/bitnami/moodle:4.4

What architecture are you using?

amd64

What steps will reproduce the bug?

with the following compose file :

name: "moodle"
services:
  mariadb:
    image: docker.io/bitnami/mariadb:11.4
    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
    volumes:
      - "mariadb_data:/bitnami/mariadb"
  moodle:
    image: docker.io/bitnami/moodle:4.4
    ports:
      - "8080:8080"
    environment:
      - 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_USERNAME=admin
      - MOODLE_PASSWORD=admin

    volumes:
      - "moodle_data:/bitnami/moodle"
      - "moodledata_data:/bitnami/moodledata"
    depends_on:
      - mariadb

volumes:
  mariadb_data:
    driver: local
  moodle_data:
    driver: local
  moodledata_data:
    driver: local

The moodle container exit on the "Running Moodle install script" step, but removing the two lines

make it work as expected.

What is the expected behavior?

The container should run the installation script and then go to the next step (Persisting Moodle installation)

moodle-1   | moodle 10:11:22.65 INFO  ==> Running Moodle install script
moodle-1   | moodle 10:12:37.38 INFO  ==> Persisting Moodle installation
moodle-1   | moodle 10:12:47.86 INFO  ==> ** Moodle setup finished! **
moodle-1   | 
moodle-1   | moodle 10:12:47.86 INFO  ==> ** Starting cron **
moodle-1   | moodle 10:12:47.88 INFO  ==> ** Starting Apache **

What do you see instead?

moodle-1   | moodle  INFO  ==> Running Moodle install script
moodle-1 exited with code 1
Otus9051 commented 1 month ago

Same issue here. This seems to be a problem with 4.4, 4.3, 4.2. This also seems to be occuring WITHOUT the MOODLE_USERNAME and MOODLE_PASSWORD variables.

Otus9051 commented 1 month ago

Upon enabling BITNAMI_DEBUG variable, it is seen that it corresponds to a database unicode error.

Attaching to moodle-1
moodle-1  | moodle 16:54:41.34 INFO  ==> 
moodle-1  | moodle 16:54:41.34 INFO  ==> Welcome to the Bitnami moodle container
moodle-1  | moodle 16:54:41.35 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
moodle-1  | moodle 16:54:41.35 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
moodle-1  | moodle 16:54:41.35 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-1  | moodle 16:54:41.35 INFO  ==> 
moodle-1  | moodle 16:54:41.35 INFO  ==> ** Starting Moodle setup **
moodle-1  | moodle 16:54:41.38 DEBUG ==> Validating settings in APACHE_* environment variables
moodle-1  | moodle 16:54:41.42 DEBUG ==> Copying files from /opt/bitnami/apache/conf.default to /opt/bitnami/apache/conf
moodle-1  | moodle 16:54:41.43 INFO  ==> Generating sample certificates
moodle-1  | Certificate request self-signature ok
moodle-1  | subject=CN = example.com
moodle-1  | realpath: /bitnami/apache/conf: No such file or directory
moodle-1  | moodle 16:54:42.79 INFO  ==> Configuring Apache ServerTokens directive
moodle-1  | moodle 16:54:42.80 DEBUG ==> Configuring ServerTokens Prod on file /opt/bitnami/apache/conf/httpd.conf
moodle-1  | moodle 16:54:42.84 INFO  ==> Configuring PHP options
moodle-1  | moodle 16:54:42.85 INFO  ==> Setting PHP expose_php option
moodle-1  | moodle 16:54:42.87 INFO  ==> Setting PHP output_buffering option
moodle-1  | moodle 16:54:42.90 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
moodle-1  | moodle 16:54:42.91 INFO  ==> Validating settings in POSTGRESQL_CLIENT_* env vars
moodle-1  | moodle 16:54:42.97 DEBUG ==> Validating settings in MOODLE_* environment variables...
moodle-1  | moodle 16:54:43.06 INFO  ==> Ensuring Moodle directories exist
moodle-1  | moodle 16:54:43.09 INFO  ==> Trying to connect to the database server
moodle-1  | /opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
moodle-1  | moodle 16:54:43.12 DEBUG ==> Executing SQL command:
moodle-1  | SELECT 1
moodle-1  | /opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
moodle-1  | 1
moodle-1  | moodle 16:54:43.14 INFO  ==> Running Moodle install script
moodle-1  |                                  .-..-.       
moodle-1  |    _____                         | || |       
moodle-1  |   /____/-.---_  .---.  .---.  .-.| || | .---. 
moodle-1  |   | |  _   _  |/  _  \/  _  \/  _  || |/  __ \
moodle-1  |   * | | | | | || |_| || |_| || |_| || || |___/
moodle-1  |     |_| |_| |_|\_____/\_____/\_____||_|\_____)
moodle-1  | 
moodle-1  | Moodle 4.4.3 (Build: 20240902) command line installation program
moodle-1  | == Environment ==
moodle-1  | !! unicode !!
moodle-1  | [System] must be installed and enabled - It is required that you store all your data in Unicode format (UTF-8). New
moodle-1  | installations must be performed into databases that have their default
moodle-1  | character set as Unicode. If you are upgrading, you should perform the
moodle-1  | UTF-8 migration process (see the Admin page).
moodle-1  | 
moodle-1  | 
moodle-1 exited with code 1

The database is however, already unicode. Upon re-run,

Attaching to moodle-1
moodle-1  | moodle 16:55:09.67 INFO  ==> 
moodle-1  | moodle 16:55:09.67 INFO  ==> Welcome to the Bitnami moodle container
moodle-1  | moodle 16:55:09.68 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
moodle-1  | moodle 16:55:09.68 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
moodle-1  | moodle 16:55:09.68 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-1  | moodle 16:55:09.68 INFO  ==> 
moodle-1  | moodle 16:55:09.68 INFO  ==> ** Starting Moodle setup **
moodle-1  | moodle 16:55:09.71 DEBUG ==> Validating settings in APACHE_* environment variables
moodle-1  | moodle 16:55:09.73 DEBUG ==> Copying files from /opt/bitnami/apache/conf.default to /opt/bitnami/apache/conf
moodle-1  | realpath: /bitnami/apache/conf: No such file or directory
moodle-1  | moodle 16:55:09.75 INFO  ==> Configuring Apache ServerTokens directive
moodle-1  | moodle 16:55:09.75 DEBUG ==> Configuring ServerTokens Prod on file /opt/bitnami/apache/conf/httpd.conf
moodle-1  | moodle 16:55:09.80 INFO  ==> Configuring PHP options
moodle-1  | moodle 16:55:09.81 INFO  ==> Setting PHP expose_php option
moodle-1  | moodle 16:55:09.83 INFO  ==> Setting PHP output_buffering option
moodle-1  | moodle 16:55:09.86 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
moodle-1  | moodle 16:55:09.87 INFO  ==> Validating settings in POSTGRESQL_CLIENT_* env vars
moodle-1  | moodle 16:55:09.93 DEBUG ==> Validating settings in MOODLE_* environment variables...
moodle-1  | moodle 16:55:10.03 INFO  ==> Ensuring Moodle directories exist
moodle-1  | moodle 16:55:10.07 INFO  ==> Trying to connect to the database server
moodle-1  | /opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
moodle-1  | moodle 16:55:10.09 DEBUG ==> Executing SQL command:
moodle-1  | SELECT 1
moodle-1  | /opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
moodle-1  | 1
moodle-1  | moodle 16:55:10.11 INFO  ==> Running Moodle install script
moodle-1  | The configuration file config.php already exists. Please use admin/cli/install_database.php to install Moodle for this site.
moodle-1  | 
moodle-1 exited with code 1

This is clearly a lack of documentation and maintenance by Bitnami on the Moodle Image. If you can't do something, leave it be.

celliern commented 1 month ago

For the last version we have a moodle running if we remove the variables, that's a bit weird that we have different behavior.. Thank you for the insight on the version number, if we have trouble running the image we will downgrade an older version

dgomezleon commented 1 month ago

Hi @celliern ,

The error I can see is:

Error, incorrect value "admin" for "adminpass"

Using the docker-compose below worked for me:

name: "moodle"
services:
  mariadb:
    image: docker.io/bitnami/mariadb:11.4
    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
      - BITNAMI_DEBUG=true
    volumes:
      - "mariadb_data:/bitnami/mariadb"
  moodle:
    image: docker.io/bitnami/moodle:4.4
    ports:
      - "8080:8080"
    environment:
      - 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_USERNAME=admin
      - MOODLE_PASSWORD=adminpass
      - BITNAMI_DEBUG=true
    volumes:
      - "moodle_data:/bitnami/moodle"
      - "moodledata_data:/bitnami/moodledata"
    depends_on:
      - mariadb

volumes:
  mariadb_data:
    driver: local
  moodle_data:
    driver: local
  moodledata_data:
    driver: local

I hope it helps

FoxntaU commented 1 month ago

I'm experiencing the same issue on my Windows PC works, but it fails on Ubuntu.
moodle_1 | moodle 02:36:42.18 INFO ==> Running Moodle install script
app_moodle_1 exited with code 1.

dgomezleon commented 1 month ago

Hi @FoxntaU ,

Could you share how you are executing it? Have you been able to take a look at my last message?

github-actions[bot] commented 3 weeks ago

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.

github-actions[bot] commented 2 weeks ago

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.