{"record":{"id":"c422488fdc391042","repo":"GoogleContainerTools/skaffold","slug":"walking-workspace-w-c42248","errorCode":null,"errorMessage":"walking workspace: %w","messagePattern":"walking workspace: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/syncmap.go","lineNumber":52,"sourceCode":"\tabsDockerfilePath, err := NormalizeDockerfilePath(workspace, dockerfilePath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"normalizing dockerfile path: %w\", err)\n\t}\n\n\t// only the COPY/ADD commands from the last image are syncable\n\tfts, err := ReadCopyCmdsFromDockerfile(ctx, true, absDockerfilePath, workspace, buildArgs, cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\texcludes, err := readDockerignore(workspace, absDockerfilePath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"reading .dockerignore: %w\", err)\n\t}\n\n\tsrcByDest, err := walkWorkspaceWithDestinations(workspace, excludes, fts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"walking workspace: %w\", err)\n\t}\n\n\treturn invertMap(srcByDest), nil\n}\n\n// walkWorkspaceWithDestinations walks the given host directories and determines their\n// location in the container. It returns a map of host path by container destination.\n// Note: if you change this function, you might also want to modify `WalkWorkspace`.\nfunc walkWorkspaceWithDestinations(workspace string, excludes []string, fts []FromTo) (map[string]string, error) {\n\tdockerIgnored, err := NewDockerIgnorePredicate(workspace, excludes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Walk the workspace\n\tsrcByDest := make(map[string]string)\n\tfor _, ft := range fts {\n\t\tabsFrom := filepath.Join(workspace, ft.From)","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/syncmap.go#L34-L70","documentation":"SyncMap fails with \"walking workspace\" when walkWorkspaceWithDestinations errors while traversing the artifact workspace to match files against COPY/ADD destinations from the Dockerfile. The walk resolves syncable sources to container destinations, so unreadable directories or bad symlinks abort the whole sync-map computation.","triggerScenarios":"The workspace contains an unreadable subdirectory, a symlink loop, or a file that cannot be stat'd during the filepath walk; a COPY destination computed by the parser is invalid so the mapping step fails.","commonSituations":"Files created by root inside the workspace while Skaffold runs as a non-root user; node_modules or vendored dirs with circular symlinks; mounted volumes that drop offline mid-walk; COPY --from references producing odd destinations.","solutions":["Run `find <workspace> ! -readable` to locate unreadable entries and fix their permissions or exclude them via .dockerignore.","Remove or fix cyclic/broken symlinks in the workspace (`find <workspace> -type l -xtype l` for dangling links).","Add problematic generated directories (node_modules, .git, build output) to .dockerignore so the walk skips them.","Ensure no volumes/network mounts in the workspace disappeared during the walk.","Check the wrapped error message — it names the specific path that failed."],"exampleFix":"// before\n# workspace contains root-owned build/ unreadable by CI user → walk fails\n// after\nprintf 'build\\nnode_modules\\n.git\\n' > .dockerignore\nsudo chmod -R u+rwX,go+rX <workspace>","handlingStrategy":"validation","validationCode":"func workspaceWalkable(workspace string) error {\n\treturn filepath.Walk(workspace, func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil { return fmt.Errorf(\"cannot walk %s: %w\", path, err) }\n\t\treturn nil\n\t})\n}","typeGuard":"func isWalkable(workspace string) bool { return workspaceWalkable(workspace) == nil }","tryCatchPattern":"if err := workspaceWalkable(workspace); err != nil { return err }\nif _, err := docker.SyncMap(ctx, workspace, dockerfilePath, buildArgs, cfg); err != nil {\n\tif strings.Contains(err.Error(), \"walking workspace\") {\n\t\treturn fmt.Errorf(\"fix unreadable paths/symlinks in workspace (see wrapped error): %v\", err)\n\t}\n\treturn err\n}","preventionTips":["Ensure the Skaffold user owns or can read all workspace files (chown/chmod after container steps).","Exclude generated dirs (node_modules, .git, build output) via .dockerignore to shrink the walk.","Remove broken/cyclic symlinks before sync (`find . -xtype l -delete`).","Keep mounted volumes available for the duration of skaffold dev."],"tags":["docker","filesystem","file-sync","permissions"],"backgroundTag":"workspace-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"}