abiosoft/colima · warning
config load failed: %w
Error message
config load failed: %w
What it means
Logged as a warning in prepareConfig when configmanager.Load() cannot load the existing config file for the current profile. Load only errors when the file exists but is unreadable or fails YAML unmarshalling, so this means the persisted config is corrupt (hand-edited typo, truncated write) or unreadable. Colima deliberately continues with defaults, so subsequent flags act as if no config existed.
Source
Thrown at cmd/start.go:468
if fixedConf.MountType != "" {
warnIfNotEqual("volume mount type", conf.MountType, fixedConf.MountType)
conf.MountType = fixedConf.MountType
}
if fixedConf.Network.Address && !conf.Network.Address {
log.Warnln("network address cannot be disabled once enabled")
conf.Network.Address = true
}
if fixedConf.Network.Mode != "" {
warnIfNotEqual("network mode", conf.Network.Mode, fixedConf.Network.Mode)
conf.Network.Mode = fixedConf.Network.Mode
}
}
func prepareConfig(cmd *cobra.Command) {
current, err := configmanager.Load()
if err != nil {
// not fatal, will proceed with defaults
log.Warnln(fmt.Errorf("config load failed: %w", err))
log.Warnln("reverting to default settings")
}
// handle legacy kubernetes flag
if cmd.Flag("with-kubernetes").Changed {
startCmdArgs.Kubernetes.Enabled = startCmdArgs.Flags.LegacyKubernetes
cmd.Flag("kubernetes").Changed = true
}
// handle legacy cpu flag
if cmd.Flag("cpu").Changed && !cmd.Flag("cpus").Changed {
startCmdArgs.CPU = startCmdArgs.Flags.LegacyCPU
cmd.Flag("cpus").Changed = true
}
// convert cli to config file format
startCmdArgs.Mounts = mountsFromFlag(startCmdArgs.Flags.Mounts)
startCmdArgs.Network.DNSHosts = dnsHostsFromFlag(startCmdArgs.Flags.DNSHosts)View on GitHub (pinned to c3a5f9184d)
Solutions
- Validate and fix the YAML: `colima start --edit` opens it in an editor, or run `yamllint`/`python -c 'import yaml,sys; yaml.safe_load(open(sys.argv[1]))' <file>` on the printed path
- Check permissions/ownership of the config dir if the wrapped error says permission denied
- As a last resort recreate it: `colima delete` then `colima start` regenerates a clean config
- Note the current run already fell back to defaults — restart colima after fixing so the config is honored
Example fix
# before $ colima start WARN[0000] config load failed: could not load config from file: yaml: line 3: mapping values are not allowed in this context # after: fix the YAML, then start again $ colima start --edit # correct line 3, save, quit $ colima start
Defensive patterns
Strategy: fallback
Validate before calling
// Pre-validate the YAML before invoking colima start
home, _ := os.UserHomeDir()
f := filepath.Join(home, ".colima", "_config", "colima.yaml") // adjust for profile/COLIMA_HOME
if b, err := os.ReadFile(f); err == nil {
var c config.Config
if err := yaml.Unmarshal(b, &c); err != nil {
log.Fatalf("config file is invalid, fix before start: %v", err)
}
} Prevention
- Lint the config file after every manual edit (yamllint or a yaml.safe_load one-liner)
- Prefer `colima start --edit` or CLI flags over editing the file blindly
- Remember this path silently proceeds with defaults — always fix and restart so your settings apply
When it happens
Trigger: `colima start` with a syntactically invalid ~/.colima/<profile> config YAML (bad indent, tab characters, wrong types); file with wrong permissions or ownership; partial write from a crashed earlier run.
Common situations: Hand-editing the config file and introducing a YAML error; machines where ~/.colima became root-owned after running colima under sudo; editor leaving a swap/backup that got renamed over the real file.
Related errors
- error in config file: %w
- could not load config from file: %w
- embedded default config is invalid yaml: %w
- unexpected error nested value encoding: %w
- error persisting runtime settings: %w
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/972d0712037efd02.
Report an issue: GitHub.