{"record":{"id":"9218782cb70601ff","repo":"GoogleContainerTools/skaffold","slug":"skaffold-config-file-s-not-found-check-your-cur","errorCode":null,"errorMessage":"skaffold config file %s not found - check your current working directory, or try running `skaffold init`","messagePattern":"skaffold config file (.+?) not found - check your current working directory, or try running `skaffold init`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/skaffold/app/cmd/runner.go","lineNumber":132,"sourceCode":"\tif errors.As(err, &e) && e.StatusCode() == proto.StatusCode_CONFIG_FILE_NOT_FOUND_ERR {\n\t\tif (opts.AutoCreateConfig || opts.AutoInit) && initializer.ValidCmd(opts) {\n\t\t\toutput.Default.Fprintf(out, \"Skaffold config file %s not found - Trying to create one for you...\\n\", opts.ConfigurationFile)\n\t\t\tconfig, err := initializer.Transparent(context.Background(), out, initConfig.Config{Opts: opts, EnableManifestGeneration: opts.AutoInit})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unable to generate skaffold config file automatically - try running `skaffold init`: %w\", err)\n\t\t\t}\n\t\t\tif config == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unable to generate skaffold config file automatically - try running `skaffold init`: action cancelled by user\")\n\t\t\t}\n\n\t\t\tdefaults.Set(config)\n\n\t\t\treturn parser.SkaffoldConfigSet{\n\t\t\t\t&parser.SkaffoldConfigEntry{SkaffoldConfig: config, IsRootConfig: true},\n\t\t\t}, nil\n\t\t}\n\n\t\treturn nil, fmt.Errorf(\"skaffold config file %s not found - check your current working directory, or try running `skaffold init`\", opts.ConfigurationFile)\n\t}\n\n\t// If the error is NOT that the file doesn't exist, then we warn the user\n\t// that maybe they are using an outdated version of Skaffold that's unable to read\n\t// the configuration.\n\twarnIfUpdateIsAvailable()\n\treturn nil, fmt.Errorf(\"parsing skaffold config: %w\", err)\n}\n\nfunc warnIfUpdateIsAvailable() {\n\twarning, err := update.CheckVersionOnError(opts.GlobalConfig)\n\tif err != nil {\n\t\tlog.Entry(context.TODO()).Infof(\"update check failed: %s\", err)\n\t\treturn\n\t}\n\tif warning != \"\" {\n\t\tlog.Entry(context.TODO()).Warn(warning)\n\t}","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/cmd/skaffold/app/cmd/runner.go#L114-L150","documentation":"The skaffold.yaml file does not exist in the current working directory (or the configured --filename path), and auto-creation is disabled or unavailable. Skaffold refuses to proceed and suggests running `skaffold init`.","triggerScenarios":"Running any config-loading command when parser reports CONFIG_FILE_NOT_FOUND and (opts.AutoCreateConfig/opts.AutoInit is off or initializer.ValidCmd(opts) is false): wrong working directory, misnamed config file, or --filename pointing at a missing path.","commonSituations":"Running skaffold from the repo root when skaffold.yaml lives in a subdirectory; file named skaffold.yaml missing because it's gitignored; CI checkout missing the config; typo in -f flag path.","solutions":["cd to the directory containing skaffold.yaml or pass -f /path/to/skaffold.yaml","Run `skaffold init` to generate a config if the project has none","Verify the file name matches opts.ConfigurationFile (default skaffold.yaml)","If auto-generation is desired, enable --auto-create-config / --auto-init"],"exampleFix":"// before\nskaffold run # in repo root, config is in backend/\n// after\nskaffold run -f backend/skaffold.yaml\n# or\ncd backend && skaffold run","handlingStrategy":"validation","validationCode":"CONFIG=${SKAFFOLD_FILE:-skaffold.yaml}\n[ -f \"$CONFIG\" ] || { echo \"skaffold config $CONFIG not found in $(pwd)\"; exit 1; }","typeGuard":null,"tryCatchPattern":"_, _, _, err := createNewRunner(ctx, out, opts)\nvar sErr sErrors.Error\nif err != nil && errors.As(err, &sErr) && sErr.StatusCode() == proto.StatusCode_CONFIG_FILE_NOT_FOUND_ERR {\n\treturn fmt.Errorf(\"no skaffold.yaml in %s; run `skaffold init` or pass -f\", cwd)\n}","preventionTips":["Always run skaffold from the directory containing skaffold.yaml, or pass -f explicitly","Commit skaffold.yaml and avoid gitignoring it","In CI, verify config presence as a pipeline pre-step","Use a consistent config file name across repos"],"tags":["skaffold","missing-file","config","cwd"],"backgroundTag":"skaffold-config-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"}