Skip to content
Error codes · Monitors, checks & agents

RU-3004: Invalid response assertions

The response assertions on this monitor are not internally consistent (for example a body operator without a value, a status range whose minimum exceeds its maximum, or a JSON assertion whose path and condition do not pair up), or assertions were set on a non-HTTP monitor.

Where it is raised

  • POST /api/v1/checks
  • PATCH /api/v1/checks/{id}/assertions

What triggers it

Each assertion group must be complete: a body condition needs its text, a header assertion needs name, condition and value together, and a status range needs its bounds in order. The create route runs this check before the interval check. Setting assertions on a monitor that is not http answers Response assertions are only available on http monitors.

Example response

PATCH /api/v1/checks/{id}/assertions
HTTP 400

{
  "error": "A body assertion needs both a condition and text to look for.",
  "code": "RU-3004"
}

Common causes

  • An assertion operator supplied without its value, or vice versa.
  • A status range like 500–200.
  • A JSON path with no condition, an "exists" condition given a value it does not take, or an "equals"/"contains" condition with no value.
  • A JSON path using a wildcard, a filter expression, or recursive descent, none of which are supported.
  • Setting response assertions on a TCP, SMTP, or heartbeat monitor.

How to fix it

  1. Pair every assertion operator with a value.
  2. Keep status ranges min ≤ max.
  3. Write JSON paths as plain keys and indexes, for example data.items[0].status.
  4. Only set response assertions on http monitors.

Related codes