GoogleContainerTools/skaffold · error

parsing skaffold config: %w

Error message

parsing skaffold config: %w

What it means

The skaffold config file exists but could not be parsed into versioned Skaffold configs. The parser failed on YAML syntax, an unsupported/unknown apiVersion, or structural type errors, and the raw parser error is wrapped here.

Source

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

			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)
	}
}

func setDefaultRendererAndDeployer(configs parser.SkaffoldConfigSet) {
	// do not set a default deployer or renderer in a multi-config application.
	if len(configs) > 1 {
		return
	}

View on GitHub (pinned to a1189de023)

Solutions

  1. Read the wrapped cause after 'parsing skaffold config:' - it names the YAML/schema problem
  2. Validate YAML syntax (yamllint) and fix indentation/tabs
  3. Run `skaffold fix -f skaffold.yaml` to migrate unsupported apiVersions
  4. Check the installed skaffold version vs the config's apiVersion compatibility

Example fix

// before (tabs cause YAML parse error)
build:
	artifacts:
// after (spaces)
build:
  artifacts:
    - image: my-app
Defensive patterns

Strategy: validation

Validate before calling

python3 -c "import yaml,sys; yaml.safe_load(open('skaffold.yaml'))" && echo 'yaml ok'
skaffold diagnose >/dev/null 2>&1 || echo 'schema/parse problem'

Try / catch

_, _, _, err := createNewRunner(ctx, out, opts)
if err != nil && strings.Contains(err.Error(), "parsing skaffold config:") {
	return fmt.Errorf("skaffold.yaml is malformed or uses an unsupported apiVersion: %w", err)
}

Prevention

When it happens

Trigger: Any config-loading command where parser returns an error other than CONFIG_FILE_NOT_FOUND: malformed YAML, unsupported apiVersion/kind for this skaffold version, invalid field types (e.g. string where int expected), or unreadable file (permissions).

Common situations: Hand-edited skaffold.yaml with YAML indentation mistakes; config written for a newer skaffold version than the installed binary; tabs instead of spaces; merging/included config files with bad syntax.

Related errors


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