{"record":{"id":"b89c8157075723bf","repo":"jaegertracing/jaeger","slug":"cannot-read-from-index-html-w","errorCode":null,"errorMessage":"cannot read from index.html: %w","messagePattern":"cannot read from index\\.html: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerquery/internal/static_handler.go","lineNumber":203,"sourceCode":"\tout = versionPattern.ReplaceAll(out, fmt.Appendf(nil, \"JAEGER_VERSION = %s;\", versionJSON))\n\tvar caps BackendCapabilities\n\tif h.backendCaps != nil {\n\t\tcaps = h.backendCaps(ctx)\n\t}\n\tcapsJSON, _ := json.Marshal(caps)\n\tout = capabilitiesPattern.ReplaceAll(out, fmt.Appendf(nil, \"JAEGER_BACKEND_CAPABILITIES = %s;\", capsJSON))\n\treturn out\n}\n\nfunc loadIndexHTML(open func(string) (http.File, error)) ([]byte, error) {\n\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","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerquery/internal/static_handler.go#L185-L221","documentation":"loadIndexHTML fails while reading the UI's index.html after successfully opening it: io.ReadAll on the file returned an error (I/O failure mid-read). Jaeger wraps the underlying error so you can see the OS-level cause. This happens in the static handler of the jaeger-query extension when it loads embedded or on-disk UI assets at startup.","triggerScenarios":"newStaticAssetsHandler calls loadIndexHTML and io.ReadAll(indexFile) returns a non-nil error after the file was opened (e.g. corrupted file, filesystem error, or a custom UI directory whose index.html is a directory/device that cannot be read).","commonSituations":"Pointing static_files/ui_config at a directory that lacks a valid index.html; the path resolving to a special file or a directory; disk or permission issues surfacing mid-read; corrupted custom UI build output.","solutions":["Check the wrapped OS error in the message for the real cause (permissions, path, disk).","Verify the configured UI directory contains a regular, readable index.html file.","Regenerate or re-download your custom UI build and retry.","If using the embedded UI, ensure the binary was built correctly and submodules were initialized before building."],"exampleFix":"// before: index.html is a directory\n$ ls ui/\ndrwxr-xr-x  index.html/\n// after: point to a real file\n$ ls ui/\n-rw-r--r--  index.html","handlingStrategy":"validation","validationCode":"info, err := os.Stat(uiDir + \"/index.html\")\nif err != nil || info.IsDir() {\n    return fmt.Errorf(\"invalid UI dir %s: index.html missing or not a regular file\", uiDir)\n}\nif info.Mode().Perm()&0400 == 0 {\n    return fmt.Errorf(\"index.html not readable\")\n}","typeGuard":null,"tryCatchPattern":"if _, err := loadIndexHTML(dir); err != nil {\n    var pathErr *fs.PathError\n    if errors.As(err, &pathErr) {\n        log.Fatalf(\"UI assets: %v at %s\", pathErr.Err, pathErr.Path)\n    }\n    return err\n}","preventionTips":["Stat index.html before configuring the static handler.","Use file integrity checks on custom UI build artifacts.","Test container images with a startup smoke request to the UI endpoint."],"tags":["io","file-read","jaeger-query","startup"],"backgroundTag":"file-read-failed","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}