{"record":{"id":"8878460f03b8f708","repo":"hashicorp/nomad","slug":"could-not-parse-default-outbound-port-q-as-port-n","errorCode":null,"errorMessage":"could not parse default_outbound_port %q as port number: %w","messagePattern":"could not parse default_outbound_port %q as port number: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/networking_cni.go","lineNumber":303,"sourceCode":"\t\t\t// Envoy container with a different UID\n\t\t\tproxyUID = c.nodeMeta[envoy.DefaultTransparentProxyUIDParam]\n\t\t\tif tproxy.UID != \"\" {\n\t\t\t\tproxyUID = tproxy.UID\n\t\t\t}\n\n\t\t\t// The value for the outbound Envoy port. The default value matches\n\t\t\t// the default TransparentProxy service default for\n\t\t\t// OutboundListenerPort. If the cluster admin sets this value to\n\t\t\t// something non-default, they'll need to update the metadata on all\n\t\t\t// the nodes to match. see also:\n\t\t\t// https://developer.hashicorp.com/consul/docs/connect/config-entries/service-defaults#transparentproxy\n\t\t\tif tproxy.OutboundPort != 0 {\n\t\t\t\tproxyOutboundPort = int(tproxy.OutboundPort)\n\t\t\t} else {\n\t\t\t\toutboundPortAttr := c.nodeMeta[envoy.DefaultTransparentProxyOutboundPortParam]\n\t\t\t\tparsedOutboundPort, err := strconv.ParseUint(outboundPortAttr, 10, 16)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\t\t\"could not parse default_outbound_port %q as port number: %w\",\n\t\t\t\t\t\toutboundPortAttr, err)\n\t\t\t\t}\n\t\t\t\tproxyOutboundPort = int(parsedOutboundPort)\n\t\t\t}\n\n\t\t\t// The inbound port is the service port exposed on the Envoy proxy\n\t\t\tenvoyPortLabel := \"connect-proxy-\" + svc.Name\n\t\t\tif envoyPort, ok := portMaps.get(envoyPortLabel); ok {\n\t\t\t\tproxyInboundPort = int(envoyPort.HostPort)\n\t\t\t}\n\n\t\t\t// Extra user-defined ports that get excluded from outbound redirect\n\t\t\tif len(tproxy.ExcludeOutboundPorts) == 0 {\n\t\t\t\toutboundPorts = nil\n\t\t\t} else {\n\t\t\t\toutboundPorts = helper.ConvertSlice(tproxy.ExcludeOutboundPorts,\n\t\t\t\t\tfunc(p uint16) string { return fmt.Sprint(p) })","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/networking_cni.go#L285-L321","documentation":"In setupTransparentProxyArgs, the transparent proxy's default_outbound_port value (from Consul service-defaults or node metadata) is not a valid numeric port, so strconv parsing fails and network setup aborts.","triggerScenarios":"Thrown at client/allocrunner/networking_cni.go:303 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix OutboundListenerPort in Consul transparent proxy service-defaults to a valid port number","Correct the node metadata value for the outbound port parameter","Resync node metadata and retry the allocation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}