{"record":{"id":"1cd8d45ec13c418d","repo":"GoogleContainerTools/skaffold","slug":"listing-files-w","errorCode":null,"errorMessage":"listing files: %w","messagePattern":"listing files: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/filemon/changes.go","lineNumber":38,"sourceCode":"\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/output/log\"\n)\n\n// FileMap is a map of filename to modification times.\ntype FileMap map[string]time.Time\n\n// Stat returns the modification times for a list of files.\nfunc Stat(deps func() ([]string, error)) (FileMap, error) {\n\tstate := FileMap{}\n\tpaths, err := deps()\n\tif err != nil {\n\t\treturn state, fmt.Errorf(\"listing files: %w\", err)\n\t}\n\tfor _, path := range paths {\n\t\tstat, err := os.Stat(path)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tlog.Entry(context.TODO()).Debugf(\"could not stat dependency: %s\", err)\n\t\t\t\tcontinue // Ignore files that don't exist\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"unable to stat file %q: %w\", path, err)\n\t\t}\n\t\tstate[path] = stat.ModTime()\n\t}\n\n\treturn state, nil\n}\n\ntype Events struct {\n\tAdded    []string","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/filemon/changes.go#L20-L56","documentation":"filemon.Stat computes modification times for a set of files by invoking the supplied deps() callback to obtain the file list. This error wraps any failure of that callback, meaning the dependency list itself could not be produced (e.g. a glob or workspace walk failed). Without a file list, no mtimes can be computed and file watching is skipped for that iteration.","triggerScenarios":"Calling Stat with a deps function whose underlying implementation returns an error — e.g. filepath.Glob matching errors, io/fs Walk failures, unreadable source directories, or kubectl/context resolution failures in dependency resolvers.","commonSituations":"Watch roots deleted or unmounted during a dev session; source directories with permission errors; bad glob patterns in skaffold config artifacts; dependencies pointing to paths on disconnected network drives.","solutions":["Check that all source/dependency directories referenced by your skaffold config exist and are readable.","Fix glob patterns in artifact dependencies (invalid or unmatched patterns in the resolver).","Re-run with debug logging to identify which dependency resolver's deps() failed and correct the underlying path/permission problem."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"for _, dir := range watchDirs {\n    if info, err := os.Stat(dir); err != nil || !info.IsDir() {\n        return fmt.Errorf(\"watch root %s missing or not a directory\", dir)\n    }\n}","typeGuard":null,"tryCatchPattern":"mtimes, err := filemon.Stat(deps)\nif err != nil {\n    if strings.Contains(err.Error(), \"listing files\") {\n        log.Warnf(\"dependency listing failed, skipping watch cycle: %v\", err)\n        return nil // degrade gracefully instead of aborting dev loop\n    }\n    return err\n}","preventionTips":["Keep watch roots on always-available local filesystems","Validate glob patterns in artifact dependencies at config load time","Ensure source directories remain readable for the process user"],"tags":["file-watching","filesystem","dependencies"],"backgroundTag":"dependency-listing-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}