{"record":{"id":"16dfe9f6ba115d89","repo":"abiosoft/colima","slug":"error-in-config-w","errorCode":null,"errorMessage":"error in config: %w","messagePattern":"error in config: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/start.go","lineNumber":100,"sourceCode":"\t\t\t}\n\t\t\t// pause before startup to prevent race condition\n\t\t\ttime.Sleep(time.Second * 3)\n\t\t}\n\n\t\treturn start(app, conf)\n\t},\n\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t// validate Lima version\n\t\tif err := core.LimaVersionSupported(); err != nil {\n\t\t\treturn fmt.Errorf(\"lima compatibility error: %w\", err)\n\t\t}\n\n\t\t// combine args and current config file(if any)\n\t\tprepareConfig(cmd)\n\n\t\t// validate config\n\t\tif err := configmanager.ValidateConfig(startCmdArgs.Config); err != nil {\n\t\t\treturn fmt.Errorf(\"error in config: %w\", err)\n\t\t}\n\n\t\t// persist in preparation for application start\n\t\tif startCmdArgs.Flags.SaveConfig {\n\t\t\tif err := configmanager.Save(startCmdArgs.Config); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error preparing config file: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\t// validate and set downloader if flag is specified (takes precedence over env var)\n\t\tif cmd.Flag(\"downloader\").Changed {\n\t\t\tnormalized, err := downloader.ValidateDownloader(startCmdArgs.Flags.Downloader)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdownloader.SetDownloader(normalized)\n\t\t}\n","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/start.go#L82-L118","documentation":"PreRunE of `colima start` rejects the merged configuration (CLI flags merged over the config file via prepareConfig) through configmanager.ValidateConfig. The wrapped error names the exact violation: invalid mountType (only 9p/sshfs, plus virtiofs on macOS 13+), invalid vmType (qemu; vz on macOS 13+; krunkit only on Apple Silicon macOS 13+), missing qemu-img/krunkit binary, remote diskImage URL, invalid port forwarder (grpc/ssh/none), gateway not IPv4 ending in .2, or a mount path containing spaces.","triggerScenarios":"`colima start --mount-type virtiofs` on macOS < 13; `--vm-type vz` on an old macOS; `--vm-type qemu` without qemu-img installed; `--diskImage https://...`; `--port-forwarder docker`; `--network-gateway` with a non-.2 last octet; a mount location containing a space.","commonSituations":"Copy-pasted flags from docs/newer issues onto an older macOS; config file edited by hand with a typo'd enum; spaces in mount paths ( silently failing at Lima level, now validated); upgrading macOS but keeping an invalid stale config.","solutions":["Read the wrapped message — it names the exact field and allowed values; fix the flag or the config file entry it points to","Check platform constraints: `sw_vers` for macOS version; virtiofs/vz need macOS 13+, krunkit needs Apple Silicon","Install missing tools for the chosen vmType: qemu-img for qemu (brew install qemu), krunkit for krunkit","Edit or reset the persisted config: `colima start --edit`, or `colima delete` to discard it entirely"],"exampleFix":"# before\n$ colima start --mount-type virtiofs   # on macOS 12\nError: error in config: invalid mountType: 'virtiofs'\n\n# after\n$ colima start --mount-type 9p        # or upgrade to macOS 13+ for virtiofs","handlingStrategy":"validation","validationCode":"// Validate enums the same way ValidateConfig does before invoking colima start\nvalidMount := map[string]bool{\"9p\": true, \"sshfs\": true}\nvalidVM := map[string]bool{\"qemu\": true}\n// add \"virtiofs\"/\"vz\" only on macOS 13+, \"krunkit\" only on macOS 13+ Apple Silicon\nif !validMount[mountType] || !validVM[vmType] {\n    log.Fatal(\"invalid mountType or vmType for this platform\")\n}\nfor _, m := range mounts {\n    if strings.Contains(m, \" \") {\n        log.Fatalf(\"mount path %q contains spaces (unsupported)\", m)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `colima start --help` and use only listed enum values for mount-type/vm-type/runtime/port-forwarder","Keep flags platform-appropriate (vz/virtiofs need macOS 13+; krunkit needs Apple Silicon)","After editing the YAML config, re-run `colima start` and fix the first validation message before iterating"],"tags":["config","validation","flags","macos"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}