{"record":{"id":"175bd982d336d7fd","repo":"grpc/grpc-go","slug":"produced-zero-addresses-175bd9","errorCode":null,"errorMessage":"produced zero addresses","messagePattern":"produced zero addresses","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"balancer/pickfirst/pickfirst.go","lineNumber":219,"sourceCode":"\t\treturn\n\t}\n\n\tb.updateBalancerState(balancer.State{\n\t\tConnectivityState: connectivity.TransientFailure,\n\t\tPicker:            &picker{err: fmt.Errorf(\"name resolver error: %v\", err)},\n\t})\n}\n\nfunc (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState) error {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\tb.cancelConnectionTimer()\n\tif len(state.ResolverState.Addresses) == 0 && len(state.ResolverState.Endpoints) == 0 {\n\t\t// Cleanup state pertaining to the previous resolver state.\n\t\t// Treat an empty address list like an error by calling b.ResolverError.\n\t\tb.closeSubConnsLocked()\n\t\tb.addressList.updateAddrs(nil)\n\t\tb.resolverErrorLocked(errors.New(\"produced zero addresses\"))\n\t\treturn balancer.ErrBadResolverState\n\t}\n\tb.healthCheckingEnabled = state.ResolverState.Attributes.Value(enableHealthListenerKeyType{}) != nil\n\tcfg, ok := state.BalancerConfig.(pfConfig)\n\tif state.BalancerConfig != nil && !ok {\n\t\treturn fmt.Errorf(\"pickfirst: received illegal BalancerConfig (type %T): %v: %w\", state.BalancerConfig, state.BalancerConfig, balancer.ErrBadResolverState)\n\t}\n\n\tif b.logger.V(2) {\n\t\tb.logger.Infof(\"Received new config %s, resolver state %s\", pretty.ToJSON(cfg), pretty.ToJSON(state.ResolverState))\n\t}\n\n\tvar newAddrs []resolver.Address\n\tif endpoints := state.ResolverState.Endpoints; len(endpoints) != 0 {\n\t\t// Perform the optional shuffling described in gRFC A62. The shuffling\n\t\t// will change the order of endpoints but not touch the order of the\n\t\t// addresses within each endpoint. - A61\n\t\tif cfg.ShuffleAddressList {","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/grpc/grpc-go/blob/0c51461d27177d997e14c642fe18c11668fc09a3/balancer/pickfirst/pickfirst.go#L201-L237","documentation":"Thrown when the *anypb.Any for the Router filter fails to unmarshal into *pb.Router. The payload bytes do not form a valid Router proto — either the type_url is wrong, the bytes are corrupt, or there is a go-control-plane schema version mismatch between the control plane and grpc-go.","triggerScenarios":"The Any's type_url does not match type.googleapis.com/envoy.extensions.filters.http.router.v3.Router, or the serialized bytes correspond to a different proto version of Router. A DiscoveryResponse with a corrupt or truncated filter config payload. A control plane using a newer Router proto with unknown fields that fail strict unmarshalling.","commonSituations":"Control plane upgraded go-control-plane to a version with breaking proto changes without upgrading grpc-go. A hand-crafted LDS resource with a copy-paste type_url from a different filter. Network-level corruption of the xDS DiscoveryResponse.","solutions":["Confirm the Any type_url is type.googleapis.com/envoy.extensions.filters.http.router.v3.Router and the payload is a valid (possibly empty) Router message.","Align go-control-plane versions between the control plane and the grpc-go data plane.","Decode the Any payload with protoc --decode_raw or grpcurl to inspect the actual bytes, and fix the control-plane serialization."],"exampleFix":"// before: wrong type_url in the Any\nany := &anypb.Any{\n    TypeUrl: \"type.googleapis.com/envoy.extensions.filters.http.router.v3.RouterConfig\",\n    Value:   rawBytes,\n}\n\n// after:\nany, _ := anypb.New(&pb.Router{})  // correct type_url auto-set","handlingStrategy":"validation","validationCode":"// Validate the Router filter Any before parsing:\nfunc validateRouterAny(any *anypb.Any) error {\n    expected := \"type.googleapis.com/envoy.extensions.filters.http.router.v3.Router\"\n    if any.TypeUrl != expected {\n        return fmt.Errorf(\"router type_url mismatch: want %s, got %s\", expected, any.TypeUrl)\n    }\n    msg := new(pb.Router)\n    return any.UnmarshalTo(msg)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use anypb.New(&pb.Router{}) which auto-sets the correct type_url.","Align go-control-plane versions between control plane and grpc-go.","Run integration tests that verify the full LDS -> filter build pipeline with the actual control plane output."],"tags":["xds","router","grpc","proto","serialization"],"backgroundTag":null,"analyzedSha":"0c51461d27177d997e14c642fe18c11668fc09a3","analyzedAt":"2026-08-11T14:49:15.055Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}