{"record":{"id":"137e045895627ac9","repo":"GoogleContainerTools/skaffold","slug":"reading-dockerignore-w","errorCode":null,"errorMessage":"reading .dockerignore: %w","messagePattern":"reading \\.dockerignore: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/dependencies.go","lineNumber":138,"sourceCode":"}\n\nfunc getDependencies(ctx context.Context, workspace string, dockerfilePath string, absDockerfilePath string, buildArgs map[string]*string, cfg Config) ([]string, error) {\n\t// If the Dockerfile doesn't exist, we can't compute the dependency.\n\t// But since we know the Dockerfile is a dependency, let's return a list\n\t// with only that file. It makes errors down the line more actionable\n\t// than returning an error now.\n\tif _, err := os.Stat(absDockerfilePath); os.IsNotExist(err) {\n\t\treturn []string{dockerfilePath}, nil\n\t}\n\n\tfts, err := ReadCopyCmdsFromDockerfile(ctx, false, 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\tdeps := make([]string, 0, len(fts))\n\tfor _, ft := range fts {\n\t\tdeps = append(deps, ft.From)\n\t}\n\n\tfiles, err := WalkWorkspace(workspace, excludes, deps)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"walking workspace: %w\", err)\n\t}\n\n\t// Always add dockerfile even if it's .dockerignored. The daemon will need it anyways.\n\tif !filepath.IsAbs(dockerfilePath) {\n\t\tfiles[dockerfilePath] = true\n\t} else {\n\t\tfiles[absDockerfilePath] = true\n\t}","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/dependencies.go#L120-L156","documentation":"Fires in getDependencies when the .dockerignore file (or its parent path) cannot be read while computing docker artifact dependencies. Usually a permissions issue or an unreadable path; note a *missing* dockerignore is normally tolerated, so this signals an I/O failure rather than absence alone.","triggerScenarios":"Thrown at pkg/skaffold/docker/dependencies.go:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check file permissions on the .dockerignore file and workspace directory","Remove or fix a corrupted .dockerignore (e.g. invalid path entries causing read errors)","Ensure the workspace is fully accessible to the skaffold process (container mounts, network filesystems)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}