caddyserver/caddy · warning
unsupported type
Error message
unsupported type
What it means
After a successful DNS publication, Caddy records publication history into each config's metadata (cfg.meta.Publications maps of publisher -> name -> time) and json.Marshal of that metadata failed. Like the rotation-path marshal error, this is a near-impossible defensive path for well-formed data.
Source
Thrown at modules/caddyhttp/logging.go:192
type StringArray []string
// UnmarshalJSON satisfies json.Unmarshaler.
func (sa *StringArray) UnmarshalJSON(b []byte) error {
var jsonObj any
err := json.Unmarshal(b, &jsonObj)
if err != nil {
return err
}
switch obj := jsonObj.(type) {
case string:
*sa = StringArray([]string{obj})
return nil
case []any:
s := make([]string, 0, len(obj))
for _, v := range obj {
value, ok := v.(string)
if !ok {
return errors.New("unsupported type")
}
s = append(s, value)
}
*sa = StringArray(s)
return nil
}
return errors.New("unsupported type")
}
// errLogValues inspects err and returns the status code
// to use, the error log message, and any extra fields.
// If err is a HandlerError, the returned values will
// have richer information.
func errLogValues(err error) (status int, msg string, fields func() []zapcore.Field) {
var handlerErr HandlerError
if errors.As(err, &handlerErr) {
status = handlerErr.StatusCode
if handlerErr.Err == nil {View on GitHub (pinned to 50e54ee279)
Solutions
- Capture the wrapped error and Caddy version; report upstream as a bug.
- Restart the instance to rebuild metadata from storage.
- Reset the ech/configs folder if it recurs and blocks publication bookkeeping.
Defensive patterns
Strategy: try-catch
Try / catch
Catch and log with full context (publisher key, config IDs); publication already succeeded, so bookkeeping failure is non-fatal — retry occurs on the next publication cycle.
Prevention
- Treat as a bug signal: capture Caddy version and error for upstream reporting.
- Restart to rebuild metadata if it recurs.
- Keep publication metadata untouched by external tooling.
When it happens
Trigger: json.Marshal(cfg.meta) errors because a value in the publication history is not JSON-serializable — only plausible via memory corruption or a bug writing unmarshalable dynamic values.
Common situations: Essentially never in practice; treat an occurrence as a Caddy bug or memory fault and gather diagnostics.
Related errors
- missing 'req' argument
- private key does not match issuer public key
- --config is required
- --input is required
- --output is required
AI-assisted analysis of caddyserver/caddy@50e54ee279 (2026-08-15).
Data as JSON: /api/errors/4cbaca8f319ebee9.
Report an issue: GitHub.