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.

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)

Solutions

  1. Use one of the formats the switch accepts (json, yaml, toml, hcl as supported by the handler).
  2. Spell the format exactly as supported — 'yaml', not 'yml'.
  3. 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

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


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/e238dfbbbf9fbb57. Report an issue: GitHub.