{"record":{"id":"cf075d90f1aff00d","repo":"abiosoft/colima","slug":"invalid-port-forwarder-s","errorCode":null,"errorMessage":"invalid port forwarder: '%s'","messagePattern":"invalid port forwarder: '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/configmanager/configmanager.go","lineNumber":92,"sourceCode":"\tif c.VMType == \"qemu\" {\n\t\tif err := util.AssertQemuImg(); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot use vmType: '%s', error: %w\", c.VMType, err)\n\t\t}\n\t}\n\tif c.VMType == \"krunkit\" {\n\t\tif err := util.AssertKrunkit(); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot use vmType: '%s', error: %w\", c.VMType, err)\n\t\t}\n\t}\n\n\tif c.DiskImage != \"\" {\n\t\tif strings.HasPrefix(c.DiskImage, \"http://\") || strings.HasPrefix(c.DiskImage, \"https://\") {\n\t\t\treturn fmt.Errorf(\"cannot use diskImage: remote URLs not supported, only local files can be specified\")\n\t\t}\n\t}\n\n\tif _, ok := validPortForwarders[c.PortForwarder]; !ok {\n\t\treturn fmt.Errorf(\"invalid port forwarder: '%s'\", c.PortForwarder)\n\t}\n\n\tif c.Network.GatewayAddress != nil {\n\t\tif err := validateGatewayAddress(c.Network.GatewayAddress); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := validateMounts(c.Mounts); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\n// Load loads the config.\n// Error is only returned if the config file exists but could not be loaded.\n// No error is returned if the config file does not exist.","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/config/configmanager/configmanager.go#L74-L110","documentation":"ValidateConfig checks portForwarder against the fixed allowlist {grpc, ssh, none}. Any other value, including case variants, whitespace, or names removed in earlier releases, is rejected with the value echoed. grpc and ssh select the host-guest forwarding mechanism; none disables port forwarding.","triggerScenarios":"portForwarder set to values like 'gRPC', 'none ' with a trailing space, 'default', 'docker', or a forwarder name deprecated in an earlier colima release.","commonSituations":"Hand-editing colima.yaml; carrying old configs forward after colima upgrades renamed forwarders; copy-paste introducing capitalization or whitespace differences.","solutions":["Set portForwarder to exactly 'grpc', 'ssh', or 'none'","Remove the key entirely to use the default forwarder for the release","Check the YAML value for trailing spaces or capitalized letters"],"exampleFix":"# before\nportForwarder: gRPC\n\n# after\nportForwarder: grpc","handlingStrategy":"validation","validationCode":"var validPortForwarders = map[string]bool{\"grpc\": true, \"ssh\": true, \"none\": true}\nif !validPortForwarders[strings.TrimSpace(c.PortForwarder)] || c.PortForwarder != strings.TrimSpace(c.PortForwarder) {\n    // fix the value before validation runs\n}","typeGuard":null,"tryCatchPattern":"if err := configmanager.ValidateConfig(c); err != nil {\n    if strings.HasPrefix(err.Error(), \"invalid port forwarder\") {\n        // show allowlist: grpc, ssh, none\n    }\n}","preventionTips":["Only use the exact lowercase values grpc, ssh, none","Set portForwarder via CLI flag to avoid hand-editing errors","Trim whitespace when generating configs programmatically"],"tags":["config","validation","port-forwarding"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}