ELBNOTFOUND grpc config_error ai_generated true

UNAVAILABLE: grpc: load balancing policy "round_robin" not found

ID: grpc/load-balancing-policy-not-found

Also available as: JSON · Markdown · 中文
95%Fix Rate
90%Confidence
1Evidence
2024-02-05First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
gRPC v1.57.0 active
gRPC v1.61.0 active
gRPC v1.66.0 active

Root Cause

The specified load balancing policy is not registered in the gRPC client, often because the corresponding resolver plugin is missing or the policy name is misspelled.

generic

中文

指定的负载均衡策略未在 gRPC 客户端中注册,通常是因为缺少相应的解析器插件或策略名称拼写错误。

Official Documentation

https://grpc.io/docs/guides/load-balancing/

Workarounds

  1. 95% success Register the 'round_robin' policy by importing the load balancer plugin: `import grpc.experimental; grpc.experimental.register_load_balancer('round_robin', grpc.experimental.RoundRobinLoadBalancer)`
    Register the 'round_robin' policy by importing the load balancer plugin: `import grpc.experimental; grpc.experimental.register_load_balancer('round_robin', grpc.experimental.RoundRobinLoadBalancer)`
  2. 90% success Use a built-in policy like 'pick_first' (default) by removing the custom LB policy from the client configuration: `channel = grpc.insecure_channel(target)`
    Use a built-in policy like 'pick_first' (default) by removing the custom LB policy from the client configuration: `channel = grpc.insecure_channel(target)`
  3. 85% success If using a service config, ensure the policy name matches exactly (case-sensitive) and is supported by the gRPC version, e.g., `{"loadBalancingConfig": [{"round_robin": {}}]}`.
    If using a service config, ensure the policy name matches exactly (case-sensitive) and is supported by the gRPC version, e.g., `{"loadBalancingConfig": [{"round_robin": {}}]}`.

中文步骤

  1. Register the 'round_robin' policy by importing the load balancer plugin: `import grpc.experimental; grpc.experimental.register_load_balancer('round_robin', grpc.experimental.RoundRobinLoadBalancer)`
  2. Use a built-in policy like 'pick_first' (default) by removing the custom LB policy from the client configuration: `channel = grpc.insecure_channel(target)`
  3. If using a service config, ensure the policy name matches exactly (case-sensitive) and is supported by the gRPC version, e.g., `{"loadBalancingConfig": [{"round_robin": {}}]}`.

Dead Ends

Common approaches that don't work:

  1. Changing the target URI to use a different scheme like 'dns://'. 85% fail

    The error is about the load balancing policy, not the resolver scheme; changing the scheme does not register the policy.

  2. Setting the environment variable GRPC_LB_POLICY to a random string. 95% fail

    Environment variables do not register custom policies; they only configure built-in ones.

  3. Reinstalling the gRPC package without updating the policy registration code. 90% fail

    The policy must be explicitly imported or registered in code; reinstalling does not add missing plugins.