{"record":{"id":"963b1adbfdd770bb","repo":"grpc/grpc-java","slug":"failed-to-parse-envoy-config-core-v3-address-addr","errorCode":null,"errorMessage":"Failed to parse envoy.config.core.v3.Address: Address field is empty or invalid.","messagePattern":"Failed to parse envoy\\.config\\.core\\.v3\\.Address: Address field is empty or invalid\\.","errorType":"validation","errorClass":"ResourceInvalidException","httpStatus":null,"severity":"error","filePath":"xds/src/main/java/io/grpc/xds/XdsEndpointResource.java","lineNumber":335,"sourceCode":"        socketAddress = any.unpack(Address.class).getSocketAddress();\n      } catch (InvalidProtocolBufferException ex) {\n        throw new ResourceInvalidException(\"Invalid Resource in address proto\", ex);\n      }\n      validateAddress(socketAddress);\n\n      String ip = socketAddress.getAddress();\n      int port = socketAddress.getPortValue();\n\n      try {\n        return new InetSocketAddress(InetAddresses.forString(ip), port);\n      } catch (IllegalArgumentException e) {\n        throw createException(\"Invalid IP address or port: \" + ip + \":\" + port);\n      }\n    }\n\n    private void validateAddress(SocketAddress socketAddress) throws ResourceInvalidException {\n      if (socketAddress.getAddress().isEmpty()) {\n        throw createException(\"Address field is empty or invalid.\");\n      }\n      long port = Integer.toUnsignedLong(socketAddress.getPortValue());\n      if (port > 65535) {\n        throw createException(String.format(\"Port value %d out of range 1-65535.\", port));\n      }\n    }\n\n    private ResourceInvalidException createException(String message) {\n      return new ResourceInvalidException(\n          \"Failed to parse envoy.config.core.v3.Address: \" + message);\n    }\n  }\n}\n","sourceCodeStart":317,"sourceCodeEnd":349,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/xds/src/main/java/io/grpc/xds/XdsEndpointResource.java#L317-L349","documentation":"XdsEndpointResource.validateAddress rejects envoy.config.core.v3.SocketAddress messages whose address string is empty, since a network address is mandatory to build an InetSocketAddress. The failure is wrapped as ResourceInvalidException prefixed 'Failed to parse envoy.config.core.v3.Address:'. The xDS resource is treated as invalid and NACKed.","triggerScenarios":"xDS response (EDS ClusterLoadAssignment endpoint or cluster address) where SocketAddress.address is the empty string — validateAddress is called from parse before attempting IP parsing.","commonSituations":"Control plane generating endpoints without setting the address field (proto default when field omitted); templated/generated config where a variable failed to substitute; hand-written EDS JSON/YAML missing 'address'.","solutions":["Set the required SocketAddress.address field on every endpoint in the xDS configuration at the management server.","Audit generated/templated endpoint configs for unset variables that render an empty address.","Inspect the NACKed resource in control-plane/ADS logs to find which locality/endpoint lacks the address.","Upgrade the control plane if it has a known bug emitting empty addresses for unhealthy or draining endpoints."],"exampleFix":"# before (EDS endpoint missing address)\nendpoints:\n- lb_endpoints:\n  - endpoint: { address: { socket_address: { port_value: 50051 } } }\n\n# after\nendpoints:\n- lb_endpoints:\n  - endpoint: { address: { socket_address: { address: \"10.0.1.12\", port_value: 50051 } } }","handlingStrategy":"validation","validationCode":"// reject endpoints with empty addresses before publishing to xDS\nfor (LbEndpoint ep : assignment.getEndpointsList()) {\n  SocketAddress sa = ep.getEndpoint().getAddress().getSocketAddress();\n  if (sa.getAddress().isEmpty() || sa.getPortValue() == 0) {\n    throw new IllegalArgumentException(\"Endpoint missing address: \" + ep);\n  }\n}","typeGuard":"static boolean hasCompleteAddress(SocketAddress sa) {\n  return sa != null && !sa.getAddress().isEmpty();\n}","tryCatchPattern":"try {\n  applyEndpointResource(resource);\n} catch (ResourceInvalidException e) {\n  logger.error(\"EDS resource missing address fields: \" + e.getMessage());\n  skipAndNackResource(resource);\n}","preventionTips":["Require explicit address fields in endpoint config templates (fail template rendering on empty substitution).","Validate generated EDS payloads against a proto schema with address required before publishing.","Set up control-plane alerts for endpoints emitted without addresses.","Ensure draining/unhealthy endpoints still carry valid addresses or are omitted entirely."],"tags":["grpc","xds","envoy","address-validation","empty-field"],"backgroundTag":"empty-required-field","analyzedSha":"64daddc1f3d1975670f769f3e97bde8b2ba32d25","analyzedAt":"2026-09-08T06:14:57.704Z","contentChangedAt":"2026-09-08T06:14:57.704Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}