{"record":{"id":"e7c866f7598983f4","repo":"jaegertracing/jaeger","slug":"unrecognized-ui-config-file-format-expecting-js","errorCode":null,"errorMessage":"unrecognized UI config file format, expecting .js or .json file: %v","messagePattern":"unrecognized UI config file format, expecting \\.js or \\.json file: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerquery/internal/static_handler.go","lineNumber":244,"sourceCode":"\t\tr, _ = json.Marshal(c)\n\n\t\treturn &loadedConfig{\n\t\t\tregexp: configPattern,\n\t\t\tconfig: append([]byte(\"JAEGER_CONFIG = \"), append(r, byte(';'))...),\n\t\t}, nil\n\tcase \".js\":\n\t\tr = bytes.TrimSpace(bytesConfig)\n\t\tre := regexp.MustCompile(`function\\s+UIConfig(\\s)?\\(\\s?\\)(\\s)?{`)\n\t\tif !re.Match(r) {\n\t\t\treturn nil, fmt.Errorf(\"UI config file must define function UIConfig(): %v\", uiConfig)\n\t\t}\n\n\t\treturn &loadedConfig{\n\t\t\tregexp: configJsPattern,\n\t\t\tconfig: r,\n\t\t}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unrecognized UI config file format, expecting .js or .json file: %v\", uiConfig)\n\t}\n}\n\nfunc (h *staticAssetsHandler) loggingHandler(handler http.Handler) http.Handler {\n\tif !h.logAccess {\n\t\treturn handler\n\t}\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\th.logger.Info(\"serving static asset\", zap.Stringer(\"url\", r.URL))\n\t\thandler.ServeHTTP(w, r)\n\t})\n}\n\nfunc (h *staticAssetsHandler) registerRoutes(router *http.ServeMux) {\n\tbasePath := h.basePath\n\tif basePath == \"\" {\n\t\tbasePath = \"/\"\n\t}","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerquery/internal/static_handler.go#L226-L262","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n--query.ui-config=/etc/jaeger/ui-config.yaml\n// after\n--query.ui-config=/etc/jaeger/ui-config.json","handlingStrategy":"validation","validationCode":"ext := strings.ToLower(filepath.Ext(path))\nif ext != \".json\" && ext != \".js\" {\n    return fmt.Errorf(\"ui config must be .json or .js, got %q\", ext)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["config","validation","file-extension","jaeger-query"],"backgroundTag":"unsupported-file-format","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}