Introduction
Cloudflare Load Balancer marking pool unhealthy when health check endpoint fails. This guide provides step-by-step diagnosis and resolution.
Symptoms
Typical error output:
bash
Error: Cloudflare operation failed
Check Cloudflare dashboard for details
wrangler tail for Workers logsCommon Causes
- 1.Configuration mismatch in Cloudflare dashboard
- 2.Resource limit exceeded for plan tier
- 3.Network or DNS propagation delay
- 4.Rule or policy too restrictive or misconfigured
Step-by-Step Fix
Step 1: Check Current State
bash
# Check Cloudflare status
wrangler tail # For Workers
curl -I https://example.com # For site issues
# Check dashboard: dash.cloudflare.comStep 2: Identify Root Cause
bash
wrangler whoami
wrangler tail
curl -I https://your-domain.comStep 3: Apply Primary Fix
```bash # Primary fix: Update configuration wrangler config wrangler deploy
# Check logs wrangler tail --format pretty ```
Step 4: Apply Alternative Fix
bash
# Alternative: Check via API
curl -X GET "https://api.cloudflare.com/client/v4/zones/<zone-id>/settings" \
-H "Authorization: Bearer <api-token>"Step 5: Verify the Fix
bash
curl -I https://example.com
wrangler tail
# Should show successful responseCommon Pitfalls
- Not waiting for DNS propagation
- Using wrong zone ID in API calls
- Forgetting to deploy after config changes
- Not testing Workers locally before deploying
Best Practices
- Use wrangler for local development and testing
- Monitor Workers logs with wrangler tail
- Set up alerts for WAF and DDoS events
- Review analytics regularly for anomalies
Related Issues
- Cloudflare 5xx Errors
- Cloudflare DNS Resolution Failed
- Cloudflare SSL Handshake Error
- Cloudflare Cache Miss