Setting the file. One moment.
Chapter 04 · Cloudflare Deploy
Subchapter 4.145
references/pipelines/gotchas.mdMarkdown2 KBView on GitHub
Most common issue. Events accepted (HTTP 200) but never appear in sink.
Causes:
Solution: Validate client-side with Zod:
const EventSchema = z.object({ user_id: z.string(), amount: z.number() });
try {
const validated = EventSchema.parse(rawEvent);
await env.STREAM.send([validated]);
} catch (e) { /* get immediate feedback */ }Cannot modify SQL after creation. Must delete and recreate.
npx wrangler pipelines delete old-pipeline
npx wrangler pipelines create new-pipeline --sql "..."Tip: Use version naming (events-pipeline-v1) and keep SQL in version control.
env.STREAM is undefined
wrangler.jsoncnpx wrangler pipelines streams list # Get stream ID
npx wrangler deploy| Error | Cause | Fix |
|---|---|---|
| Events not in R2 | Roll interval not elapsed | Wait 10-300s, check roll_interval |
| Schema validation failures | Type mismatch, missing fields | Validate client-side |
| Rate limit (429) | >5 MB/s per stream | Batch events, request increase |
| Payload too large (413) | >1 MB request | Split into smaller batches |
| Cannot delete stream | Pipeline references it | Delete pipelines first |
| Sink credential errors | Token expired | Recreate sink with new credentials |
| Resource | Limit |
|---|---|
| Streams/Sinks/Pipelines per account | 20 each |
| Payload size | 1 MB |
| Ingest rate per stream | 5 MB/s |
| Event retention | 24 hours |
| Recommended batch size | 100 events |
INSERT INTO ... SELECT ... FROMnpx wrangler pipelines streams listnpx wrangler pipelines get <ID>