Troubleshooting Common Issues

1. Debugging Routing Problems

SymptomLikely Cause
404 from gatewayNo matching route, path mismatch
Wrong upstreamRoute priority/order
Path stripped/addedstrip_path mis-config
Host mismatchSNI/Host header rule
Toolcurl -v, gateway debug logs

2. Resolving Timeout Issues

LayerTune
Client → Gatewayrequest_timeout
Gateway → Upstreamupstream_connect/read/send_timeout
Upstream → DBstatement_timeout, pool_timeout
Idle keep-aliveServer > LB > client
504 from LBBackend > LB timeout

3. Troubleshooting SSL/TLS Errors

ErrorFix
CERT_HAS_EXPIREDRenew certificate
UNABLE_TO_VERIFY_LEAFInstall intermediate chain
HOSTNAME_MISMATCHAdd SAN, check SNI
HANDSHAKE_FAILURECipher/version mismatch
Toolsopenssl s_client, SSL Labs, testssl.sh

4. Fixing CORS Configuration

SymptomFix
Missing CORS headerEnable plugin, add origin
Preflight failsAllow OPTIONS, Access-Control-Allow-Methods
Credentials blockedCannot use * + credentials
Cache staleVary: Origin, lower max-age
Wildcard subdomainReflect origin from regex

5. Debugging Authentication Failures

ErrorCause
401 invalid signatureWrong JWKS, key rotation
401 token expiredClock skew, short TTL
401 wrong audienceaud claim mismatch
401 wrong issueriss URL mismatch
Debugjwt.io decode, JWKS endpoint check

6. Resolving Rate Limit Issues

SymptomInvestigation
Unexpected 429Check identifier (IP behind NAT?)
Limits not enforcedRedis down, fallback to local
Counter driftClock sync, sync_rate plugin
Retry-After ignoredClient doesn't respect header
Burst exceededIncrease capacity vs refill

7. Troubleshooting Backend Connectivity

IssueDiagnosis
Connection refusedBackend down, wrong port
Connection resetBackend crash, idle timeout
No route to hostNetworkPolicy, security group
DNS resolution failResolver, ndots, /etc/resolv.conf
TCP resetSYN-ACK timeout, MTU/MSS
Toolstcpdump, netcat, dig, mtr

8. Fixing Response Transformation Errors

SymptomCause
Invalid JSON returnedTransform breaks structure
Empty bodyFilter strips required field
Content-Length mismatchBody modified but header not
Encoding garbledCharset, gzip-then-modify
FixTest transforms in isolation, log before/after

9. Debugging Cache Invalidation

IssueInvestigation
Stale data after updatePurge fired? Tag mismatch?
Cache always missesVary header too broad, cookie
Wrong response cachedVary missing, auth header
Purge delayedMulti-PoP propagation lag
ToolX-Cache, Age, surrogate keys

10. Resolving Load Balancing Issues

SymptomCause & Fix
Uneven distributionSticky sessions, hash algorithm
All traffic to one nodeOthers failed health check
FlappingTighten/relax health thresholds
Slow node poisoningAdd EWMA, outlier ejection
Cold start spikesPre-warm, slow start ramp
DiagnosePer-upstream metrics, access logs by node