Skip to content
Latchkey

Tekton interceptor "failed to parse body" in CI

An interceptor (GitHub, GitLab, or CEL) tried to read the incoming webhook body and failed, either because the payload is not valid JSON or because a CEL expression references a missing field. The event is rejected before a run is created.

What this error means

EventListener logs show "failed to parse body as JSON" or a CEL error like "no such key" while evaluating an interceptor.

Tekton
interceptor stopped trigger processing: failed to parse body as JSON: invalid character '<' looking for beginning of value

Common causes

The webhook did not send JSON

A wrong content type, a form-encoded payload, or an HTML error page instead of JSON makes the interceptor fail to parse.

A CEL expression references a missing field

A CEL filter reads body.head_commit.id on a payload that has no such key, so evaluation errors.

How to fix it

Send JSON with the right content type

  1. Configure the webhook to send application/json.
  2. Confirm the payload the interceptor expects (push vs pull_request).
  3. Re-send the event and check the EventListener logs.
Terminal
# GitHub webhook: set Content type to application/json

Guard CEL field access

Check the field exists before reading it so an absent key does not error.

eventlistener.yaml
interceptors:
  - ref:
      name: cel
    params:
      - name: filter
        value: "has(body.head_commit) && body.ref == 'refs/heads/main'"

How to prevent it

  • Set the webhook content type to application/json.
  • Use has() in CEL before reading optional fields.
  • Match the interceptor to the event type the webhook sends.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →