Octopus "Health check failed" in CI
An octo health-check task ended in a Failed state because at least one target could not be contacted or returned an error. Health checks verify connectivity and the target machine before a deploy, so a failure here usually blocks or precedes a failed deployment.
What this error means
octo health-check exits non-zero with "The health check failed" and a per-target result showing which machines were unreachable or errored.
octo health-check --environment "Production"
The health check task finished with a status of 'Failed'. 1 machine could not
be contacted: web-02.internal.Common causes
A target is unreachable
The health check could not connect to a machine because its agent is down, a port is blocked, or the host is offline.
The target errored during the check
The machine responded but a health-check script or the connection returned an error, so the check is reported as failed for that target.
How to fix it
Fix the unreachable or erroring target
- Read the per-target result to see which machine failed and why.
- Restore its agent or connectivity, or fix the health-check error.
- Re-run the health check and confirm all targets pass.
octo health-check --environment "Production" \
--server "$OCTOPUS_URL" --apiKey "$OCTOPUS_API_KEY"Scope the check to healthy targets if needed
While repairing a specific machine, restrict the deploy to healthy targets so a single failing host does not block the whole pipeline.
How to prevent it
- Run a health check as a gate before deploying.
- Monitor and alert on target connectivity between deploys.
- Keep agents and firewall rules stable so checks pass reliably.