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

  1. Check the wrapped error to see which path failed
  2. Ensure the sensor process has read permission across the mountPoint
  3. 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

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


AI-assisted analysis of slimtoolkit/slim@81940d17fa (2026-08-31). Data as JSON: /api/errors/14753dd3dda10b86. Report an issue: GitHub.