SigNoz/signoz · error
err.Error()
Error message
err.Error()
What it means
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.
Source
Thrown at pkg/web/routerweb/provider.go:94
return nil
}
func (provider *provider) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
// Join internally call path.Clean to prevent directory traversal
path := filepath.Join(provider.config.Directory, req.URL.Path)
// check whether a file exists or is a directory at the given path
fi, err := os.Stat(path)
if err != nil {
// if the file doesn't exist, serve index.html
if os.IsNotExist(err) {
provider.serveIndex(rw)
return
}
// if we got an error (that wasn't that the file doesn't exist) stating the
// file, return a 500 internal server error and stop
http.Error(rw, err.Error(), http.StatusInternalServerError)
return
}
if fi.IsDir() {
// path is a directory, serve index.html
provider.serveIndex(rw)
return
}
// otherwise, use http.FileServer to serve the static file
provider.fileHandler.ServeHTTP(rw, req)
}
func (provider *provider) serveIndex(rw http.ResponseWriter) {
rw.Header().Set("Content-Type", "text/html; charset=utf-8")
_, _ = rw.Write(provider.indexContents)
}
View on GitHub (pinned to 5069bf80b0)
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
Defensive patterns
Strategy: fallback
Validate before calling
if fi, err := os.Stat(assetPath); err != nil && !os.IsNotExist(err) {
log.Printf("asset unreadable: %v", err)
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28).
Data as JSON: /api/errors/a2f421f048bceeca.
Report an issue: GitHub.