bitnami / containers

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

[bitnami/mediawiki] Access denied for user 'root'@'%' to database 'wikidb' using MariaDB 11.3 #65056

Closed rosch100 closed 6 months ago

rosch100 commented 7 months ago

Name and Version

bitnami/mediawiki

What architecture are you using?

amd64

What steps will reproduce the bug?

Using the images: 'bitnami/mediawiki:latest' and 'bitnami/mariadb:latest' Mediawiki does not start up anymore since 2024-04-03.

Until that date, the mediawiki container worked as expected. I suspect an upgrade of MariaDB on 2024-04-03?

The full Mediawiki container log:

2024-04-10T10:24:39.040894544Z mediawiki 12:24:39.03 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
2024-04-10T10:24:39.044958964Z mediawiki 12:24:39.04 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
2024-04-10T10:24:39.046929397Z mediawiki 12:24:39.04 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
2024-04-10T10:24:39.050636935Z mediawiki 12:24:39.05 INFO  ==>
2024-04-10T10:24:39.060591455Z mediawiki 12:24:39.06 INFO  ==> ** Starting MediaWiki setup **
2024-04-10T10:24:39.104505541Z mediawiki 12:24:39.10 DEBUG ==> Validating settings in APACHE_* environment variables
2024-04-10T10:24:39.124684981Z mediawiki 12:24:39.12 DEBUG ==> Copying files from /opt/bitnami/apache/conf.default to /opt/bitnami/apache/conf
2024-04-10T10:24:39.153700564Z realpath: /bitnami/apache/conf: No such file or directory
2024-04-10T10:24:39.158501437Z mediawiki 12:24:39.15 INFO  ==> Configuring Apache ServerTokens directive
2024-04-10T10:24:39.161654037Z mediawiki 12:24:39.16 DEBUG ==> Configuring ServerTokens Prod on file /opt/bitnami/apache/conf/httpd.conf
2024-04-10T10:24:39.234170444Z mediawiki 12:24:39.23 INFO  ==> Configuring PHP options
2024-04-10T10:24:39.264001149Z mediawiki 12:24:39.26 INFO  ==> Setting PHP expose_php option
2024-04-10T10:24:39.300516106Z mediawiki 12:24:39.29 INFO  ==> Setting PHP output_buffering option
2024-04-10T10:24:39.354093874Z mediawiki 12:24:39.35 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
2024-04-10T10:24:39.359964373Z mediawiki 12:24:39.35 INFO  ==> Trying to connect to the database server
2024-04-10T10:24:39.370526477Z mediawiki 12:24:39.36 DEBUG ==> Executing SQL command:
2024-04-10T10:24:39.370947198Z SELECT 1
2024-04-10T10:24:39.383656945Z /opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
2024-04-10T10:24:39.396165069Z 1
2024-04-10T10:24:39.403238357Z mediawiki 12:24:39.39 INFO  ==> Creating database user altanis_wiki
2024-04-10T10:24:39.409468445Z mediawiki 12:24:39.40 DEBUG ==> creating database user \'altanis_wiki\'
2024-04-10T10:24:39.418170648Z mediawiki 12:24:39.41 DEBUG ==> Executing SQL command:
2024-04-10T10:24:39.418688204Z create or replace user 'altanis_wiki'@'%' identified by 'belinea';
2024-04-10T10:24:39.431852533Z /opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
2024-04-10T10:24:39.450655322Z mediawiki 12:24:39.44 DEBUG ==> Removing all other hosts for the user
2024-04-10T10:24:39.465547859Z mediawiki 12:24:39.46 DEBUG ==> Executing SQL command:
2024-04-10T10:24:39.465990194Z select Host from user where User='altanis_wiki' and Host!='%';
2024-04-10T10:24:39.480642266Z /opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
2024-04-10T10:24:39.500545416Z mediawiki 12:24:39.49 INFO  ==> Creating database wikidb
2024-04-10T10:24:39.505500996Z mediawiki 12:24:39.50 DEBUG ==> Creating database wikidb
2024-04-10T10:24:39.512886019Z mediawiki 12:24:39.51 DEBUG ==> Executing SQL command:
2024-04-10T10:24:39.515979567Z create database if not exists `wikidb` ;
2024-04-10T10:24:39.526696582Z /opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
2024-04-10T10:24:39.545969543Z mediawiki 12:24:39.54 DEBUG ==> Providing privileges to username altanis_wiki on database wikidb
2024-04-10T10:24:39.555116285Z mediawiki 12:24:39.55 DEBUG ==> Executing SQL command:
2024-04-10T10:24:39.555520140Z grant all on `wikidb`.* to 'altanis_wiki'@'%';
2024-04-10T10:24:39.567121586Z /opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
2024-04-10T10:24:39.578743368Z ERROR 1044 (42000) at line 1: Access denied for user 'root'@'%' to database 'wikidb'

What is the expected behavior?

The root user has access to the mediawiki database.

What do you see instead?

Access denied for user 'root'@'%' to database 'wikidb'

javsalgar commented 7 months ago

Hi!

Did you try with the default docker-compose.yaml file just changing the image tags?

rosch100 commented 7 months ago

It works up to mariadb 11.2. When using mariadb 11.3, the error Access denied for user 'root'@'%' to database 'wikidb'is thrown.

javsalgar commented 7 months ago

Is this happening on a fresh installation with mariadb 11.3 or it only happens when upgrading?

rosch100 commented 7 months ago

Just tested with a new database for wikidb. Same error: ERROR 1044 (42000) at line 1: Access denied for user 'root'@'%' to database 'wikidb'

javsalgar commented 7 months ago

Could you please provide a docker-compose.yml that triggers the issue?

rosch100 commented 7 months ago

MariaDB:

  mariadb:
    #image: 'bitnami/mariadb:latest'
    image: 'bitnami/mariadb:11.2'
    container_name: mariadb
    restart: always
    ports:
      - '3306:3306'
    environment:
      - MARIADB_ROOT_USER=root
      - MARIADB_ROOT_PASSWORD=mypasswd
      - BITNAMI_DEBUG=true
    volumes:
      - /srv/DockerVolumes/sql:/bitnami
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
networks:
  default:
    name: nginx-proxy
    external: true

Mediawiki:

  mediawiki:
    image: 'bitnami/mediawiki:latest'
    #image: 'bitnami/mediawiki:1.40.0'
    container_name: wiki
    restart: always
    environment:
      - BITNAMI_DEBUG=true
      - MEDIAWIKI_HOST=wiki.myhost.de
      - MEDIAWIKI_WIKI_NAME=MyWiki
      - MEDIAWIKI_DATA_TO_PERSIST=images LocalSettings.php
      - MYSQL_CLIENT_DATABASE_HOST=mariadb
      - MYSQL_CLIENT_DATABASE_PORT_NUMBER=3306
      - MYSQL_CLIENT_DATABASE_ROOT_USER=root
      - MYSQL_CLIENT_DATABASE_ROOT_PASSWORD=mypasswd
      - MYSQL_CLIENT_CREATE_DATABASE_NAME=wikidb
      - MYSQL_CLIENT_CREATE_DATABASE_USER=my_wiki
      - MYSQL_CLIENT_CREATE_DATABASE_PASSWORD=mypasswd
      - MEDIAWIKI_DATABASE_HOST=mariadb
      - MEDIAWIKI_DATABASE_PORT_NUMBER=3306
      - MEDIAWIKI_DATABASE_USER=my_wiki
      - MEDIAWIKI_DATABASE_NAME=wikidb
      - MEDIAWIKI_DATABASE_PASSWORD=mypasswd
      - SMTP_HOST=ssl://smtp.mymail.de
      - SMTP_HOST_ID=myhost.de
      - SMTP_PORT=465
      - SMTP_USER=smtp@myhost.de
      - SMTP_PASSWORD=mypasswd
      - VIRTUAL_HOST=wiki.myhost.de
      - VIRTUAL_PORT=8080
      - LETSENCRYPT_HOST=wiki.myhost.de
      - LETSENCRYPT_EMAIL=mymail@myhost.de
      - SSL_POLICY=Mozilla-Modern
    volumes:
      - /srv/www/wiki.myhost.de/mediawiki:/bitnami/mediawiki
      - /srv/www/wiki.myhost.de/mediawiki/extensions/CharInsert:/opt/bitnami/mediawiki/extensions/CharInsert
      - /srv/www/wiki.myhost.de/mediawiki/extensions/NativeSvgHandler:/opt/bitnami/mediawiki/extensions/NativeSvgHandler
      - /srv/www/wiki.myhost.de/mediawiki/extensions/Diagrams:/opt/bitnami/mediawiki/extensions/Diagrams
      - /srv/www/wiki.myhost.de/mediawiki/extensions/Mermaid:/opt/bitnami/mediawiki/extensions/Mermaid
      - /srv/www/wiki.myhost.de/mediawiki/extensions/CodeMirror:/opt/bitnami/mediawiki/extensions/CodeMirror
      - /srv/www/wiki.myhost.de/mediawiki/extensions/WebAuthn:/opt/bitnami/mediawiki/extensions/WebAuthn
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    expose:
      - "8080"
    dns:
      - 1.1.1.1
networks:
  default:
    name: nginx-proxy
    external: true
javsalgar commented 7 months ago

Hi,

We are unable to reproduce the issue because I see several references to local volumes. Do you have a minimal example that we can use to reproduce?

github-actions[bot] commented 6 months 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 6 months 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.