{"record":{"id":"5af5c8574e93c816","repo":"jaegertracing/jaeger","slug":"cannot-read-ui-config-file-v-w","errorCode":null,"errorMessage":"cannot read UI config file %v: %w","messagePattern":"cannot read UI config file (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerquery/internal/static_handler.go","lineNumber":214,"sourceCode":"\tindexFile, err := open(\"/index.html\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot open index.html: %w\", err)\n\t}\n\tdefer indexFile.Close()\n\tindexBytes, err := io.ReadAll(indexFile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot read from index.html: %w\", err)\n\t}\n\treturn indexBytes, nil\n}\n\nfunc loadUIConfig(uiConfig string) (*loadedConfig, error) {\n\tif uiConfig == \"\" {\n\t\treturn nil, nil\n\t}\n\tbytesConfig, err := os.ReadFile(filepath.Clean(uiConfig))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot read UI config file %v: %w\", uiConfig, err)\n\t}\n\tvar r []byte\n\n\text := filepath.Ext(uiConfig)\n\tswitch strings.ToLower(ext) {\n\tcase \".json\":\n\t\tvar c map[string]any\n\n\t\tif err := json.Unmarshal(bytesConfig, &c); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot parse UI config file %v: %w\", uiConfig, err)\n\t\t}\n\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\":","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerquery/internal/static_handler.go#L196-L232","documentation":"loadUIConfig cannot read the UI base-config file given via --query.ui-config: os.ReadFile fails. The configured path is passed through filepath.Clean, so this is a genuine open/read failure (missing file, wrong path, permission denied). Jaeger wraps the OS error with the original path for diagnosis.","triggerScenarios":"newStaticAssetsHandler -> loadUIConfig with a non-empty uiConfig string where os.ReadFile(filepath.Clean(uiConfig)) returns an error, e.g. file absent, typo'd path, or unreadable permissions.","commonSituations":"Deployment mounts the config at a different path than the flag says; Kubernetes ConfigMap not mounted; typo like ui-config=/etc/jaeger/uiconfig.json when the file is ui_config.json; running the binary as a user without read permission.","solutions":["Verify the path in --query.ui-config exists and is readable from the jaeger-query process.","Fix the wrapped OS error's cause: correct the path or fix file permissions (chmod/chown).","If you don't need a UI config, remove the --query.ui-config flag entirely (empty value returns nil config).","In containers, confirm the volume/ConfigMap mount path matches the flag value."],"exampleFix":"// before\n--query.ui-config=/etc/jaeger/ui-config.jsn\n// after\n--query.ui-config=/etc/jaeger/ui-config.json","handlingStrategy":"validation","validationCode":"cfgPath := os.Getenv(\"QUERY_UI_CONFIG\")\nif cfgPath != \"\" {\n    if f, err := os.Open(cfgPath); err != nil {\n        panic(fmt.Sprintf(\"--query.ui-config unreadable: %v\", err))\n    } else {\n        f.Close()\n    }\n}","typeGuard":null,"tryCatchPattern":"if _, err := loadUIConfig(path); err != nil {\n    var pe *fs.PathError\n    if errors.As(err, &pe) && errors.Is(pe.Err, fs.ErrNotExist) {\n        log.Fatalf(\"UI config not found: %s\", pe.Path)\n    }\n    return err\n}","preventionTips":["Mount config files before the process starts (init containers / depends_on).","Keep flag paths and volume mount paths in one templated variable.","Run the binary with a config-existence preflight check in entrypoint scripts."],"tags":["io","config","file-not-found","jaeger-query"],"backgroundTag":"config-file-not-found","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}