slimtoolkit/slim · error
failed to enumerate current paths: %w
Error message
failed to enumerate current paths: %w
What it means
Wraps an error from s.artifactor.GetCurrentPaths(s.mountPoint, cmd.Excludes), which enumerates the current filesystem paths under the mount point while applying the command's excludes. The library throws it when enumeration fails, typically because the mount point is missing/unreadable or a traversal error occurs.
Source
Thrown at pkg/app/sensor/standalone/standalone.go:136
return fmt.Errorf("unexpected start monitor command: %+v", cmd)
}
if err := s.artifactor.PrepareEnv(cmd); err != nil {
log.WithError(err).Error("sensor: artifactor.PrepareEnv() failed")
s.exe.HookMonitorFailed()
s.exe.PubEvent(event.StartMonitorFailed,
&event.StartMonitorFailedData{
Component: event.ComSensorCmdServer,
State: event.StateEnvPreparing,
Errors: []string{err.Error()},
})
return 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 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")
s.exe.HookMonitorFailed()
s.exe.PubEvent(event.StartMonitorFailed,
&event.StartMonitorFailedData{View on GitHub (pinned to 81940d17fa)
Solutions
- Check the wrapped error and log line 'sensor: artifactor.GetCurrentPaths() failed' for the exact traversal failure.
- Verify s.mountPoint exists and is a mounted, readable directory (mount | grep <path>).
- Ensure the sensor process has read permissions across the monitored tree.
- Review cmd.Excludes for invalid or conflicting patterns and correct them.
Example fix
// before (mount point never mounted) mountPoint := "/hostfs" // directory exists but is empty // after // ensure host root is mounted before starting the sensor docker run --rm -v /:/hostfs:ro sensor-image // mountPoint = /hostfs
Defensive patterns
Strategy: validation
Validate before calling
info, err := os.Stat(mountPoint)
if err != nil || !info.IsDir() {
return fmt.Errorf("mount point %s missing or not a directory", mountPoint)
}
if f, err := os.Open(mountPoint); err != nil {
return fmt.Errorf("mount point %s not readable: %w", mountPoint, err)
} else {
f.Close()
} Try / catch
if err := sensor.Run(ctx); err != nil {
if strings.Contains(err.Error(), "failed to enumerate current paths") {
log.Errorf("mount point unreadable; verify volume mounts: %v", err)
}
return err
} Prevention
- Verify the mount point is actually mounted (mount | grep) before launching the sensor.
- Run the sensor with read access to the full monitored tree (or document accepted blind spots).
- Keep exclude patterns valid and tested.
- Fail fast in deployment checks if the host filesystem volume is absent.
When it happens
Trigger: StartMonitor flow reaching artifactor.GetCurrentPaths when s.mountPoint does not exist, is not a directory, or the process lacks read permission on it or on paths under it.
Common situations: Mount point path typo'd or not actually mounted in the container; running the sensor without the required volume mounted; permission-restricted directories under the mount point; excludes referencing paths that break the walker.
Related errors
- failed to enumerate current paths: %w
- failed to prepare artifacts env: %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/877b930e33ee1619.
Report an issue: GitHub.