gravitational/teleport · error
unsupported json type %T
Error message
unsupported json type %T
What it means
Type-switch default in anyToGogoValue: the value being converted into a protobuf Struct Value is not one of the supported JSON types (nil, bool, float64, string, map[string]any, []any), so it cannot be represented in a gogotypes.Value.
Source
Thrown at api/types/struct.go:146
}
return &gogotypes.Value{Kind: &gogotypes.Value_StructValue{StructValue: s}}, nil
case []any:
vals := make([]*gogotypes.Value, len(t))
for i, item := range t {
val, err := anyToGogoValue(item)
if err != nil {
return nil, err
}
vals[i] = val
}
return &gogotypes.Value{Kind: &gogotypes.Value_ListValue{
ListValue: &gogotypes.ListValue{Values: vals},
}}, nil
default:
return nil, fmt.Errorf("unsupported json type %T", v)
}
}
View on GitHub (pinned to 1283425b60)
Solutions
- Ensure the input struct only contains JSON-serializable types (as produced by encoding/json)
- Avoid feeding values like int, int64, or arbitrary Go structs; marshal/unmarshal through JSON first to normalize them
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at api/types/struct.go:146 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of gravitational/teleport@1283425b60 (2026-09-02).
Data as JSON: /api/errors/00ebcc76e80e3d3d.
Report an issue: GitHub.