{"record":{"id":"972d0712037efd02","repo":"abiosoft/colima","slug":"config-load-failed-w","errorCode":null,"errorMessage":"config load failed: %w","messagePattern":"config load failed: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/start.go","lineNumber":468,"sourceCode":"\tif fixedConf.MountType != \"\" {\n\t\twarnIfNotEqual(\"volume mount type\", conf.MountType, fixedConf.MountType)\n\t\tconf.MountType = fixedConf.MountType\n\t}\n\tif fixedConf.Network.Address && !conf.Network.Address {\n\t\tlog.Warnln(\"network address cannot be disabled once enabled\")\n\t\tconf.Network.Address = true\n\t}\n\tif fixedConf.Network.Mode != \"\" {\n\t\twarnIfNotEqual(\"network mode\", conf.Network.Mode, fixedConf.Network.Mode)\n\t\tconf.Network.Mode = fixedConf.Network.Mode\n\t}\n}\n\nfunc prepareConfig(cmd *cobra.Command) {\n\tcurrent, err := configmanager.Load()\n\tif err != nil {\n\t\t// not fatal, will proceed with defaults\n\t\tlog.Warnln(fmt.Errorf(\"config load failed: %w\", err))\n\t\tlog.Warnln(\"reverting to default settings\")\n\t}\n\n\t// handle legacy kubernetes flag\n\tif cmd.Flag(\"with-kubernetes\").Changed {\n\t\tstartCmdArgs.Kubernetes.Enabled = startCmdArgs.Flags.LegacyKubernetes\n\t\tcmd.Flag(\"kubernetes\").Changed = true\n\t}\n\n\t// handle legacy cpu flag\n\tif cmd.Flag(\"cpu\").Changed && !cmd.Flag(\"cpus\").Changed {\n\t\tstartCmdArgs.CPU = startCmdArgs.Flags.LegacyCPU\n\t\tcmd.Flag(\"cpus\").Changed = true\n\t}\n\n\t// convert cli to config file format\n\tstartCmdArgs.Mounts = mountsFromFlag(startCmdArgs.Flags.Mounts)\n\tstartCmdArgs.Network.DNSHosts = dnsHostsFromFlag(startCmdArgs.Flags.DNSHosts)","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/start.go#L450-L486","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","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"],"exampleFix":"# before\n$ colima start\nWARN[0000] config load failed: could not load config from file: yaml: line 3: mapping values are not allowed in this context\n\n# after: fix the YAML, then start again\n$ colima start --edit   # correct line 3, save, quit\n$ colima start","handlingStrategy":"fallback","validationCode":"// Pre-validate the YAML before invoking colima start\nhome, _ := os.UserHomeDir()\nf := filepath.Join(home, \".colima\", \"_config\", \"colima.yaml\") // adjust for profile/COLIMA_HOME\nif b, err := os.ReadFile(f); err == nil {\n    var c config.Config\n    if err := yaml.Unmarshal(b, &c); err != nil {\n        log.Fatalf(\"config file is invalid, fix before start: %v\", err)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["config","yaml","corruption","defaults-fallback"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}