slimtoolkit/slim · error
failed to enumerate current paths: %w
Error message
failed to enumerate current paths: %w
What it means
After env preparation, startMonitor enumerates the current paths to monitor via artifactor.GetCurrentPaths(mountPoint, excludes). Any failure (walk errors, stat failures) is wrapped with this message and aborts monitor startup.
Source
Thrown at pkg/app/sensor/controlled/controlled.go:150
log.Warn("sensor: ignoring unknown or unexpected command => ", cmd)
} // eof: type switch
case <-ticker.C:
log.Debug(".")
} // eof: select
}
}
func (s *Sensor) startMonitor(cmd *command.StartMonitor) (monitor.CompositeMonitor, error) {
if err := s.artifactor.PrepareEnv(cmd); err != nil {
log.WithError(err).Error("sensor: artifactor.PrepareEnv() failed")
return nil, fmt.Errorf("failed to prepare artifacts env: %w", err)
}
origPaths, err := s.artifactor.GetCurrentPaths(s.mountPoint, cmd.Excludes)
if err != nil {
log.WithError(err).Error("sensor: artifactor.GetCurrentPaths() failed")
return nil, fmt.Errorf("failed to enumerate current paths: %w", err)
}
s.exe.HookMonitorPreStart()
mon, err := s.newMonitor(
s.ctx,
cmd,
s.workDir,
s.del,
s.artifactor.ArtifactsDir(),
s.mountPoint,
origPaths,
)
if err != nil {
log.WithError(err).Error("sensor: failed to create composite monitor")
return nil, err
}
View on GitHub (pinned to 81940d17fa)
Solutions
- Check the wrapped error to see which path failed
- Ensure the sensor process has read permission across the mountPoint
- Add problematic paths to cmd.Excludes so they are skipped during enumeration
Defensive patterns
Strategy: validation
Validate before calling
// ensure sensor user can read everything under mountPoint
err := filepath.Walk(mountPoint, func(p string, fi os.FileInfo, err error) error {
if err != nil { log.Printf("unreadable: %s: %v", p, err) }
return nil
}) Try / catch
if err != nil && strings.Contains(err.Error(), "failed to enumerate current paths") {
// retry with broader excludes or elevated permissions
} Prevention
- Add known-unreadable paths to cmd.Excludes
- Run the sensor with sufficient filesystem permissions
- Validate mountPoint is mounted and accessible before start
When it happens
Trigger: GetCurrentPaths returns an error because filesystem walking fails — permission denied on directories, stat type assertion errors, I/O errors on the monitored mount point.
Common situations: Monitoring a mount point with unreadable subdirectories, excludes list referencing invalid paths, FUSE/overlay filesystem quirks.
Related errors
- failed to prepare artifacts env: %w
- failed to enumerate current paths: %w
- saving reports failed: %w
- sensor shutdown before monitor stop
- ambiguous start command: cannot use [app_name,app_args] and
AI-assisted analysis of slimtoolkit/slim@81940d17fa (2026-08-31).
Data as JSON: /api/errors/14753dd3dda10b86.
Report an issue: GitHub.