Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/tunnel/gotchas.md
1# Tunnel Gotchas23## Common Errors45### "Error 1016 (Origin DNS Error)"67**Cause:** Tunnel not running or not connected8**Solution:**9```bash10cloudflared tunnel info my-tunnel # Check status11ps aux | grep cloudflared # Verify running12journalctl -u cloudflared -n 100 # Check logs13```1415### "Self-signed certificate rejected"1617**Cause:** Origin using self-signed certificate18**Solution:**19```yaml20originRequest:21noTLSVerify: true # Dev only22caPool: /path/to/ca.pem # Custom CA23```2425### "Connection timeout"2627**Cause:** Origin slow to respond or timeout settings too low28**Solution:**29```yaml30originRequest:31connectTimeout: 60s32tlsTimeout: 20s33keepAliveTimeout: 120s34```3536### "Tunnel not starting"3738**Cause:** Invalid config, missing credentials, or tunnel doesn't exist39**Solution:**40```bash41cloudflared tunnel ingress validate # Validate config42ls -la ~/.cloudflared/*.json # Verify credentials43cloudflared tunnel list # Verify tunnel exists44```4546### "Connection already registered"4748**Cause:** Multiple replicas with same connector ID or stale connection49**Solution:**50```bash51# Check active connections52cloudflared tunnel info my-tunnel5354# Wait 60s for stale connection cleanup, or restart with new connector ID55cloudflared tunnel run my-tunnel56```5758### "Tunnel credentials rotated but connections fail"5960**Cause:** Old cloudflared processes using expired credentials61**Solution:**62```bash63# Stop all cloudflared processes64pkill cloudflared6566# Verify stopped67ps aux | grep cloudflared6869# Restart with new credentials70cloudflared tunnel run my-tunnel71```7273## Limits7475| Resource/Limit | Value | Notes |76|----------------|-------|-------|77| Free tier | Unlimited tunnels | Unlimited traffic |78| Tunnel replicas | 1000 per tunnel | Max concurrent |79| Connection duration | No hard limit | Hours to days |80| Long-lived connections | May drop during updates | WebSocket, SSH, UDP |81| Replica registration | ~5s TTL | Old replica dropped after 5s no heartbeat |82| Token rotation grace | 24 hours | Old tokens work during grace period |8384## Best Practices8586### Security871. Use token-based tunnels (config source: cloudflare) for centralized control882. Enable Access policies for sensitive services893. Rotate tunnel credentials regularly904. After rotation: stop all old cloudflared processes within 24h grace period915. Verify TLS certs (`noTLSVerify: false`)926. Restrict `bastion` service type9394### Performance951. Run multiple replicas for HA (2-4 typical, load balanced automatically)962. Replicas share same tunnel UUID, get unique connector IDs973. Place `cloudflared` close to origin (same network)984. Use HTTP/2 for gRPC (`http2Origin: true`)995. Tune keepalive for long-lived connections1006. Monitor connection counts101102### Configuration1031. Use environment variables for secrets1042. Version control config files1053. Validate before deploying (`cloudflared tunnel ingress validate`)1064. Test rules (`cloudflared tunnel ingress rule <URL>`)1075. Document rule order (first match wins)108109### Operations1101. Monitor tunnel health in dashboard (shows active replicas)1112. Set up disconnect alerts (when replica count drops to 0)1123. Graceful shutdown for config updates1134. Update replicas in rolling fashion (update 1, wait, update next)1145. Keep `cloudflared` updated (1 year support window)1156. Use `--no-autoupdate` in prod; control updates manually116117## Debug Mode118119```bash120cloudflared tunnel --loglevel debug run my-tunnel121cloudflared tunnel ingress rule https://app.example.com122```123124## Migration Strategies125126### From Ngrok127```yaml128# Ngrok: ngrok http 8000129# Cloudflare Tunnel:130ingress:131- hostname: app.example.com132service: http://localhost:8000133- service: http_status:404134```135136### From VPN137```yaml138# Replace VPN with private network routing139warp-routing:140enabled: true141```142143```bash144cloudflared tunnel route ip add 10.0.0.0/8 my-tunnel145```146147Users install WARP client instead of VPN.148