GoogleContainerTools/skaffold · error

skaffold config file %s not found - check your current worki

Error message

skaffold config file %s not found - check your current working directory, or try running `skaffold init`

What it means

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`.

Source

Thrown at cmd/skaffold/app/cmd/runner.go:132

	if errors.As(err, &e) && e.StatusCode() == proto.StatusCode_CONFIG_FILE_NOT_FOUND_ERR {
		if (opts.AutoCreateConfig || opts.AutoInit) && initializer.ValidCmd(opts) {
			output.Default.Fprintf(out, "Skaffold config file %s not found - Trying to create one for you...\n", opts.ConfigurationFile)
			config, err := initializer.Transparent(context.Background(), out, initConfig.Config{Opts: opts, EnableManifestGeneration: opts.AutoInit})
			if err != nil {
				return nil, fmt.Errorf("unable to generate skaffold config file automatically - try running `skaffold init`: %w", err)
			}
			if config == nil {
				return nil, fmt.Errorf("unable to generate skaffold config file automatically - try running `skaffold init`: action cancelled by user")
			}

			defaults.Set(config)

			return parser.SkaffoldConfigSet{
				&parser.SkaffoldConfigEntry{SkaffoldConfig: config, IsRootConfig: true},
			}, nil
		}

		return nil, fmt.Errorf("skaffold config file %s not found - check your current working directory, or try running `skaffold init`", opts.ConfigurationFile)
	}

	// If the error is NOT that the file doesn't exist, then we warn the user
	// that maybe they are using an outdated version of Skaffold that's unable to read
	// the configuration.
	warnIfUpdateIsAvailable()
	return nil, fmt.Errorf("parsing skaffold config: %w", err)
}

func warnIfUpdateIsAvailable() {
	warning, err := update.CheckVersionOnError(opts.GlobalConfig)
	if err != nil {
		log.Entry(context.TODO()).Infof("update check failed: %s", err)
		return
	}
	if warning != "" {
		log.Entry(context.TODO()).Warn(warning)
	}

View on GitHub (pinned to a1189de023)

Solutions

  1. cd to the directory containing skaffold.yaml or pass -f /path/to/skaffold.yaml
  2. Run `skaffold init` to generate a config if the project has none
  3. Verify the file name matches opts.ConfigurationFile (default skaffold.yaml)
  4. If auto-generation is desired, enable --auto-create-config / --auto-init

Example fix

// before
skaffold run # in repo root, config is in backend/
// after
skaffold run -f backend/skaffold.yaml
# or
cd backend && skaffold run
Defensive patterns

Strategy: validation

Validate before calling

CONFIG=${SKAFFOLD_FILE:-skaffold.yaml}
[ -f "$CONFIG" ] || { echo "skaffold config $CONFIG not found in $(pwd)"; exit 1; }

Try / catch

_, _, _, err := createNewRunner(ctx, out, opts)
var sErr sErrors.Error
if err != nil && errors.As(err, &sErr) && sErr.StatusCode() == proto.StatusCode_CONFIG_FILE_NOT_FOUND_ERR {
	return fmt.Errorf("no skaffold.yaml in %s; run `skaffold init` or pass -f", cwd)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/9218782cb70601ff. Report an issue: GitHub.