GoogleContainerTools/skaffold · critical
read skaffold config: %w
Error message
read skaffold config: %w
What it means
ParseConfig wraps any failure to physically read the skaffold configuration file with this message. It is a generic wrapper (%w) around errors from misc.ReadConfiguration, so the underlying cause (missing file, permission denied, IO error) is chained after 'read skaffold config:'.
Source
Thrown at pkg/skaffold/schema/versions.go:231
}
}
return nil, false
}
// IsSkaffoldConfig is for determining if a file is skaffold config file.
func IsSkaffoldConfig(file string) bool {
if config, err := ParseConfig(file); err == nil && config != nil {
return true
}
return false
}
// ParseConfig reads a configuration file.
func ParseConfig(filename string) ([]util.VersionedConfig, error) {
buf, err := misc.ReadConfiguration(filename)
if err != nil {
return nil, fmt.Errorf("read skaffold config: %w", err)
}
factories, err := configFactoryFromAPIVersion(buf)
if err != nil {
return nil, err
}
buf, err = removeYamlAnchors(buf)
if err != nil {
return nil, fmt.Errorf("unable to re-marshal YAML without dotted keys: %w", err)
}
return parseConfig(buf, factories)
}
// ParseConfigAndUpgrade reads a configuration file and upgrades it to a given version.
func ParseConfigAndUpgrade(filename string) ([]util.VersionedConfig, error) {
configs, err := ParseConfig(filename)
if err != nil {
return nil, err
}View on GitHub (pinned to a1189de023)
Solutions
- Verify the file exists at the given path (ls / test -f)
- Run the command from the directory containing skaffold.yaml or pass the correct --filename
- Fix file permissions if the file exists but is unreadable
- Inspect the wrapped cause (%w) for the exact OS error
Example fix
// before
configs, err := schema.ParseConfig(cfgPath)
// after
if _, statErr := os.Stat(cfgPath); statErr != nil {
return fmt.Errorf("skaffold config %q not found: %w", cfgPath, statErr)
}
configs, err := schema.ParseConfig(cfgPath) Defensive patterns
Strategy: try-catch
Validate before calling
if _, err := os.Stat(cfgPath); err != nil {
return fmt.Errorf("cannot access skaffold config %q: %w", cfgPath, err)
} Try / catch
configs, err := schema.ParseConfig(cfgPath)
if err != nil {
if errors.Is(err, os.ErrNotExist) || errors.Is(err, os.ErrPermission) {
// resolve path/permissions before retrying
}
return fmt.Errorf("load config: %w", err)
} Prevention
- Resolve skaffold.yaml relative to the repo root, not CWD
- Check file existence in setup code before parsing
- Verify CI checkout includes skaffold.yaml
- Unwrap errors.Is/errors.As to inspect the root OS error
When it happens
Trigger: Calling skaffold.ParseConfig(filename) when the file does not exist, is a directory, or the process lacks read permission on it.
Common situations: Running skaffold from a directory without skaffold.yaml; wrong --filename path; permissions changed after checkout; CI checkout missing the config file.
Understand the failure class
Background: "Config file not found": what it means and how to fix it in docker-sync, Maven, Vagrant, Turborepo and other tools — this error's family across 60 libraries.
Related errors
- reading config file: %w
- writing config file: %w
- unable to re-marshal YAML without dotted keys: %w
- parsing api version: %w
- unable to parse YAML: %w
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/fce70e4b28eeef98.
Report an issue: GitHub.