MariaDB / mariadb-docker

Docker Official Image packaging for MariaDB
https://mariadb.org
GNU General Public License v2.0
755 stars 436 forks source link

v11 Container fails to start in GitHub Action #523

Closed theory closed 11 months ago

theory commented 11 months ago

I have a GitHub action that tests a number of versions of MariaDB, and recently tried to add v11; oddly, the build reports that the container fails to start:

2023-07-29T23:55:16.0960080Z ##[command]/usr/bin/docker create --name 93ce86201a66453ea83037f32f301ffa_mariadb110_f35454 --label 5bedb4 --network github_network_94efcabd2c4e49ec8f15db5f5b0e1dfe --network-alias mysql -p 3306 --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" -e GITHUB_ACTIONS=true -e CI=true mariadb:11.0
2023-07-29T23:55:16.1405863Z e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09
2023-07-29T23:55:16.1432690Z ##[command]/usr/bin/docker start e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09
2023-07-29T23:55:16.5188678Z e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09
2023-07-29T23:55:16.5206480Z ##[command]/usr/bin/docker ps --all --filter id=e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09 --filter status=running --no-trunc --format "{{.ID}} {{.Status}}"
2023-07-29T23:55:16.5465427Z e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09 Up Less than a second (health: starting)
2023-07-29T23:55:16.5506299Z ##[command]/usr/bin/docker port e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09
2023-07-29T23:55:16.5779846Z 3306/tcp -> 0.0.0.0:32768
2023-07-29T23:55:16.5780452Z 3306/tcp -> :::32768
2023-07-29T23:55:16.5879882Z ##[endgroup]
2023-07-29T23:55:16.5911092Z ##[group]Waiting for all services to be ready
2023-07-29T23:55:16.5953819Z ##[command]/usr/bin/docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09
2023-07-29T23:55:16.6226804Z starting
2023-07-29T23:55:16.6255140Z mysql service is starting, waiting 2 seconds before checking again.
2023-07-29T23:55:18.6243419Z ##[command]/usr/bin/docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09
2023-07-29T23:55:18.6452174Z starting
2023-07-29T23:55:18.6468970Z mysql service is starting, waiting 3 seconds before checking again.
2023-07-29T23:55:22.5436180Z ##[command]/usr/bin/docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09
2023-07-29T23:55:22.5663588Z starting
2023-07-29T23:55:22.5679883Z mysql service is starting, waiting 7 seconds before checking again.
2023-07-29T23:55:30.1052350Z ##[command]/usr/bin/docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09
2023-07-29T23:55:30.1281883Z starting
2023-07-29T23:55:30.1302252Z mysql service is starting, waiting 17 seconds before checking again.
2023-07-29T23:55:47.8030323Z ##[command]/usr/bin/docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09
2023-07-29T23:55:47.8244085Z unhealthy
2023-07-29T23:55:47.8266279Z ##[endgroup]
2023-07-29T23:55:47.8266561Z ##[group]Service container mysql failed.
2023-07-29T23:55:47.8272505Z ##[command]/usr/bin/docker logs --details e924770b92751211eb428020a0996f7961b118c9b8293a541046e4025c505d09
2023-07-29T23:55:47.8508133Z  2023-07-29 23:55:17 0 [Note] Starting MariaDB 11.0.2-MariaDB-1:11.0.2+maria~ubu2204 source revision 0005f2f06c8e1aea4915887decad67885108a929 as process 93
2023-07-29T23:55:47.8508691Z  2023-07-29 23:55:16+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.0.2+maria~ubu2204 started.
2023-07-29T23:55:47.8587705Z  2023-07-29 23:55:17 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-07-29T23:55:47.8588067Z  2023-07-29 23:55:17 0 [Note] InnoDB: Using transactional memory
2023-07-29T23:55:47.8588407Z  2023-07-29 23:55:17 0 [Note] InnoDB: Number of transaction pools: 1
2023-07-29T23:55:47.8588736Z  2023-07-29 23:55:17 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-07-29T23:55:47.8589131Z  2023-07-29 23:55:17 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2023-07-29T23:55:47.8589557Z  2023-07-29 23:55:17 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2023-07-29T23:55:47.8589937Z  2023-07-29 23:55:17 0 [Note] InnoDB: Completed initialization of buffer pool
2023-07-29T23:55:47.8590629Z  2023-07-29 23:55:17 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
2023-07-29T23:55:47.8590991Z  2023-07-29 23:55:17 0 [Note] InnoDB: Opened 3 undo tablespaces
2023-07-29T23:55:47.8591354Z  2023-07-29 23:55:17 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
2023-07-29T23:55:47.8591795Z  2023-07-29 23:55:17 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2023-07-29T23:55:47.8592195Z  2023-07-29 23:55:17 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2023-07-29T23:55:47.8592544Z  2023-07-29 23:55:17 0 [Note] InnoDB: log sequence number 46151; transaction id 14
2023-07-29T23:55:47.8592862Z  2023-07-29 23:55:17 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-07-29T23:55:47.8593187Z  2023-07-29 23:55:17 0 [Note] Plugin 'wsrep-provider' is disabled.
2023-07-29T23:55:47.8593579Z  2023-07-29 23:55:17 0 [Warning] 'user' entry 'root@e924770b9275' ignored in --skip-name-resolve mode.
2023-07-29T23:55:47.8594020Z  2023-07-29 23:55:17 0 [Warning] 'proxies_priv' entry '@% root@e924770b9275' ignored in --skip-name-resolve mode.
2023-07-29T23:55:47.8594378Z  2023-07-29 23:55:17 0 [Note] mariadbd: ready for connections.
2023-07-29T23:55:47.8594779Z  Version: '11.0.2-MariaDB-1:11.0.2+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
2023-07-29T23:55:47.8595196Z  2023-07-29 23:55:20 0 [Note] mariadbd (initiated by: unknown): Normal shutdown
2023-07-29T23:55:47.8595522Z  2023-07-29 23:55:20 0 [Note] InnoDB: FTS optimize thread exiting.
2023-07-29T23:55:47.8595830Z  2023-07-29 23:55:20 0 [Note] InnoDB: Starting shutdown...
2023-07-29T23:55:47.8596172Z  2023-07-29 23:55:20 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2023-07-29T23:55:47.8596543Z  2023-07-29 23:55:20 0 [Note] InnoDB: Buffer pool(s) dump completed at 230729 23:55:20
2023-07-29T23:55:47.8597051Z  2023-07-29 23:55:20 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2023-07-29T23:55:47.8597450Z  2023-07-29 23:55:20 0 [Note] InnoDB: Shutdown completed; log sequence number 47401; transaction id 15
2023-07-29T23:55:47.8597807Z  2023-07-29 23:55:20 0 [Note] mariadbd: Shutdown complete
2023-07-29T23:55:47.8598031Z  
2023-07-29T23:55:47.8598381Z  2023-07-29 23:55:20 0 [Note] Starting MariaDB 11.0.2-MariaDB-1:11.0.2+maria~ubu2204 source revision 0005f2f06c8e1aea4915887decad67885108a929 as process 1
2023-07-29T23:55:47.8598811Z  2023-07-29 23:55:20 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-07-29T23:55:47.8599144Z  2023-07-29 23:55:20 0 [Note] InnoDB: Using transactional memory
2023-07-29T23:55:47.8599455Z  2023-07-29 23:55:20 0 [Note] InnoDB: Number of transaction pools: 1
2023-07-29T23:55:47.8599798Z  2023-07-29 23:55:20 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-07-29T23:55:47.8600185Z  2023-07-29 23:55:20 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2023-07-29T23:55:47.8600601Z  2023-07-29 23:55:20 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2023-07-29T23:55:47.8600993Z  2023-07-29 23:55:20 0 [Note] InnoDB: Completed initialization of buffer pool
2023-07-29T23:55:47.8601369Z  2023-07-29 23:55:20 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
2023-07-29T23:55:47.8601719Z  2023-07-29 23:55:20 0 [Note] InnoDB: Opened 3 undo tablespaces
2023-07-29T23:55:47.8602051Z  2023-07-29 23:55:20 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
2023-07-29T23:55:47.8602473Z  2023-07-29 23:55:20 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2023-07-29T23:55:47.8602869Z  2023-07-29 23:55:20 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2023-07-29T23:55:47.8603213Z  2023-07-29 23:55:20 0 [Note] InnoDB: log sequence number 47401; transaction id 14
2023-07-29T23:55:47.8603580Z  2023-07-29 23:55:20 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2023-07-29T23:55:47.8604035Z  2023-07-29 23:55:20 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-07-29T23:55:47.8604357Z  2023-07-29 23:55:20 0 [Note] Plugin 'wsrep-provider' is disabled.
2023-07-29T23:55:47.8604686Z  2023-07-29 23:55:20 0 [Note] InnoDB: Buffer pool(s) load completed at 230729 23:55:20
2023-07-29T23:55:47.8605024Z  2023-07-29 23:55:20 0 [Note] Server socket created on IP: '0.0.0.0'.
2023-07-29T23:55:47.8605345Z  2023-07-29 23:55:20 0 [Note] Server socket created on IP: '::'.
2023-07-29T23:55:47.8605645Z  2023-07-29 23:55:20 0 [Note] mariadbd: ready for connections.
2023-07-29T23:55:47.8606049Z  Version: '11.0.2-MariaDB-1:11.0.2+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
2023-07-29T23:55:47.8606482Z  2023-07-29 23:55:16+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-07-29T23:55:47.8606887Z  2023-07-29 23:55:16+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.0.2+maria~ubu2204 started.
2023-07-29T23:55:47.8607271Z  2023-07-29 23:55:16+00:00 [Note] [Entrypoint]: Initializing database files
2023-07-29T23:55:47.8607549Z  
2023-07-29T23:55:47.8607726Z  
2023-07-29T23:55:47.8607978Z  PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
2023-07-29T23:55:47.8608321Z  To do so, start the server, then issue the following command:
2023-07-29T23:55:47.8608573Z  
2023-07-29T23:55:47.8608895Z  '/usr/bin/mariadb-secure-installation'
2023-07-29T23:55:47.8609128Z  
2023-07-29T23:55:47.8609376Z  which will also give you the option of removing the test
2023-07-29T23:55:47.8609714Z  databases and anonymous user created by default.  This is
2023-07-29T23:55:47.8610037Z  strongly recommended for production servers.
2023-07-29T23:55:47.8610265Z  
2023-07-29T23:55:47.8610553Z  See the MariaDB Knowledgebase at https://mariadb.com/kb
2023-07-29T23:55:47.8610821Z  
2023-07-29T23:55:47.8611062Z  Please report any problems at https://mariadb.org/jira
2023-07-29T23:55:47.8611452Z  
2023-07-29T23:55:47.8611739Z  The latest information about MariaDB is available at https://mariadb.org/.
2023-07-29T23:55:47.8612025Z  
2023-07-29T23:55:47.8612280Z  Consider joining MariaDB's strong and vibrant community:
2023-07-29T23:55:47.8612591Z  https://mariadb.org/get-involved/
2023-07-29T23:55:47.8612813Z  
2023-07-29T23:55:47.8613093Z  2023-07-29 23:55:17+00:00 [Note] [Entrypoint]: Database files initialized
2023-07-29T23:55:47.8613439Z  2023-07-29 23:55:17+00:00 [Note] [Entrypoint]: Starting temporary server
2023-07-29T23:55:47.8613760Z  2023-07-29 23:55:17+00:00 [Note] [Entrypoint]: Waiting for server startup
2023-07-29T23:55:47.8614094Z  2023-07-29 23:55:18+00:00 [Note] [Entrypoint]: Temporary server started.
2023-07-29T23:55:47.8614490Z  2023-07-29 23:55:20+00:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)
2023-07-29T23:55:47.8614810Z  
2023-07-29T23:55:47.8615051Z  2023-07-29 23:55:20+00:00 [Note] [Entrypoint]: Stopping temporary server
2023-07-29T23:55:47.8615392Z  2023-07-29 23:55:20+00:00 [Note] [Entrypoint]: Temporary server stopped
2023-07-29T23:55:47.8615655Z  
2023-07-29T23:55:47.8615921Z  2023-07-29 23:55:20+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.
2023-07-29T23:55:47.8616221Z  
2023-07-29T23:55:47.8632180Z ##[error]Failed to initialize container mariadb:11.0
2023-07-29T23:55:47.8641081Z ##[endgroup]
2023-07-29T23:55:47.8728011Z ##[error]One or more containers failed to start.

I can see no error message, however. Here's what the service looks like:

    services:
      mysql:
        image: "${{ matrix.image }}:${{ matrix.version }}"
        env: { MYSQL_ALLOW_EMPTY_PASSWORD: yes }
        ports: [ 3306 ]
        options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3

It works well for all v10 images.

grooverdan commented 11 months ago

https://mariadb.org/mariadb-server-docker-official-images-healthcheck-without-mysqladmin/

Try:

        options: --health-cmd="healthcheck.sh --innodb_initialized" --health-interval=5s --health-timeout=2s --health-retries=3

ref: https://mariadb.com/kb/en/using-healthcheck-sh-script/

Note this works with 10.3(?)+ scripts. Note 10.3 and earlier are eol as far as MariaDB is concerned.

If you still aim for compatibility something like the following might work (I'm unsure of shell expansion in cmd:

        options: --health-cmd="healthcheck.sh --innodb_initialized || mysqladmin ping --protocol=tcp" --health-interval=5s --health-timeout=2s --health-retries=3
theory commented 11 months ago

Thank you, that fixed it.