Skip to content

Repair wp/5.6 branch Actions: Replace wp-env's database check with a MariaDB health check - #597

Closed
desrosj wants to merge 1 commit into
fix-actions-5.6/create-wp-env-databasesfrom
fix-actions-5.6/replace-db-check-with-healthcheck
Closed

desrosj wants to merge 1 commit into
fix-actions-5.6/create-wp-env-databasesfrom
fix-actions-5.6/replace-db-check-with-healthcheck

Conversation

@desrosj

@desrosj desrosj commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

What?

Ports #75046 ("wp-env: Fix MySQL startup race condition causing database connection errors"), using #83751's health check command:

  • mysql and tests-mysql get a health check (one MARIADB_HEALTHCHECK constant) and MARIADB_AUTO_UPGRADE, so existing databases get the user healthcheck.sh needs.
  • wordpress waits for mysql, and tests-wordpress for tests-mysql, with condition: service_healthy.
  • wp-env start no longer runs wp db check, its 30-second retry loop or the extra 4-second sleep.
  • CHANGELOG.md gets trunk's entry, extended for the ping fallback; the README note on wp db with MariaDB before 11.4 now says wp-env start isn't affected.

Why?

wp db check runs mariadb-check in the cli container. The current wordpress:cli image's client (MariaDB 11.8) requires TLS, and WP-CLI passes --no-defaults, so it can't be turned off. MariaDB before 11.4 offers no TLS by default, so the check fails with TLS/SSL error: SSL is required, but the server does not support it and wp-env start stops. This branch pins MariaDB 10.5 (#622), so every job that starts wp-env would fail. Trunk replaced the check with a health check that doesn't use the MySQL client.

How?

depends_on, start and clean follow WordPress#75046 hunk for hunk, adapted to this branch's commands/start.js, commands/clean.js and wordpress.js. start/clean still start only mysql directly; tests-mysql (added in #628) starts through depends_on.

The health check runs healthcheck.sh --connect --innodb_initialized only when the data directory has .my-healthcheck.cnf and the image has healthcheck.sh. Otherwise it pings over TCP on 127.0.0.1 with mariadb-admin (the only name in 11.0+) or mysqladmin (the only name before 10.4), with -p"" for the empty root password. WordPress#75046's unconditional healthcheck.sh fails on versions the MariaDB setting can select:

  • 10.2 and 10.3 images ship the script without the healthcheck user.
  • Images built before 2022, and old patch tags such as 10.5.8 and 10.6.4, have no script.
  • .my-healthcheck.cnf stays in the data volume, so an older image on a volume a newer one wrote would run a missing command (exit 127).

TCP rather than the Unix socket, because the temporary server that initializes a new volume answers on the socket before the real server is listening.

Testing:

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.

@desrosj
desrosj added this pull request to stack #557 September 30, 2026 10:38
@github-actions

Copy link
Copy Markdown

🤖 PR meta 🤖

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch from 5ba1f9c to 066744f Compare October 5, 2026 20:44
@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch from 066744f to 82beca6 Compare October 5, 2026 20:51
@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch from 82beca6 to 50097b2 Compare October 6, 2026 15:46
@desrosj
desrosj removed this pull request from stack #557 October 6, 2026 16:14
@desrosj
desrosj changed the base branch from fix-actions-5.6/add-mariadb-version-option to fix-actions-5.6/create-wp-env-databases October 6, 2026 16:14
@desrosj
desrosj added this pull request to stack #631 October 6, 2026 16:14
@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch from 50097b2 to e363c80 Compare October 7, 2026 13:03
@desrosj
desrosj removed this pull request from stack #631 October 7, 2026 18:05
@desrosj
desrosj changed the base branch from fix-actions-5.6/create-wp-env-databases to wp/5.6 October 7, 2026 18:06
@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch from e363c80 to 5902c85 Compare October 7, 2026 18:07
@desrosj
desrosj changed the base branch from wp/5.6 to fix-actions-5.6/create-wp-env-databases October 7, 2026 18:08
@desrosj
desrosj added this pull request to stack #670 October 7, 2026 18:08
@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch from 5902c85 to 488ffe0 Compare October 8, 2026 17:41
@desrosj
desrosj removed this pull request from stack #670 October 8, 2026 18:01
@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch from 488ffe0 to d332ff3 Compare October 8, 2026 18:01
@desrosj
desrosj added this pull request to stack #690 October 8, 2026 18:01
@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch from d332ff3 to b701249 Compare October 9, 2026 15:49
@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch 2 times, most recently from 0a31ae7 to f7dbfbc Compare October 9, 2026 15:54
@desrosj
desrosj removed this pull request from stack #690 October 9, 2026 19:56
@desrosj
desrosj changed the base branch from fix-actions-5.6/create-wp-env-databases to wp/5.6 October 9, 2026 19:56
@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch from f7dbfbc to 1d4b0b8 Compare October 9, 2026 19:57
@desrosj
desrosj changed the base branch from wp/5.6 to fix-actions-5.6/create-wp-env-databases October 9, 2026 19:59
@desrosj
desrosj added this pull request to stack #721 October 9, 2026 19:59
@desrosj
desrosj removed this pull request from stack #721 October 16, 2026 01:09
@desrosj
desrosj force-pushed the fix-actions-5.6/replace-db-check-with-healthcheck branch from 1d4b0b8 to ffb99b3 Compare October 16, 2026 01:09
@desrosj
desrosj added this pull request to stack #727 October 16, 2026 01:10
@desrosj
desrosj marked this pull request as ready for review October 16, 2026 13:16
@github-actions

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@desrosj

desrosj commented Oct 16, 2026

Copy link
Copy Markdown
Owner Author

Moved to WordPress#84972.

@desrosj desrosj closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant