jaegertracing/jaeger · error
unrecognized UI config file format, expecting .js or .json f
Error message
unrecognized UI config file format, expecting .js or .json file: %v
What it means
loadUIConfig dispatches on the file extension and only understands .json and .js (case-insensitive). Any other extension — .yaml, .yml, .conf, .txt, or no extension — hits the default branch and is rejected. Jaeger intentionally does not sniff content; the extension decides the parser.
Source
Thrown at cmd/jaeger/internal/extension/jaegerquery/internal/static_handler.go:244
r, _ = json.Marshal(c)
return &loadedConfig{
regexp: configPattern,
config: append([]byte("JAEGER_CONFIG = "), append(r, byte(';'))...),
}, nil
case ".js":
r = bytes.TrimSpace(bytesConfig)
re := regexp.MustCompile(`function\s+UIConfig(\s)?\(\s?\)(\s)?{`)
if !re.Match(r) {
return nil, fmt.Errorf("UI config file must define function UIConfig(): %v", uiConfig)
}
return &loadedConfig{
regexp: configJsPattern,
config: r,
}, nil
default:
return nil, fmt.Errorf("unrecognized UI config file format, expecting .js or .json file: %v", uiConfig)
}
}
func (h *staticAssetsHandler) loggingHandler(handler http.Handler) http.Handler {
if !h.logAccess {
return handler
}
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
h.logger.Info("serving static asset", zap.Stringer("url", r.URL))
handler.ServeHTTP(w, r)
})
}
func (h *staticAssetsHandler) registerRoutes(router *http.ServeMux) {
basePath := h.basePath
if basePath == "" {
basePath = "/"
}View on GitHub (pinned to 806f444784)
Solutions
- Rename/convert the config to .json (strict JSON) or .js (must define function UIConfig()).
- Update the --query.ui-config flag to point at the file with the correct extension.
- If your config is YAML, convert it to JSON first (yq -o=json).
- If no UI customization is needed, drop the flag.
Example fix
// before --query.ui-config=/etc/jaeger/ui-config.yaml // after --query.ui-config=/etc/jaeger/ui-config.json
Defensive patterns
Strategy: validation
Validate before calling
ext := strings.ToLower(filepath.Ext(path))
if ext != ".json" && ext != ".js" {
return fmt.Errorf("ui config must be .json or .js, got %q", ext)
} Prevention
- Convert YAML/other configs to JSON before wiring --query.ui-config.
- Never omit the file extension on UI config paths.
- Lint deployment templates to assert the configured extension.
When it happens
Trigger: loadUIConfig (via newStaticAssetsHandler or the extension config path) receives a uiConfig path whose filepath.Ext is not .json or .js, e.g. --query.ui-config=/etc/jaeger/ui-config.yaml.
Common situations: Reusing an existing YAML/properties config file for the UI base config; omitting the extension entirely; following a guide that used a different naming convention.
Related errors
- UI config file must define function UIConfig(): %v
- no sampling strategy provider specified, expecting 'adaptive
- only one sampling strategy provider can be specified, 'adapt
- reload interval must be a positive value, or zero to disable
- CalculationInterval and AggregationBuckets must be greater t
AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01).
Data as JSON: /api/errors/e7c866f7598983f4.
Report an issue: GitHub.