Repository navigation
Repair wp/6.1 branch Actions: Replace wp-env's database check with a MariaDB health check - #592
Closed
desrosj wants to merge 1 commit into
Conversation
desrosj
added this pull request to stack #574
September 30, 2026 10:36
🤖 PR meta 🤖🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. |
desrosj
force-pushed
the
fix-actions-6.1/replace-db-check-with-healthcheck
branch
2 times, most recently
from
October 5, 2026 20:47
8d6912a to
bd16ad9
Compare
desrosj
removed this pull request from stack #574
October 5, 2026 20:48
desrosj
added this pull request to stack #611
October 5, 2026 20:48
desrosj
force-pushed
the
fix-actions-6.1/replace-db-check-with-healthcheck
branch
from
October 5, 2026 21:12
bd16ad9 to
bf202fb
Compare
desrosj
force-pushed
the
fix-actions-6.1/replace-db-check-with-healthcheck
branch
from
October 6, 2026 14:20
bf202fb to
aeb3d8b
Compare
desrosj
removed this pull request from stack #611
October 6, 2026 14:20
desrosj
added this pull request to stack #621
October 6, 2026 14:21
desrosj
force-pushed
the
fix-actions-6.1/replace-db-check-with-healthcheck
branch
from
October 6, 2026 15:46
aeb3d8b to
6e4e55e
Compare
desrosj
removed this pull request from stack #621
October 7, 2026 18:02
desrosj
changed the base branch from
fix-actions-6.1/pin-mariadb-version
to
wp/6.1
October 7, 2026 18:02
desrosj
force-pushed
the
fix-actions-6.1/replace-db-check-with-healthcheck
branch
from
October 7, 2026 18:04
6e4e55e to
98dcc78
Compare
desrosj
changed the base branch from
wp/6.1
to
fix-actions-6.1/pin-mariadb-version
October 7, 2026 18:05
desrosj
added this pull request to stack #667
October 7, 2026 18:05
desrosj
marked this pull request as ready for review
October 8, 2026 03:29
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Owner
Author
|
Moved to WordPress#84260. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Ports WordPress#75046 ("wp-env: Fix MySQL startup race condition causing database connection errors") to this branch's
wp-env:mysqlandtests-mysql) get a health check. It is Env: Add an option to choose the MariaDB version WordPress/gutenberg#83751's runtime check, kept in oneMARIADB_HEALTHCHECKconstant: it runs MariaDB'shealthcheck.sh --connect --innodb_initializedonly when the data directory has.my-healthcheck.cnfand the image hashealthcheck.sh, and otherwise pings the server over TCP on127.0.0.1withmariadb-adminormysqladmin.MARIADB_AUTO_UPGRADEis set so existing databases get the userhealthcheck.shneeds.wordpressandtests-wordpressdepend on their database withcondition: service_healthy, so Docker Compose only starts WordPress once MariaDB is ready.wp db checkconnection check, its 30-second retry loop and the extra 4-second sleep are removed fromwp-env start.wp-env startstartsmysqlandtests-mysqltogether, andwp-env cleanstarts only the database(s) it resets.packages/env/CHANGELOG.mdgets trunk's entry, extended to describe the ping fallback, with links to wp-env: Fix MySQL startup race condition causing database connection errors WordPress/gutenberg#75046 and Env: Add an option to choose the MariaDB version WordPress/gutenberg#83751.wp dbcommands with MariaDB servers before 11.4 now says thatwp-env startis not affected either, since it no longer runswp db check.Why?
wp db checkrunsmariadb-checkin theclicontainer. The client in the currentwordpress:cliimage (MariaDB 11.8) requires TLS by default, and WP-CLI runs it with--no-defaults, so nothing can turn that off. MariaDB releases before 11.4 have no TLS unless it's configured, so the check fails withTLS/SSL error: SSL is required, but the server does not support itandwp-env startstops. #585 pins MariaDB10.6, which is one of those releases, so every job that startswp-envfails.trunkremovedwp db checkin WordPress#75046 and waits for MariaDB with a health check instead, which doesn't use the MySQL client at all.How?
The
depends_on,startandcleanchanges follow WordPress#75046 hunk for hunk, adapted to this branch's file layout (commands/start.js,commands/clean.jsandwordpress.js).The health check command is WordPress#83751's rather than WordPress#75046's, because running
healthcheck.shunconditionally doesn't work with every version the MariaDB version setting can select:healthcheck.shwithout the healthcheck user, so the script fails.10.5.8and10.6.4, have nohealthcheck.sh..my-healthcheck.cnflives in the data volume, so it is still there when an older image without the script runs on a volume a newer image wrote. Checking only for the file would then run a missing command (exit code 127).The fallback uses
mariadb-adminwhen the image has it (11.0 and newer only ship that name) andmysqladminotherwise (versions before 10.4 only ship that name). It connects to127.0.0.1over TCP rather than the Unix socket, which the temporary server that initializes a new volume answers before the real server is listening.Testing:
/bin/shwith stubhealthcheck.sh,mariadb-adminandmysqladminscripts (skipped on Windows). They replace$$with.split().join()instead ofreplaceAll, which Node 14 doesn't have.npm run test-unit -- packages/envpasses all 107 tests locally.wp-env startwith"mariadbVersion": "10.6"succeeds: both database containers report healthy and WordPress installs in both environments. Withmariadb:10.3, which has no healthcheck user, both databases become healthy through the ping fallback.Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.