{"record":{"id":"1f7d425067726ce8","repo":"GoogleContainerTools/skaffold","slug":"unable-to-generate-skaffold-config-file-automatica-1f7d42","errorCode":null,"errorMessage":"unable to generate skaffold config file automatically - try running `skaffold init`: action cancelled by user","messagePattern":"unable to generate skaffold config file automatically - try running `skaffold init`: action cancelled by user","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/skaffold/app/cmd/runner.go","lineNumber":122,"sourceCode":"\treturn runCtx, configs, nil\n}\n\n// withFallbackConfig will try to automatically generate a config if root `skaffold.yaml` file does not exist.\nfunc withFallbackConfig(ctx context.Context, out io.Writer, opts config.SkaffoldOptions, getCfgs func(context.Context, config.SkaffoldOptions) (parser.SkaffoldConfigSet, error)) (parser.SkaffoldConfigSet, error) {\n\tconfigs, err := getCfgs(ctx, opts)\n\tif err == nil {\n\t\treturn configs, nil\n\t}\n\tvar e sErrors.Error\n\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}","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/cmd/skaffold/app/cmd/runner.go#L104-L140","documentation":"The automatic config generation was aborted because the user cancelled the interactive `initializer.Transparent` prompts (returned nil config). Skaffold reports that no config could be generated and suggests `skaffold init`.","triggerScenarios":"Running a command in a directory without skaffold.yaml with auto-creation enabled, and answering negatively (or declining) to the interactive generation prompts, so Transparent returns nil.","commonSituations":"Running skaffold in CI where stdin is unavailable/prompts auto-cancel; user answers 'no' to artifact selection prompts; non-interactive terminal aborting the survey.","solutions":["Run `skaffold init` interactively and complete the prompts to create skaffold.yaml","For non-interactive environments, provide skaffold.yaml ahead of time (commit it)","Use skaffold init --force --skip-deployments or flags that skip interactive selection","Set --auto-create-config=false if you intend to fail fast rather than prompt"],"exampleFix":"// CI environment, no interactive tty\n// before: skaffold run (prompts cancelled)\n// after\nci:\n  - skaffold init --force && skaffold run","handlingStrategy":"fallback","validationCode":"if [ ! -t 0 ]; then echo 'non-interactive shell: interactive init prompts will be cancelled - provide skaffold.yaml'; fi","typeGuard":null,"tryCatchPattern":"config, err := initializer.Transparent(ctx, out, cfg)\nif err == nil && config == nil {\n\t// user cancelled: fall back to instructing manual init\n\treturn errors.New(\"config generation cancelled; run `skaffold init` to complete setup\")\n}","preventionTips":["Never rely on interactive init in CI/non-TTY environments","Complete init prompts fully during project bootstrap and commit the result","Use skaffold init --force with non-interactive flags when automation is required","Detect TTY absence and skip auto-init paths"],"tags":["skaffold","init","interactive","cancelled"],"backgroundTag":"skaffold-init-cancelled","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"}