Skip to content
Error codes · realuptime errors ingest

RU-4004: Malformed error batch

The batch failed validation and was refused WHOLE: accepting the parsed half of a broken batch would fabricate data. The refused events are counted as dropped_malformed on your dashboard. Ships with `reason: "malformed"`.

Where it is raised

  • Errors ingest (/api/errors/v1/ingest)

What triggers it

The batch parser refuses the whole body for the first failing field. A batch of more than 50 events fails here too, with events must contain 50 entries or fewer. The refusal is counted as dropped malformed events, one per event in the array when its length is readable. Entries over the hard map limit take RU-4009 instead.

Example response

POST /api/errors/v1/ingest/<key>
HTTP 400

{
  "error": "Body must be valid JSON.",
  "reason": "malformed",
  "code": "RU-4004"
}

Common causes

  • A hand-rolled client not matching the ingest payload shape.
  • A field with the wrong type (for example a numeric string where a number is required).
  • An empty events array, or a batch over the per-batch event cap.

How to fix it

  1. Read the `error` field: it names the exact failing field.
  2. Use an official SDK, or match its payload shape exactly.
  3. Resend the corrected batch; the refused one wrote nothing.