{"record":{"id":"ce4f66af20eed054","repo":"dagger/dagger","slug":"ports-s-backendport-must-be-an-integer","errorCode":null,"errorMessage":"ports.%s.backendPort must be an integer","messagePattern":"ports\\.(.+?)\\.backendPort must be an integer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/workspace/config.go","lineNumber":1316,"sourceCode":"\t\tenv.Modules[moduleName] = module\n\t\tcfg.Env[envName] = env\n\t\treturn nil\n\tcase \"ports\":\n\t\tif len(parts) != 3 {\n\t\t\treturn fmt.Errorf(\"invalid key %q; expected ports.<host>.backendService or ports.<host>.backendPort\", strings.Join(parts, \".\"))\n\t\t}\n\t\tif cfg.Ports == nil {\n\t\t\tcfg.Ports = map[string]PortMapping{}\n\t\t}\n\t\thost := parts[1]\n\t\tpm := cfg.Ports[host]\n\t\tswitch parts[2] {\n\t\tcase \"backendService\":\n\t\t\tpm.BackendService = fmt.Sprint(value)\n\t\tcase \"backendPort\":\n\t\t\tport, ok := value.(int64)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"ports.%s.backendPort must be an integer\", host)\n\t\t\t}\n\t\t\tpm.BackendPort = int(port)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown config key %q\", strings.Join(parts, \".\"))\n\t\t}\n\t\tcfg.Ports[host] = pm\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown config key %q\", strings.Join(parts, \".\"))\n\t}\n}\n\nfunc validateKeyAgainstType(parts []string, t reflect.Type, fullKey, op string) error {\n\tif len(parts) == 0 {\n\t\treturn nil\n\t}\n\n\tfield, ok := findTOMLField(t, parts[0])","sourceCodeStart":1298,"sourceCodeEnd":1334,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/workspace/config.go#L1298-L1334","documentation":"setConfigValue was asked to write ports.<host>.backendPort, but the value being set did not decode to an integer. Backend ports are typed as integers in the PortMapping struct; the host (%s) names the port mapping whose backendPort was given a non-numeric value (e.g. a service name instead of backendService).","triggerScenarios":"Thrown at core/workspace/config.go:1316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write the port as an integer without quotes or units","Remove any surrounding whitespace or formatting from the value"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}