{"record":{"id":"877b930e33ee1619","repo":"slimtoolkit/slim","slug":"failed-to-enumerate-current-paths-w-877b93","errorCode":null,"errorMessage":"failed to enumerate current paths: %w","messagePattern":"failed to enumerate current paths: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/app/sensor/standalone/standalone.go","lineNumber":136,"sourceCode":"\t\treturn fmt.Errorf(\"unexpected start monitor command: %+v\", cmd)\n\t}\n\n\tif err := s.artifactor.PrepareEnv(cmd); err != nil {\n\t\tlog.WithError(err).Error(\"sensor: artifactor.PrepareEnv() failed\")\n\t\ts.exe.HookMonitorFailed()\n\t\ts.exe.PubEvent(event.StartMonitorFailed,\n\t\t\t&event.StartMonitorFailedData{\n\t\t\t\tComponent: event.ComSensorCmdServer,\n\t\t\t\tState:     event.StateEnvPreparing,\n\t\t\t\tErrors:    []string{err.Error()},\n\t\t\t})\n\t\treturn fmt.Errorf(\"failed to prepare artifacts env: %w\", err)\n\t}\n\n\torigPaths, err := s.artifactor.GetCurrentPaths(s.mountPoint, cmd.Excludes)\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"sensor: artifactor.GetCurrentPaths() failed\")\n\t\treturn fmt.Errorf(\"failed to enumerate current paths: %w\", err)\n\t}\n\n\ts.exe.HookMonitorPreStart()\n\n\tmon, err := s.newMonitor(\n\t\ts.ctx,\n\t\tcmd,\n\t\ts.workDir,\n\t\ts.del,\n\t\ts.artifactor.ArtifactsDir(),\n\t\ts.mountPoint,\n\t\torigPaths,\n\t)\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"sensor: failed to create composite monitor\")\n\t\ts.exe.HookMonitorFailed()\n\t\ts.exe.PubEvent(event.StartMonitorFailed,\n\t\t\t&event.StartMonitorFailedData{","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/app/sensor/standalone/standalone.go#L118-L154","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (mount point never mounted)\nmountPoint := \"/hostfs\" // directory exists but is empty\n// after\n// ensure host root is mounted before starting the sensor\ndocker run --rm -v /:/hostfs:ro sensor-image // mountPoint = /hostfs","handlingStrategy":"validation","validationCode":"info, err := os.Stat(mountPoint)\nif err != nil || !info.IsDir() {\n    return fmt.Errorf(\"mount point %s missing or not a directory\", mountPoint)\n}\nif f, err := os.Open(mountPoint); err != nil {\n    return fmt.Errorf(\"mount point %s not readable: %w\", mountPoint, err)\n} else {\n    f.Close()\n}","typeGuard":null,"tryCatchPattern":"if err := sensor.Run(ctx); err != nil {\n    if strings.Contains(err.Error(), \"failed to enumerate current paths\") {\n        log.Errorf(\"mount point unreadable; verify volume mounts: %v\", err)\n    }\n    return err\n}","preventionTips":["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."],"tags":["go","sensor","filesystem","mount"],"backgroundTag":"mount-point-unavailable","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}