JuliusBrussee/caveman · error
proposalrun: detail contains trailing JSON
Error message
proposalrun: detail contains trailing JSON
What it means
Error "proposalrun: detail contains trailing JSON" thrown in JuliusBrussee/caveman.
Source
Thrown at shared/platform/proposalrun/proposalrun.go:69
// hash identically, while adjacent arbitrary-precision integers remain
// distinct. The bounds mirror PostgreSQL's numeric-backed jsonb limits and
// reject values that could not be persisted there before allocating output.
// The decoder enforces the JSON number grammar (including rejecting NaN/Inf),
// and a second decode below rejects any trailing value or non-whitespace data.
func CanonicalDetail(detail json.RawMessage) ([]byte, error) {
if len(detail) == 0 {
return []byte("{}"), nil
}
var v any
dec := json.NewDecoder(bytes.NewReader(detail))
dec.UseNumber()
if err := dec.Decode(&v); err != nil {
return nil, fmt.Errorf("proposalrun: detail is not valid JSON: %w", err)
}
var trailing any
if err := dec.Decode(&trailing); err != io.EOF {
if err == nil {
return nil, fmt.Errorf("proposalrun: detail contains trailing JSON")
}
return nil, fmt.Errorf("proposalrun: detail contains trailing data: %w", err)
}
v, err := canonicalizeJSONValue(v)
if err != nil {
return nil, fmt.Errorf("proposalrun: canonicalize detail: %w", err)
}
out, err := json.Marshal(v)
if err != nil {
return nil, fmt.Errorf("proposalrun: marshal canonical detail: %w", err)
}
return out, nil
}
// PostgreSQL jsonb stores JSON numbers using its numeric type. These are the
// documented numeric bounds (131072 digits before and 16383 after the decimal
// point); rejecting at the canonicalization boundary keeps write and read-back
// hashing deterministic and avoids unbounded strings from hostile exponents.View on GitHub (pinned to 27d5a3981a)
Solutions
- Remove trailing JSON from the detail payload.
When it happens
Trigger: Thrown at shared/platform/proposalrun/proposalrun.go:69 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/3df6dc2f7a27b68c.
Report an issue: GitHub.