{"record":{"id":"83f585316b42f117","repo":"hashicorp/nomad","slug":"port-map-out-of-bounds","errorCode":null,"errorMessage":"port map out of bounds","messagePattern":"port map out of bounds","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/drivers/server.go","lineNumber":157,"sourceCode":"\t\t\tif err != nil {\n\t\t\t\t// If this error, it will always error\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\treturn nil, st.Err()\n\t\t}\n\t\treturn nil, err\n\t}\n\n\tvar pbNet *proto.NetworkOverride\n\tif net != nil {\n\t\tpbNet = &proto.NetworkOverride{\n\t\t\tPortMap:       map[string]int32{},\n\t\t\tAddr:          net.IP,\n\t\t\tAutoAdvertise: net.AutoAdvertise,\n\t\t}\n\t\tfor k, v := range net.PortMap {\n\t\t\tif v > math.MaxInt32 {\n\t\t\t\treturn nil, fmt.Errorf(\"port map out of bounds\")\n\t\t\t}\n\t\t\tpbNet.PortMap[k] = int32(v)\n\t\t}\n\t}\n\n\tresp := &proto.StartTaskResponse{\n\t\tHandle:          taskHandleToProto(handle),\n\t\tNetworkOverride: pbNet,\n\t}\n\n\treturn resp, nil\n}\n\nfunc (b *driverPluginServer) WaitTask(ctx context.Context, req *proto.WaitTaskRequest) (*proto.WaitTaskResponse, error) {\n\tch, err := b.impl.WaitTask(ctx, req.TaskId)\n\tif err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/plugins/drivers/server.go#L139-L175","documentation":"Driver server guard in StartTask: a port map value exceeds math.MaxInt32 and cannot be stored in the int32 field of the protobuf NetworkOverride, so the request is rejected before reaching the driver.","triggerScenarios":"Thrown at plugins/drivers/server.go:157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use port values within the valid 32-bit range (realistically 1-65535)","Fix the jobspec/JVM override that produced the oversized port number"],"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"}