{"record":{"id":"758f0bb03930682e","repo":"GoogleContainerTools/skaffold","slug":"cannot-find-provided-file-s","errorCode":null,"errorMessage":"cannot find provided file %s","messagePattern":"cannot find provided file (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/skaffold/app/cmd/apply.go","lineNumber":73,"sourceCode":"}\n\nfunc doApply(ctx context.Context, out io.Writer, args []string) error {\n\t// force set apply boolean to select default options in runner creation\n\topts.Apply = true\n\topts.HydratedManifests = args\n\tif err := validateManifests(args); err != nil {\n\t\treturn err\n\t}\n\treturn withRunner(ctx, out, func(r runner.Runner, configs []util.VersionedConfig) error {\n\t\treturn r.Apply(ctx, out)\n\t})\n}\n\nfunc validateManifests(manifests []string) error {\n\tfor _, m := range manifests {\n\t\tif _, err := os.Open(m); err != nil {\n\t\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\t\treturn fmt.Errorf(\"cannot find provided file %s\", m)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"unable to open provided file %s\", m)\n\t\t}\n\n\t\tif _, err := kubernetes.ParseKubernetesObjects(m); err != nil {\n\t\t\treturn errors.Wrap(err, fmt.Sprintf(\"%s is not a valid Kubernetes manifest\", m))\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":55,"sourceCodeEnd":84,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/cmd/skaffold/app/cmd/apply.go#L55-L84","documentation":"In `skaffold apply` (cmd/skaffold/app/cmd/apply.go:73), validateManifests opens each manifest file passed via the --filepath flag before applying. When os.Open fails with os.ErrNotExist, the command aborts with this error because the file to apply does not exist.","triggerScenarios":"Running `skaffold apply --filepath <file>` (or positional manifest args resolved by doApply) where one of the given paths does not exist on disk; validateManifests iterates the manifests and os.Open returns os.ErrNotExist.","commonSituations":"Typo in the manifest path; running from a different working directory than expected; manifest was generated into a path that a previous build/render step never produced; deleted or renamed file still referenced in a script/CI job.","solutions":["Check the path with `ls` and fix any typo in the --filepath argument","Run the command from the directory where the manifest path is valid, or pass an absolute path","Ensure the manifest-generating step (e.g. `skaffold render`) ran and wrote the file before apply","Update the script/CI pipeline to reference the current manifest location"],"exampleFix":"// before\n// skaffold apply --filepath manifests/deployement.yaml\n// after\n// skaffold apply --filepath manifests/deployment.yaml","handlingStrategy":"validation","validationCode":"// Before running skaffold apply, verify every manifest exists\nfor _, m := range manifests {\n    if _, err := os.Stat(m); os.IsNotExist(err) {\n        return fmt.Errorf(\"manifest missing before apply: %s\", m)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := sh.Run(\"skaffold\", \"apply\", \"--filepath\", manifestPath); err != nil {\n    if strings.Contains(err.Error(), \"cannot find provided file\") {\n        log.Fatalf(\"manifest %s does not exist; run render first\", manifestPath)\n    }\n    return err\n}","preventionTips":["Use absolute paths or consistent working directories in scripts","Always run the manifest-generating step (render) before apply","Add a file-existence check to CI before invoking apply","Avoid hand-typed paths; derive them from variables used to create the files"],"tags":["cli","apply","file-not-found","manifest"],"backgroundTag":"file-not-found","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"}