{"record":{"id":"a2f421f048bceeca","repo":"SigNoz/signoz","slug":"err-error-a2f421","errorCode":null,"errorMessage":"err.Error()","messagePattern":"err\\.Error\\(\\)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"pkg/web/routerweb/provider.go","lineNumber":94,"sourceCode":"\treturn nil\n}\n\nfunc (provider *provider) ServeHTTP(rw http.ResponseWriter, req *http.Request) {\n\t// Join internally call path.Clean to prevent directory traversal\n\tpath := filepath.Join(provider.config.Directory, req.URL.Path)\n\n\t// check whether a file exists or is a directory at the given path\n\tfi, err := os.Stat(path)\n\tif err != nil {\n\t\t// if the file doesn't exist, serve index.html\n\t\tif os.IsNotExist(err) {\n\t\t\tprovider.serveIndex(rw)\n\t\t\treturn\n\t\t}\n\n\t\t// if we got an error (that wasn't that the file doesn't exist) stating the\n\t\t// file, return a 500 internal server error and stop\n\t\thttp.Error(rw, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif fi.IsDir() {\n\t\t// path is a directory, serve index.html\n\t\tprovider.serveIndex(rw)\n\t\treturn\n\t}\n\n\t// otherwise, use http.FileServer to serve the static file\n\tprovider.fileHandler.ServeHTTP(rw, req)\n}\n\nfunc (provider *provider) serveIndex(rw http.ResponseWriter) {\n\trw.Header().Set(\"Content-Type\", \"text/html; charset=utf-8\")\n\t_, _ = rw.Write(provider.indexContents)\n}\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/web/routerweb/provider.go#L76-L112","documentation":"The web router provider serves static dashboard assets; when os.Stat on the requested file errors with anything other than 'not exists' (e.g. EACCES permission denied, ELOOP, I/O error), it responds 500 with the raw err.Error() text.","triggerScenarios":"GET requests to frontend assets where the embedded/filesystem asset is unreadable: wrong file permissions on the deployed UI directory, a broken symlink loop, or disk errors — a plain 404-miss does NOT take this path (that serves index.html).","commonSituations":"Container images built with restrictive file modes (assets owned by root, app runs non-root); volume mounts masking the dist directory; broken symlinks in extracted tarballs.","solutions":["Check the response body: the text names the exact path and syscall error (e.g. 'permission denied')","Fix ownership/permissions on the web assets (chmod -R a+rX on the UI dist directory)","Verify symlinks and mount points if ELOOP/ENOENT-with-index-fallback misbehaves"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if fi, err := os.Stat(assetPath); err != nil && !os.IsNotExist(err) {\n    log.Printf(\"asset unreadable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ship container images with world-readable asset permissions","Verify asset directory permissions in deployment checks","Read the 500 body text — it names the exact failing path"],"tags":["static-files","http","permissions","web-ui"],"backgroundTag":"file-permission-denied","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}