{"record":{"id":"327f485458c23086","repo":"GoogleContainerTools/skaffold","slug":"walking-q-w","errorCode":null,"errorMessage":"walking %q: %w","messagePattern":"walking %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/dependencies.go","lineNumber":278,"sourceCode":"\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\treturn !ignored, nil\n\t\t}\n\n\t\tif err := walk.From(absFrom).Unsorted().When(keepFile).Do(func(path string, info walk.Dirent) error {\n\t\t\trelPath, err := filepath.Rel(workspace, path)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif !info.IsDir() || util.IsEmptyDir(path) {\n\t\t\t\tfiles[relPath] = true\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"walking %q: %w\", absFrom, err)\n\t\t}\n\t}\n\n\treturn files, nil\n}\n","sourceCodeStart":260,"sourceCodeEnd":284,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/dependencies.go#L260-L284","documentation":"WalkWorkspace walks the build workspace directory (respecting exclude predicates) to collect dependency files for a Docker image build. This error wraps any failure returned by the underlying filepath/fs walker (walk.From root.Walk) with the offending absolute path %q and the cause via %w. It signals that the directory traversal itself aborted, so the full dependency file set could not be computed.","triggerScenarios":"Calling WalkWorkspace(workspace, excludes, deps) (directly or via getDependencies / getDependenciesByDockerCopyFromTo during skaffold build/dev) where the walk rooted at the workspace errors: permission denied on a subdirectory, a symlink loop, a directory deleted mid-walk, or the walk callback returning an error (e.g. from NewDockerIgnorePredicate path computation).","commonSituations":"Building inside a container or CI where the mounted workspace lacks read permissions on some subdirectories; workspace on a flaky network filesystem (NFS) where entries vanish during traversal; broken symlinks in node_modules or vendored directories; workspaces containing permission-locked secrets folders.","solutions":["Fix filesystem permissions: chmod/chown the workspace so the user running skaffold can read all subdirectories.","Inspect the wrapped error (it names absFrom and the cause) and address the specific failing path, e.g. remove or repair broken symlinks.","Ensure no process is deleting/moving files under the workspace while skaffold computes dependencies.","Add problematic paths (large vendored dirs, secrets) to .dockerignore or skaffold exclude patterns so they are skipped, then retry the build."],"exampleFix":"// before (shell): build fails with walking \"/repo/node_modules\": permission denied\n$ skaffold build\n\n// after: fix permissions or exclude the path\n$ sudo chmod -R a+rX /repo/node_modules\n# or in skaffold.yaml build.artifacts[*].sync/skaffold excludes + .dockerignore\nnode_modules","handlingStrategy":"try-catch","validationCode":"// Go: pre-check workspace readability before WalkWorkspace\nif fi, err := os.Stat(workspace); err != nil {\n    return fmt.Errorf(\"workspace %q inaccessible: %w\", workspace, err)\n}\nif err := filepath.Walk(workspace, func(p string, _ os.FileInfo, err error) error {\n    if err != nil { return err }\n    if fi, err := os.Stat(p); err != nil || fi.Mode()&0o400 == 0 { return fmt.Errorf(\"unreadable: %s\", p) }\n    return nil\n}); err != nil {\n    return fmt.Errorf(\"pre-check failed: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"files, err := docker.WalkWorkspace(workspace, excludes, deps)\nif err != nil {\n    var perr *fs.PathError\n    if errors.As(err, &perr) {\n        log.Warnf(\"walk failed on %s: %v — fixing perms/excludes and retrying\", perr.Path, perr.Err)\n        return retryWithNarrowedExcludes(workspace, excludes, perr.Path)\n    }\n    return fmt.Errorf(\"dependency walk failed: %w\", err)\n}","preventionTips":["Run builds as a user with read access to the entire workspace; avoid root-owned files in repos.","Add node_modules, vendored trees, and secret dirs to .dockerignore/excludes so the walker skips them.","Do not mutate (delete/move) workspace files concurrently with skaffold builds.","Run `find . -type l ! -exec test -e {} \\; -print` in CI to catch broken symlinks early."],"tags":["filesystem","docker","dependencies","walk"],"backgroundTag":"directory-walk-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"}