JuliusBrussee/caveman · error
proposalrun: detail is not valid JSON: %w
Error message
proposalrun: detail is not valid JSON: %w
What it means
Error "proposalrun: detail is not valid JSON: %w" thrown in JuliusBrussee/caveman.
Source
Thrown at shared/platform/proposalrun/proposalrun.go:64
//
// Numbers are decoded with Decoder.UseNumber and normalized by exact decimal
// coefficient/exponent arithmetic, so they never round through float64. The
// canonical form is a plain decimal with insignificant zeroes removed; zero is
// always "0". Thus storage-equivalent spellings (for example 1, 1.0, and 1e0)
// 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
}View on GitHub (pinned to 27d5a3981a)
Solutions
- Store valid JSON in the proposal run detail.
When it happens
Trigger: Thrown at shared/platform/proposalrun/proposalrun.go:64 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/f9e32a30a9405fbf.
Report an issue: GitHub.