The panel's KEL push to the recipient's agent is refused 400 on every issue, and nobody reads the answer #1988

Closed
opened 2026-09-29 02:58:01 +00:00 by ben · 2 comments
Owner

What happened

Every credential issued from the control panel logs a refused KEL push on the gateway. Seen twice on Whakatōhea Demo:

UTC Destination Request Result
2026-09-28 22:37:18 EI5am6mv… (ben) POST keria-cesr.<apex>/ 400, 104 bytes
2026-09-29 02:38:29 EExc8YEi… (Tairea) POST keria-cesr.<apex>/ 400, 104 bytes

104 bytes is exactly KERIA's {"title": "Malformed JSON", "description": "Could not decode the request body. The JSON was incorrect."}.

Cause

pushKelToAgent in app/src/lib/keri/client.ts:635 posts the whole KEL as one body — kel.map(JSON.stringify).join('') — with Content-Type: application/cesr+json. KERIA's CESR door parses the body as ONE JSON event with its attachments in the CESR-ATTACHMENT header, so several events joined together fail to decode. The function never reads the response, so the fault is silent.

The gateway's own Go pushes to the same door answer 204.

Effect

The push has never worked for a KEL longer than one event, which is every community's org AID. Issuance still completed both times because the recipient's agent already had the org's key state, so the grant was delivered anyway. A recipient that does not have it would get the grant escrowed with nothing reported.

What to build

  • Post one event per request, the event JSON as the body and its attachments in CESR-ATTACHMENT, in KEL order.
  • Read the response: a non-2xx throws with the status and body, and issueCredential reports it rather than going on to the grant.
  • A test against the real request shape (body is one JSON object, header present), not only "fetch was called".

Acceptance criteria

  • Issuing a credential from the panel produces only 2xx on keria-cesr.<apex>/ in the gateway access log.
  • A refused push fails the issue with a message that names the push.

Found while diagnosing matou-app's missing grant handler (credential issued after onboarding never reaches the wallet).

## What happened Every credential issued from the control panel logs a refused KEL push on the gateway. Seen twice on Whakatōhea Demo: | UTC | Destination | Request | Result | |---|---|---|---| | 2026-09-28 22:37:18 | `EI5am6mv…` (ben) | `POST keria-cesr.<apex>/` | **400**, 104 bytes | | 2026-09-29 02:38:29 | `EExc8YEi…` (Tairea) | `POST keria-cesr.<apex>/` | **400**, 104 bytes | 104 bytes is exactly KERIA's `{"title": "Malformed JSON", "description": "Could not decode the request body. The JSON was incorrect."}`. ## Cause `pushKelToAgent` in `app/src/lib/keri/client.ts:635` posts the whole KEL as one body — `kel.map(JSON.stringify).join('')` — with `Content-Type: application/cesr+json`. KERIA's CESR door parses the body as ONE JSON event with its attachments in the `CESR-ATTACHMENT` header, so several events joined together fail to decode. The function never reads the response, so the fault is silent. The gateway's own Go pushes to the same door answer 204. ## Effect The push has never worked for a KEL longer than one event, which is every community's org AID. Issuance still completed both times because the recipient's agent already had the org's key state, so the grant was delivered anyway. A recipient that does not have it would get the grant escrowed with nothing reported. ## What to build - Post one event per request, the event JSON as the body and its attachments in `CESR-ATTACHMENT`, in KEL order. - Read the response: a non-2xx throws with the status and body, and `issueCredential` reports it rather than going on to the grant. - A test against the real request shape (body is one JSON object, header present), not only "fetch was called". ## Acceptance criteria - Issuing a credential from the panel produces only 2xx on `keria-cesr.<apex>/` in the gateway access log. - A refused push fails the issue with a message that names the push. Found while diagnosing matou-app's missing grant handler (credential issued after onboarding never reaches the wallet).

swarm-claim host=matou-dev-server-01 run=35496
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=35496 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1988 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1988,
  "status": "success",
  "commits": [
    "2a2dfecdd023909c92978ca2176ffd513b79a234"
  ],
  "changed_files": [
    "app/src/lib/keri/client.ts",
    "app/tests/unit/keri/pushKel.test.ts",
    "docs/GOTCHAS.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "cd app && npx vitest run tests/unit/keri/pushKel.test.ts",
      "exit_code": 0
    },
    {
      "command": "cd app && npx vitest run tests/unit/keri/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Issuing a credential from the panel produces only 2xx on keria-cesr.<apex>/ in the gateway access log": "pushKelToAgent now posts ONE event per request (the ked as body, atc in CESR-ATTACHMENT), so KERIA's CESR door no longer sees a multi-event body it decodes 400 — proven at the client seam by tests/unit/keri/pushKel.test.ts ('posts one request PER event'). OWED (unproven_by_seam): the live access-log '2xx only' check needs a real issuance on a kept community; the seam proves the request shape, not the gateway log.",
    "A refused push fails the issue with a message that names the push": "app/tests/unit/keri/pushKel.test.ts: 'reads the response' asserts a 400 throws /push.*400/ and stops before the second event; 'issueCredential ... never submits the grant' asserts issueCredential rejects with /push/i and submitGrant is never called (client.ts throws on non-2xx before the grant)."
  },
  "summary": "pushKelToAgent posts one event per request to KERIA's CESR door and reads the response, so a refused KEL push fails the issue instead of a silent 400.",
  "blockers": [],
  "unproven_by_seam": "AC1's live 'only 2xx on keria-cesr.<apex>/ in the gateway access log' — the seam proves the one-event-per-request request shape (body is a single JSON event, CESR-ATTACHMENT present, KEL order) but never hits a real KERIA door; a live issuance on a kept community is owed."
}
**close-report** for #1988 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1988, "status": "success", "commits": [ "2a2dfecdd023909c92978ca2176ffd513b79a234" ], "changed_files": [ "app/src/lib/keri/client.ts", "app/tests/unit/keri/pushKel.test.ts", "docs/GOTCHAS.md", "STATUS.md" ], "tests": [ { "command": "cd app && npx vitest run tests/unit/keri/pushKel.test.ts", "exit_code": 0 }, { "command": "cd app && npx vitest run tests/unit/keri/", "exit_code": 0 } ], "criteria": { "Issuing a credential from the panel produces only 2xx on keria-cesr.<apex>/ in the gateway access log": "pushKelToAgent now posts ONE event per request (the ked as body, atc in CESR-ATTACHMENT), so KERIA's CESR door no longer sees a multi-event body it decodes 400 — proven at the client seam by tests/unit/keri/pushKel.test.ts ('posts one request PER event'). OWED (unproven_by_seam): the live access-log '2xx only' check needs a real issuance on a kept community; the seam proves the request shape, not the gateway log.", "A refused push fails the issue with a message that names the push": "app/tests/unit/keri/pushKel.test.ts: 'reads the response' asserts a 400 throws /push.*400/ and stops before the second event; 'issueCredential ... never submits the grant' asserts issueCredential rejects with /push/i and submitGrant is never called (client.ts throws on non-2xx before the grant)." }, "summary": "pushKelToAgent posts one event per request to KERIA's CESR door and reads the response, so a refused KEL push fails the issue instead of a silent 400.", "blockers": [], "unproven_by_seam": "AC1's live 'only 2xx on keria-cesr.<apex>/ in the gateway access log' — the seam proves the one-event-per-request request shape (body is a single JSON event, CESR-ATTACHMENT present, KEL order) but never hits a real KERIA door; a live issuance on a kept community is owed." } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1988
No description provided.