vitessio/vitess · info
unsupported config format
Error message
unsupported config format
What it means
The debug config handler switches on the requested format; the default branch rejects any format value it does not recognize with 400 Bad Request 'unsupported config format'. The handler only supports the formats it explicitly enumerates.
Solutions
- Use one of the formats the switch accepts (json, yaml, toml, hcl as supported by the handler).
- Spell the format exactly as supported — 'yaml', not 'yml'.
- Omit or correct the format query parameter and re-read the endpoint's documented usage.
Example fix
// before curl 'http://localhost:15000/debug/config?format=ini' // after curl 'http://localhost:15000/debug/config?format=json'
Defensive patterns
Strategy: validation
Validate before calling
const allowed = "json|yaml|toml|hcl"
if !strings.Contains("|"+allowed+"|", "|"+format+"|") {
return fmt.Errorf("use one of: %s", allowed)
} Prevention
- Enumerate accepted formats once and share the constant between callers and docs.
- Validate the format query parameter in scripts before building the URL.
When it happens
Trigger: Hitting the debug config endpoint with a format query parameter whose value is not in the handler's switch (e.g. 'ini', 'xml', 'env', or a misspelling like 'yml' for 'yaml').
Common situations: Guessing the format parameter name/value; copy-pasting a format from another tool; bookmarking an old URL after supported formats changed.
Related errors
- must specify at least one keyspace_shard to delete (got %+v)
- err.Error()
- failed setting value for
- failed to render config to tempfile
- invalid int value for
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/e238dfbbbf9fbb57.
Report an issue: GitHub.
Appendix: source
Thrown at go/viperutil/debug/handler.go:80
v.SetConfigType(format)
tmp, err := os.CreateTemp("", "viper_debug")
if err != nil {
http.Error(w, fmt.Sprintf("failed to render config to tempfile: %v", err), http.StatusInternalServerError)
return
}
defer os.Remove(tmp.Name())
if err := v.WriteConfigAs(tmp.Name()); err != nil {
http.Error(w, fmt.Sprintf("failed to render config to tempfile: %v", err), http.StatusInternalServerError)
return
}
if _, err := io.Copy(w, tmp); err != nil {
http.Error(w, fmt.Sprintf("failed to write rendered config: %v", err), http.StatusInternalServerError)
return
}
default:
http.Error(w, "unsupported config format", http.StatusBadRequest)
}
}
View on GitHub (pinned to 01a25a7d17)