Self-Healing CI: Recovering a Playwright Host Validation Failure
A Playwright host-deps validation that fails usually hit a transient package-fetch blip while installing system libraries, not a permanently unsupported host -- a retry clears it.
The problem
A Playwright setup step fails during host validation / install-deps because installing required system libraries (or fetching their package metadata) hit a transient error. The host is supported and the libraries exist; a package-fetch blip interrupted the install. A human re-runs and the dependencies install cleanly.
Host system is missing dependencies to run browsers.
Failed to install browser dependencies (apt-get returned a transient error)Why it happens
Playwright validates and installs the system libraries its browsers need, which fetches OS packages over the network, so a transient mirror or metadata blip during that install can fail validation even though the host is supported and the libraries are available.
It is a setup-time package-fetch blip, not an unsupported host: refreshing metadata and retrying the dependency install makes validation pass.
The manual fix
Manual mitigations for host validation:
- Re-run the job so the dependency install is retried.
- Refresh package metadata before
install-deps, then retry. - Use a base image with the browser dependencies preinstalled to avoid the fetch.
npx playwright install-deps || (sleep 5 && npx playwright install-deps)How this gets automated
A host-validation failure caused by a transient package fetch has a recognizable signature -- a fetch/install error on system libraries, not a genuine unsupported-host error -- and the safe response is to refresh metadata and retry. A self-healing CI pipeline detects the dependency-install failure, retries the setup, and only escalates if the host is genuinely unsupported or the libraries are truly unavailable.