Replies: 5 comments
|
Actually. on the last deploy, deploy the ' The PHP image needs a rebuild (SpawnWP update or forced): this deploy takes about 5 minutes; the next ones about 35 seconds.' was there, but found the cached PHP, and deployed quickly. Used my saved blueprint and got: Error: This does not seem to be a WordPress installation. |
|
Fixed with Claude :) Item 1 — Bug: "Refresh" PHP image fails with "Exited with code 2" when the primary project has no .env Regression Symptom set -euo pipefail
exits here, code 2 (grep .env → exit 2; .env does not exist)$ ls -la /srv/wp-dev/.env Impact / scope Suggested fix (one line) Verification ==> Refreshing wp-dev-php:8.4: pulling the latest base and rebuilding... Item 2 — Enhancement: front-end vhost serves HTTP/1.1 only; enable HTTP/2 Evidence Source listen 443 ssl; listen 443 ssl http2; Verification $ curl -sI --http2 https:/// -o /dev/null -w '%{http_version}\n' Rationale |
|
Follow-up report: PHP image cache is rarely reused — pinned-version blueprints and stray files both force needless rebuilds Context The gate key (identical in both scripts): CONTEXT_HASH=$( { cd docker/php && find . -type f ! -name 'zz-site.ini' -print0 reuse image only if its org.spawnwp.context-hash label == CONTEXT_HASHIssue A — "Refresh" cannot pre-warm a pinned-WP-version blueprint Consequence: any blueprint that pins a WP version (ours captures WP_VERSION=7.0.1) computes a hash with wp=7.0.1, which can never equal the refreshed image's wp=latest hash. So Refresh does nothing useful for pinned-version blueprints — the deploy rebuilds regardless. Evidence: Refreshed image label (Refresh PHP 8.4) : ecaddcdcf739 # = hash(wp-dev docker/php + wp=latest) Let the operator pick the WP version when refreshing (the System tab already knows the installed PHP versions; add a WP-version selector), and/or pre-warm the versions actually referenced by saved blueprints. How we hit it: a single leftover Dockerfile.bak-… in docker/php shifted the hash: wp-dev docker/php WITH stray .bak + wp=latest : ecaddcdcf739 Suggested fixes (any of): Hash only a known list of build inputs (e.g. Dockerfile, the .ini files that are actually COPY'd, phpstan-wp.neon) rather than find . -type f. Positive note |
|
All four of these are fixed in 0.5.20, which is out now. Thank you — this was a genuinely good set of reports, and two of them turned out to be symptoms of causes that ran deeper than they looked. The rebuild loopYour read was that Refresh couldn't pre-warm a pinned-WP blueprint. That's true, but it's downstream of the real bug: the image tag was keyed on the PHP version alone, while the image contents also depend on the WordPress version (the Dockerfile bakes the core in). So a site on The tag now carries the WordPress version: This also closes a hazard nobody had noticed: because both sites shared one tag, a site brought Down and back Up could come back running another site's WordPress core. There was a third, independent source of the same symptom that no report could have surfaced: switching a site's PHP version built the image without stamping its cache key, so the image got labelled "This does not seem to be a WordPress installation"Not flakiness — a race, and a nasty one. Bootstrap now waits for the core files. nginx gets the same 60-second start-up grace as PHP, which is the other half of your "container was not healthy". Refresh → "Exited with code 2"Your diagnosis was spot on, down to the Stray files in the build contextAlso fixed, and worth underlining for anyone reading later: the cache key was computed over every file in HTTP/2Enabled, for sites and the cockpit. You were right that everything was already in place — module compiled in, TLS with ALPN — it was simply never switched on. Existing installs get it automatically on update; HTTP/1.1 clients are unaffected. What you need to doJust update. Your existing sites keep working as they are. The first deploy on each PHP version after updating pays a one-off rebuild — the cache key changed shape — which also clears out any image left holding the wrong WordPress core. After that, deploys reuse the image the way they were always supposed to. Full notes: https://spawnwp.com/docs/release-notes/0.5.20/ |

Uh oh!
There was an error while loading. Please reload this page.
With the latest update; deploying on PHP 8.4, every deploy rebuilds PHP:
' The PHP image needs a rebuild (SpawnWP update or forced): this deploy takes about 5 minutes; the next ones about 35 seconds.' on every deploy.
Deployment has gone flakey. I deployed a site on 8.4, it rebuilt PHP and deployed properly. The site worked.
Deployed another 8.4 site. It said that PHP was already cached. However, got an error saying the container was not healthy.
Deployed again and got ' The PHP image needs a rebuild (SpawnWP update or forced): this deploy takes about 5 minutes; the next ones about 35 seconds.' on every deploy. again.
All reactions