Make WordPress Core

Opened 2 months ago

Closed 6 days ago

Last modified 6 days ago

#66117 closed defect (bug) (fixed)

Build/Test Tools: The database healthcheck pings the unix socket, so it passes before the TCP server is up

Reported by: lucatume Owned by: lancewillett
Priority: normal Milestone: 7.2
Component: Build/Test Tools Version: trunk
Severity: normal Keywords: has-patch dev-reviewed
Cc: Focuses:

Description (last modified by lucatume)

The mysql service healthcheck in docker-compose.yml pings the database with -h localhost. To the MySQL and MariaDB clients, localhost means "use the Unix socket". It is the one hostname that does not go over the network: 127.0.0.1 and every other host connect over TCP.

While a cold database volume is initialised, the entrypoint of both images starts a temporary server with --skip-networking, on the same socket path:

# mariadb, docker-entrypoint.sh
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" ...

# mysql, docker-entrypoint.sh
if ! "$@" --daemonize --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}"; then

That temporary server answers the socket ping, but binds no listener on port 3306. The container is therefore reported healthy before it accepts a single connection over the network, and depends_on: condition: service_healthy releases the cli, php and nginx containers too early. WP-CLI then fails with:

Error: Database connection error (2002) Connection refused

Measurement

Running the resolved healthcheck command in a tight loop against a cold volume, and recording the first probe at which it passes versus the first probe at which port 3306 accepts a connection. Docker's own 5 second sampling interval can step over the window entirely, which is why the check has to be exercised directly:

engine          healthcheck passed    TCP accepted
mysql 8.4       probe 44              probe 76
mariadb 11.4    probe 40              probe 67

On MySQL 8.4 the entrypoint stops the temporary server before it starts the final one, so in the middle of that window there is no server running at all, and even the socket stops answering. Docker has already marked the container healthy by then, and it only reverts to unhealthy after retries consecutive failures, which at the current settings is 10 probes at a 5 second interval. The container therefore stays marked healthy across a period when mysqld is not running and calls will fail.

Proposed fix

Ping over TCP, so the check cannot pass against the temporary server:

-h 127.0.0.1 --protocol=tcp

No credentials are required. mysqladmin ping and mariadb-admin ping exit 0 on Access denied, which is the correct result here: the check asserts that the server is reachable, not that the caller can authenticate.

Note that switching from localhost to 127.0.0.1 is sufficient as providing an IP address will make the check run using TCP, the --protocol=tcp part is redundant and added to make the nature of the check explicit.

Verified against mysql 5.7, mysql 8.4, mariadb 10.3 and mariadb 11.4, covering both branches of the version conditional in the healthcheck. In every case the check no longer passes before the port accepts connections, and docker compose up -d --wait mysql reports healthy in 10-11 seconds on a cold volume, well inside the existing 60 second start_period.

Relationship to other tickets

#65742 fixed the same symptom in tools/local-env/scripts/install.js by retrying wp config create until it succeeds ([62938]). That retry works, but it treats one WP-CLI command as the readiness probe and leaves the healthcheck reporting the wrong thing to every other consumer of depends_on. This ticket is about the healthcheck predicate itself.

#64579 reports the same symptom as #65742 and is still open; it looks like a duplicate.

#65752 and #65799 both adjusted this healthcheck for unrelated reasons.

Backporting

Every branch back to 4.7 runs its PHPUnit CI through reusable-phpunit-tests-v1/v2/v3.yml@trunk, which checks out the caller's branch and runs npm run env:start and npm run env:install against it. The compose file in effect is the branch's own, so a fix on trunk does not reach them. The same one-line change applies to all of them, in two variants: 4.7 through 6.7 carry the simple form of the healthcheck, 6.8 and trunk carry the version-cased form.

Change History (93)

#1 @lucatume
2 months ago

  • Description modified (diff)

#2 @lucatume
2 months ago

  • Milestone Awaiting Review → 7.2

This ticket was mentioned in ​PR #13563 on ​WordPress/wordpress-develop by ​@lucatume.


2 months ago
#3

  • Keywords has-patch added

The mysql container healthcheck pings -h localhost. Both the MySQL and the MariaDB client resolve the literal localhost to the Unix socket, never to TCP.

While a cold volume is initialised, docker-entrypoint.sh starts a temporary server with --skip-networking. That server answers on the socket but binds no listener on port 3306, so the healthcheck passes and the container is reported healthy while nothing can reach it over the network.

depends_on: condition: service_healthy then releases the cli, php and nginx containers too early, and WP-CLI fails with:

Database connection error (2002) Connection refused

This pings -h 127.0.0.1 --protocol=tcp instead, so the check can pass only once the final server is listening.

Measurements

Running the resolved healthcheck predicate in a tight loop against a cold volume, and comparing the probe on which it first passes against the probe on which the port first accepts a connection:

Image Before After
mysql 5.7 passes 46 probes early never passes early
mysql 8.4 passes 32 probes early never passes early
mariadb 10.3 passes 50 probes early never passes early
mariadb 11.4 passes 27 probes early never passes early

Those four cover both branches of the version conditional in the check, and all three ping call sites.

docker compose up -d --wait mysql reaches healthy in 5–11s on a cold volume, well inside the existing 60s start_period.

The same defect in CI

install-testing.yml and reusable-upgrade-testing.yml start their database service with --health-cmd="mysqladmin ping" and no host argument at all, so it defaults to localhost and hits the socket. A service container always starts on a cold volume, and the steps connect to the mapped port with --dbhost="127.0.0.1:$PORT", so it is the same mismatch. Measured the same way, with the workflows' own MYSQL_ROOT_PASSWORD and MYSQL_DATABASE settings, the old command passed 22 probes (mysql 5.7) and 29 probes (mysql 8.4) before the port accepted connections.

The race is usually masked there by the 30s --health-interval, since the first probe lands after initialisation has finished. That interval is left alone: it is what makes this latent rather than a visible failure, and shortening it is a separate question.

Both also now select the client from db-type and db-version, the way the Docker healthcheck already does. reusable-upgrade-testing.yml documents db-type as accepting mariadb, but the binary name was hardcoded, and MariaDB dropped the mysqladmin symlink in 11.0:

Image mysqladmin mariadb-admin
mysql 5.7, 8.0, 8.4, 9.7 yes —
mariadb 10.3 yes —
mariadb 10.4, 10.11 yes yes
mariadb 11.0, 11.1, 11.4, 12.3 no yes

Every caller passes mysql today, so this has not fired, but a mariadb: 11.x caller would have waited out the retries on a check that could never run. Verified end to end on both branches of the new conditional: mariadb 10.3 via mysqladmin, mariadb 11.4 via mariadb-admin, neither passing before the port accepted.

On --protocol=tcp

It is belt and braces next to -h 127.0.0.1, and deliberately so. Measured on every image above, the host argument alone already picks TCP: with no server listening the client reports Can't connect to MySQL server on '127.0.0.1', where -h localhost reports Can't connect to local MySQL server through socket. Only the literal localhost selects the socket.

The flag is kept because it states the invariant the check depends on, rather than leaving it implied by a client-specific special case that a later edit could quietly undo. It also makes the check immune to a protocol=socket in a client option file, which would otherwise override the host argument.

The env:install retry

The comment above wp_cli_retry() in tools/local-env/scripts/install.js cited this broken healthcheck as the reason the retry exists. That is no longer accurate, so it is reworded to describe what the retry still covers: env:install can be run on its own, without env:start having waited for the container to report healthy.

The retry itself, added in [62938] for #65742, is unchanged.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Reviewing the fix, measuring client transport selection and healthcheck timing across the database images, locating the same defect in the two CI workflows, and drafting the commit messages and this description. The change itself is a host and protocol argument on five ping invocations, a client name made conditional, and three comments; I reviewed and take responsibility for all of it.

#4 @lancewillett
2 months ago

In 63871:

Build/Test Tools: Check database readiness over TCP.

Ping 127.0.0.1 with --protocol=tcp in the local Docker environment and the installation and upgrade testing workflows. This prevents the temporary socket-only server used during database initialization from reporting healthy before TCP connections are available.

Select the appropriate administration client for MariaDB versions in the CI healthchecks. Clarify why the standalone environment installation command retains its connection retry.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13563

Props lucatume, adrianmoldovanwp.
See #66117.

#5 @lancewillett
2 months ago

  • Owner set to lancewillett
  • Status new → accepted

Keeping this ticket open to land the backports to older WordPress version branches.

​@lancewillett commented on ​PR #13563:


2 months ago
#6

https://core.trac.wordpress.org/changeset/63871 for trunk

@lucatume Are you also working on backporting this fix to 7.1 through 6.8?

​@lucatume commented on ​PR #13563:


8 weeks ago
#7

https://core.trac.wordpress.org/changeset/63871 for trunk

@lucatume Are you also working on backporting this fix to 7.1 through 6.8?

Thanks @lancewillett.
Yes: I'm backporting the fix to older branches, if possible back to WordPress 4.7.

This ticket was mentioned in ​PR #13686 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#8

Backports [63871] to the 7.1 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early. On this branch wp_cli_retry() already absorbs the resulting Database connection error (2002) in env:install; this removes the early "healthy" state itself. This pings -h 127.0.0.1 --protocol=tcp instead.

Changes docker-compose.yml and tools/local-env/scripts/install.js. The two workflow files the trunk commit touches don't exist on this branch, so they're left out.

Checked on a cold volume on the 6.8 branch (mysql 8.4) and the 7.1 branch (mysql 9.7, mariadb 10.3, mariadb 11.4), probing the old and the new command side by side until TCP came up: the old socket ping passed 7-21 probes while TCP was still down; the new one passed none. The healthcheck is the same on 6.8-7.1. docker compose config -q is clean.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Cherry-picking, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13687 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#9

Backports [63871] to the 7.0 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early and WP-CLI fails with Database connection error (2002). This pings -h 127.0.0.1 --protocol=tcp instead.

Changes docker-compose.yml only. The two workflow files the trunk commit touches don't exist on this branch, and install.js has no wp_cli_retry() here, so its comment change doesn't apply.

Checked on a cold volume on the 6.8 branch (mysql 8.4) and the 7.1 branch (mysql 9.7, mariadb 10.3, mariadb 11.4), probing the old and the new command side by side until TCP came up: the old socket ping passed 7-21 probes while TCP was still down; the new one passed none. The healthcheck is the same on 6.8-7.1. docker compose config -q is clean.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Cherry-picking, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13688 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#10

Backports [63871] to the 6.9 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early and WP-CLI fails with Database connection error (2002). This pings -h 127.0.0.1 --protocol=tcp instead.

Changes docker-compose.yml only. The two workflow files the trunk commit touches don't exist on this branch, and install.js has no wp_cli_retry() here, so its comment change doesn't apply.

Checked on a cold volume on the 6.8 branch (mysql 8.4) and the 7.1 branch (mysql 9.7, mariadb 10.3, mariadb 11.4), probing the old and the new command side by side until TCP came up: the old socket ping passed 7-21 probes while TCP was still down; the new one passed none. The healthcheck is the same on 6.8-7.1. docker compose config -q is clean.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Cherry-picking and resolving the docker-compose.yml conflict, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13689 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#11

Backports [63871] to the 6.8 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early and WP-CLI fails with Database connection error (2002). This pings -h 127.0.0.1 --protocol=tcp instead.

Changes docker-compose.yml only. The two workflow files the trunk commit touches don't exist on this branch, and install.js has no wp_cli_retry() here, so its comment change doesn't apply. upgrade-testing.yml calls reusable-upgrade-testing.yml@trunk, so it already gets the trunk fix for the CI healthcheck.

Checked on a cold volume on the 6.8 branch (mysql 8.4) and the 7.1 branch (mysql 9.7, mariadb 10.3, mariadb 11.4), probing the old and the new command side by side until TCP came up: the old socket ping passed 7-21 probes while TCP was still down; the new one passed none. The healthcheck is the same on 6.8-7.1. docker compose config -q is clean.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Cherry-picking and resolving the docker-compose.yml conflict, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

#12 @lucatume
8 weeks ago

Currently there are PRs open to backport the fix from versions 6.8 to 7.1, but lower versions will benefit from this as well.

I'm testing them in my fork and, once the currently open PRs are merged, I will open the PRs on the core repository to patch from 4.7 to 6.7.

#14 @lancewillett
8 weeks ago

In 63920:

Build/Test Tools: Check database readiness over TCP.

Ping the local Docker database over TCP so its healthcheck waits for the server to accept network connections.

Merges [63871] partially to the 7.1 branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13686

Reviewed by: jorbin.
Props lucatume.
See #66117.

#15 @lancewillett
8 weeks ago

In 63921:

Build/Test Tools: Check database readiness over TCP.

Ping the local Docker database over TCP so its healthcheck waits for the server to accept network connections.

Merges [63871] partially to the 7.0 branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13687

Reviewed by: jorbin.
Props lucatume.
See #66117.

#16 @lancewillett
8 weeks ago

In 63922:

Build/Test Tools: Check database readiness over TCP.

Ping the local Docker database over TCP so its healthcheck waits for the server to accept network connections.

Merges [63871] partially to the 6.9 branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13688

Reviewed by: jorbin.
Props lucatume.
See #66117.

#17 @lancewillett
8 weeks ago

In 63923:

Build/Test Tools: Check database readiness over TCP.

Ping the local Docker database over TCP so its healthcheck waits for the server to accept network connections.

Merges [63871] partially to the 6.8 branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13689

Reviewed by: jorbin.
Props lucatume.
See #66117.

This ticket was mentioned in ​PR #13729 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#22

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 4.7 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13730 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#23

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 4.8 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13731 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#24

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 4.9 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13732 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#25

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 5.0 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13733 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#26

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 5.1 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13734 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#27

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 5.2 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13735 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#28

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 5.3 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13736 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#29

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 5.4 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13737 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#30

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 5.5 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13738 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#31

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 5.6 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13739 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#32

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 5.7 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13740 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#33

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 5.8 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13741 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#34

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 5.9 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13742 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#35

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 6.0 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13743 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#36

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 6.1 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13744 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#37

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 6.2 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13745 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#38

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 6.3 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13746 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#39

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 6.4 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13747 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#40

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 6.5 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13748 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#41

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 6.6 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

This ticket was mentioned in ​PR #13749 on ​WordPress/wordpress-develop by ​@lucatume.


8 weeks ago
#42

Backport of r63871 (trunk via #13563), r59484 and r59489 to the 6.7 branch.

The mysql container healthcheck pinged -h localhost, which the client resolves to the Unix socket. On a cold volume the entrypoint's temporary --skip-networking server answers the socket before the real server listens on 3306, so the container reports healthy too early, and the php, cli and nginx containers start before the database accepts connections. This pings -h 127.0.0.1 --protocol=tcp instead (r63871).

The healthcheck on this branch also calls mariadb-admin for any MariaDB version. MariaDB 10.3 and earlier don't ship it, so the container can't report healthy on those versions. This brings in the version check from r59484, and the $$? escaping from r59489, so the healthcheck block matches trunk.

Changes docker-compose.yml only. The healthcheck line being replaced is the same on 4.7 to 6.7.

Checked on a cold volume, probing the old and the new command side by side until TCP came up:

Branch Database Old command passed while TCP was down New command
4.7 mysql 5.7 14 probes 0
6.7 mysql 8.0 10 probes 0
6.7 mariadb 10.3 19 probes 0

With the unpatched 6.7 healthcheck on mariadb 10.3, every check fails with mariadb-admin: not found (exit 127). docker compose config -q is clean on all 21 branches.

Testing instructions

  1. npm run env:stop, remove the mysql volume, npm run env:start.
  2. docker compose ps shows mysql healthy only after docker compose exec mysql mysqladmin ping -h 127.0.0.1 --protocol=tcp -ppassword succeeds.
  3. Repeat with LOCAL_DB_TYPE=mariadb and LOCAL_DB_VERSION=10.3: the container becomes healthy (before this change it never did).

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Applying the change across branches, measuring the healthcheck race and drafting this description. I've reviewed and take responsibility for all of it.

​@jorbin commented on ​PR #13746:


7 weeks ago
#43

When I test this change, the mysql container doesn't start.

`
Container wordpress-mysql-1 Error dependency mysql failed to start 2.6s
dependency failed to start: container wordpress-mysql-1 exited (1)

​@lancewillett commented on ​PR #13746:


7 weeks ago
#44

Thanks for testing. I tried the 6.4 branch before and after this patch with MySQL 8.0 and fresh database volumes; both started successfully.

CI also passed on the current revision: 41 successful checks, six skipped, and nothing pending. That supports the patch in the CI configurations, but does not explain the local startup failure.

Could you share the output of docker compose images mysql and docker compose logs --tail=100 mysql?

One possibility: MySQL 8.4 rejects this branch’s existing --default-authentication-plugin=mysql_native_password option. I reproduced that exit-code-1 failure locally, but the option is unchanged by this PR. The logs should tell us whether that explains your result.

---
<sub>Adversarial review · <code>gpt-6</code></sub>

#45 @lancewillett
7 weeks ago

In 63978:

Build/Test Tools: Check database readiness over TCP.

Use TCP for the database healthcheck so the temporary initialization server does not report readiness before the real server accepts connections. Use mysqladmin for older MariaDB versions and preserve failed ping status.

Merges the docker-compose.yml changes from [59484], [59489], and [63871] to the 6.7 branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13749

Reviewed by: jorbin.
Props lucatume.
See #66117.

#47 @lancewillett
7 weeks ago

In 63979:

Build/Test Tools: Check database readiness over TCP.

Use TCP for the database healthcheck so the temporary initialization server does not report readiness before the real server accepts connections. Use mysqladmin for older MariaDB versions and preserve failed ping status.

Merges the docker-compose.yml changes from [59484], [59489], and [63871] to the 6.6 branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13748

Reviewed by: jorbin.
Props lucatume.
See #66117.

#49 @lancewillett
7 weeks ago

In 63980:

Build/Test Tools: Check database readiness over TCP.

Use TCP for the database healthcheck so the temporary initialization server does not report readiness before the real server accepts connections. Use mysqladmin for older MariaDB versions and preserve failed ping status.

Merges the docker-compose.yml changes from [59484], [59489], and [63871] to the 6.5 branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13747

Reviewed by: jorbin.
Props lucatume.
See #66117.

#51 @lancewillett
7 weeks ago

In 64000:

Build/Test Tools: Record the merge of [59484], [59489], and [63871] to the 6.7 branch.

[63978] recorded this mergeinfo on docker-compose.yml only. Record it on the branch root instead.

See #66117.

#52 @lancewillett
7 weeks ago

In 64002:

Build/Test Tools: Record the merge of [59484], [59489], and [63871] to the 6.6 branch.

[63979] recorded this mergeinfo on docker-compose.yml only. Record it on the branch root instead.

See #66117.

#53 @lancewillett
7 weeks ago

In 64003:

Build/Test Tools: Record the merge of [59484], [59489], and [63871] to the 6.5 branch.

[63980] recorded this mergeinfo on docker-compose.yml only. Record it on the branch root instead.

See #66117.

​@lucatume commented on ​PR #13746:


7 weeks ago
#54

I've reproduced the exited (1) locally by starting this branch (MySQL 8.0) on a mysql volume already initialized by trunk (MySQL 9.7); both branches use the same wordpress_mysql volume, and MySQL 8.0 refuses to downgrade the data directory, I see Cannot downgrade from 90702 to 80046 in the mysql in the container logs.

The unpatched 6.4 branch fails the same way on that volume following the start on trunk, stop, do not remove volume and re-start on 6.4.
Running npm run env:clean and then npm run env:start fixes it for me.

I reproduced the failure with:

git checkout trunk
npm ci
npm run env:start
npm run env:install
npm run env:stop
git checkout 6.4
npm ci
npm run env:start
# Wait for failure
docker compose logs mysql | grep 'Cannot downgrade'

​@lancewillett commented on ​PR #13729:


11 days ago
#55

@adimoldovan @aaronjorbin following up on the Sep 25 request: this and its 17 sibling backports (#13730–#13746) have my approval and green CI. They need a second review before landing. One look at this PR covers the set, since the change is the same on every branch.

<sub>AI review · <code>claude-opus-5-5</code></sub>

#56 @lancewillett
6 days ago

In 65446:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 6.4 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13746

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#57 @lancewillett
6 days ago

In 65447:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 6.3 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13745

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#60 @lancewillett
6 days ago

In 65448:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 6.2 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13744

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#61 @lancewillett
6 days ago

In 65449:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 6.1 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13743

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#64 @lancewillett
6 days ago

In 65450:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 6.0 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13742

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#66 @lancewillett
6 days ago

In 65451:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 5.9 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13741

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#68 @lancewillett
6 days ago

In 65452:

svn commit

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 5.8 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13740

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#69 @lancewillett
6 days ago

In 65453:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 5.7 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13739

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#70 @lancewillett
6 days ago

In 65454:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 5.6 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13738

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#71 @lancewillett
6 days ago

In 65455:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 5.5 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13737

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#72 @lancewillett
6 days ago

In 65456:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 5.4 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13736

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#73 @lancewillett
6 days ago

In 65458:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 5.3 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13735

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#74 @lancewillett
6 days ago

In 65459:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 5.2 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13734

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#75 @lancewillett
6 days ago

In 65460:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 5.1 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13733

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#76 @lancewillett
6 days ago

In 65461:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 5.0 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13732

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#77 @lancewillett
6 days ago

In 65462:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 4.9 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13731

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#78 @lancewillett
6 days ago

In 65463:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 4.8 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13730

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#79 @lancewillett
6 days ago

In 65464:

Build/Test Tools: Check database readiness over TCP.

Merges r59484, r59489, and r63871 to the 4.7 branch.

Apply the database healthcheck changes from these revisions, retaining the client selection for older MariaDB versions. Leave their workflow and installation-script changes out of this branch.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13729

Props lucatume, adrianmoldovanwp, johnbillion, afercia, jorbin, desrosj.
See #66117.

#92 @lancewillett
6 days ago

  • Milestone 7.2
  • Resolution → invalid
  • Status accepted → closed

The remaining database healthcheck backports have landed through the 4.7 branch, completing the backport work this ticket was held open for. The final batch is in [65446]–[65456] and [65458]–[65464]. Verified the healthcheck content and branch-root mergeinfo on each branch. Closing as fixed.

#93 @lancewillett
6 days ago

  • Milestone → 7.2
  • Resolution invalid → fixed

Correcting the resolution to fixed and restoring the 7.2 milestone. The completed work and backport verification are recorded in the preceding comment.

Note: See TracTickets for help on using tickets.