glanceapp/glance · warning
template is required
Error message
template is required
What it means
Unless hide-mountpoints-by-default is set, Glance enumerates partitions with gopsutil's disk.Partitions(false) (physical filesystems only, on Linux it parses /proc/self/mounts filtered to real fs types). Failure is wrapped as 'getting filesystems: %v' and collected; the widget then shows only explicitly configured mountpoints.
Source
Thrown at internal/glance/widget-custom-api.go:65
compiledTemplate *template.Template `yaml:"-"`
CompiledHTML template.HTML `yaml:"-"`
}
func (widget *customAPIWidget) initialize() error {
widget.withTitle("Custom API").withCacheDuration(1 * time.Hour)
if err := widget.CustomAPIRequest.initialize(); err != nil {
return fmt.Errorf("initializing primary request: %v", err)
}
for key := range widget.Subrequests {
if err := widget.Subrequests[key].initialize(); err != nil {
return fmt.Errorf("initializing subrequest %q: %v", key, err)
}
}
if widget.Template == "" {
return errors.New("template is required")
}
compiledTemplate, err := template.New("").Funcs(customAPITemplateFuncs).Parse(widget.Template)
if err != nil {
return fmt.Errorf("parsing template: %w", err)
}
widget.compiledTemplate = compiledTemplate
return nil
}
func (widget *customAPIWidget) update(ctx context.Context) {
compiledHTML, err := fetchAndRenderCustomAPIRequest(
widget.CustomAPIRequest, widget.Subrequests, widget.Options, widget.compiledTemplate,
)
if !widget.canContinueUpdateAfterHandlingErr(err) {
returnView on GitHub (pinned to 91324e8de7)
Solutions
- Check the source file directly: cat /proc/self/mounts (Linux) — if unreadable, fix procfs mounting
- If you only want specific mounts anyway, set hide-mountpoints-by-default: true and list mountpoints explicitly — this bypasses disk.Partitions() entirely
- In containers, ensure /proc is mounted read-only and not masked
- Inspect the wrapped gopsutil error in Glance logs for the exact cause
Example fix
// before (glance.yml)
- type: system
# relies on auto-discovery of all partitions
// after: skip disk.Partitions() and list mounts explicitly
- type: system
hide-mountpoints-by-default: true
mountpoints:
/:
name: root
/mnt/data:
name: data Defensive patterns
Strategy: validation
Validate before calling
// avoid disk.Partitions() entirely when its sources may be unavailable
if hideByDefault {
// only explicitly configured mountpoints are queried
} else if filesystems, err := disk.Partitions(false); err != nil {
log.Printf("filesystem enumeration failed: %v", err)
} Prevention
- Use hide-mountpoints-by-default: true with an explicit mountpoints list in locked-down environments
- Keep /proc mounted and readable in containers
- Treat enumeration failure as degradation: explicitly configured mountpoints still render
When it happens
Trigger: disk.Partitions(false) errors — most commonly /proc/self/mounts (or /etc/mtab fallback) being unreadable, or on macOS/Windows the system enumeration API failing. Skipped entirely when hide-mountpoints-by-default: true.
Common situations: Containers with /proc masked or a read-only bogus /etc/mtab; chroots and minimal environments; occasionally duplicate or malformed lines in /proc/mounts after heavy bind-mount usage.
Related errors
- missing timezone value
- usernames must be at least 3 characters
- hour-format must be either 12h or 24h
- invalid first day of week
- invalid body type, must be either 'json' or 'string'
AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15).
Data as JSON: /api/errors/dd914636b36a4365.
Report an issue: GitHub.