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/api-shield/gotchas.md
1# Gotchas & Troubleshooting23## Common Errors45### "Schema Validation 2.0 not working after migration"67**Cause:** Classic rules still active, conflicting with new system8**Solution:**91. Delete ALL Classic schema validation rules102. Clear Cloudflare cache (wait 5 min)113. Re-upload schema via new Schema Validation 2.0 interface124. Verify in Security > Events135. Check action is set (Log/Block)1415### "Schema validation blocking valid requests"1617**Cause:** Schema too restrictive, missing fields, or incorrect types18**Solution:**191. Check Firewall Events for violation details202. Review schema in Settings213. Test schema in Swagger Editor224. Use Log mode to validate before blocking235. Update schema with correct specifications246. Ensure Schema Validation 2.0 (not Classic)2526### "JWT validation failing"2728**Cause:** JWKS mismatch with IdP, expired token, wrong header/cookie name, or clock skew29**Solution:**301. Verify JWKS matches IdP configuration312. Check token `exp` claim is valid323. Confirm header/cookie name matches config334. Test token at jwt.io345. Account for clock skew (±5 min tolerance)356. Use modern syntax: `is_jwt_valid(http.request.jwt.payload["{config_id}"][0])`3637### "BOLA detection false positives"3839**Cause:** Legitimate sequential access patterns, bulk operations, or sensitivity too high40**Solution:**411. Review BOLA events in Security > Events422. Lower sensitivity threshold (High → Medium → Low)433. Exclude legitimate bulk operations from detection444. Ensure session identifiers uniquely identify users455. Verify minimum traffic requirements met (1000+ req/day)4647### "Risk labels not appearing in firewall rules"4849**Cause:** Feature not enabled, insufficient traffic, or missing session identifiers50**Solution:**511. Verify Schema Validation 2.0 enabled522. Enable BOLA Detection in schema settings533. Configure session identifiers (required for BOLA)544. Wait 24-48h for ML model training555. Check minimum traffic thresholds met5657### "Endpoint discovery not finding APIs"5859**Cause:** Insufficient traffic (<500 reqs/10d), non-2xx responses, Worker direct requests, or incorrect session ID config60**Solution:** Ensure 500+ requests in 10 days, 2xx responses from edge (not Workers direct), configure session IDs correctly. ML updates daily.6162### "Sequence detection false positives"6364**Cause:** Lookback window issues, non-unique session IDs, or model sensitivity65**Solution:**661. Review lookback settings (10 reqs to managed endpoints, 10min window)672. Ensure session ID uniqueness per user (not shared tokens)683. Adjust positive/negative model balance694. Exclude legitimate workflows from detection7071### "GraphQL protection blocking valid queries"7273**Cause:** Query depth/size limits too restrictive, complex but legitimate queries74**Solution:**751. Review blocked query patterns in Security > Events762. Increase max_depth (default: 10) if needed773. Increase max_size (default: 100KB) for complex queries784. Whitelist specific query signatures795. Use Log mode to tune before blocking8081### "Token invalid"8283**Cause:** Configuration error, JWKS mismatch, or expired token84**Solution:** Verify config matches IdP, update JWKS, check token expiration8586### "Schema violation"8788**Cause:** Missing required fields, wrong data types, or spec mismatch89**Solution:** Review schema against actual requests, ensure all required fields present, validate types match spec9091### "Fallthrough"9293**Cause:** Unknown endpoint or pattern mismatch94**Solution:** Update schema with all endpoints, check path pattern matching9596### "mTLS failed"9798**Cause:** Certificate untrusted/expired or wrong CA99**Solution:** Verify cert chain, check expiration, confirm correct CA uploaded100101## Limits (2026)102103| Resource/Limit | Value | Notes |104|----------------|-------|-------|105| OpenAPI version | v3.0.x only | No external refs, must be valid |106| Schema operations | 10K (Enterprise) | Contact for higher limits |107| JWT validation sources | Headers/cookies only | No query params/body |108| Endpoint discovery | 500+ reqs/10d | Minimum for ML model |109| Path normalization | Automatic | `/profile/238` → `/profile/{var1}` |110| Schema parameters | No `content` field | No object param validation |111| BOLA detection | 1000+ reqs/day/endpoint | Per-endpoint minimum |112| Session ID uniqueness | Required | BOLA/Sequence need unique IDs |113| GraphQL max depth | 1-50 | Default: 10 |114| GraphQL max size | 1KB-1MB | Default: 100KB |115| JWT claim nesting | 10 levels max | Use dot notation |116| mTLS CA certificates | 5 custom max | CF-managed unlimited |117| Schema upload size | 5MB max | Compressed OpenAPI spec |118| Volumetric abuse baseline | 7 days training | Initial ML period |119| Auth Posture refresh | Daily | Updated nightly |120121## See Also122123- [configuration.md](configuration.md) - Setup guides to avoid common issues124- [patterns.md](patterns.md) - Best practices and progressive rollout125- [API Shield Docs](https://developers.cloudflare.com/api-shield/)126