{"record":{"id":"3af1874236698b21","repo":"grpc/grpc-go","slug":"no-priority-is-provided-all-priorities-are-remove","errorCode":null,"errorMessage":"no priority is provided, all priorities are removed","messagePattern":"no priority is provided, all priorities are removed","errorType":"validation","errorClass":"ErrAllPrioritiesRemoved","httpStatus":null,"severity":"error","filePath":"internal/xds/balancer/priority/balancer_priority.go","lineNumber":31,"sourceCode":" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\npackage priority\n\nimport (\n\t\"errors\"\n\t\"time\"\n\n\t\"google.golang.org/grpc/balancer\"\n\t\"google.golang.org/grpc/connectivity\"\n)\n\nvar (\n\t// ErrAllPrioritiesRemoved is returned by the picker when there's no priority available.\n\tErrAllPrioritiesRemoved = errors.New(\"no priority is provided, all priorities are removed\")\n\t// DefaultPriorityInitTimeout is the timeout after which if a priority is\n\t// not READY, the next will be started. It's exported to be overridden by\n\t// tests.\n\tDefaultPriorityInitTimeout = 10 * time.Second\n)\n\n// syncPriority handles priority after a config update or a child balancer\n// connectivity state update. It makes sure the balancer state (started or not)\n// is in sync with the priorities (even in tricky cases where a child is moved\n// from a priority to another).\n//\n// It's guaranteed that after this function returns:\n//\n//\tIf some child is READY, it is childInUse, and all lower priorities are\n//\tclosed.\n//\n//\tIf some child is newly started(in Connecting for the first time), it is\n//\tchildInUse, and all lower priorities are closed.","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/grpc/grpc-go/blob/0c51461d27177d997e14c642fe18c11668fc09a3/internal/xds/balancer/priority/balancer_priority.go#L13-L49","documentation":"ErrAllPrioritiesRemoved is returned by the priority load balancer's picker when an xDS config update results in zero priorities. The priority LB policy (used in xDS for failover ordering) requires at least one priority; if a config update removes all of them, it sets the gRPC channel to TransientFailure with this error picker, causing all RPCs to fail immediately.","triggerScenarios":"An xDS CDS/EDS or LB policy config update that produces an empty priorities list. The balancer at balancer.go:182-187 detects len(b.priorities)==0, sets childInUse to empty, and pushes a TransientFailure state with NewErrPicker(ErrAllPrioritiesRemoved). Any RPC attempt picks this error.","commonSituations":"xDS management server sends a Cluster resource update that removes all localities/endpoints; a failover configuration where all priority levels are deleted; control plane bug or partial config push that zeroes the priority list; transient state during xDS resource deletion before re-adding.","solutions":["Check the xDS CDS/LB policy configuration to ensure at least one priority/locality is configured.","If using failover priorities, verify the primary and all fallback priorities are present in the config.","Inspect the xDS config dump (istioctl proxy-config cluster) for empty or missing priority lists.","Wait for the next xDS update that restores priorities, or rollback the config change."],"exampleFix":"// On the xDS management server, ensure the cluster LB policy has priorities.\n// before: config with empty priorities (all removed)\n// after (Istio DestinationRule with localityLbSetting):\ntrafficPolicy:\n  loadBalancer:\n    simple: ROUND_ROBIN\n  localityLbSetting:\n    enabled: true\n    distribute:\n    - from: region/zone/*\n      to:\n        \"region/zone1/*\": 100  # <-- at least one priority","handlingStrategy":"validation","validationCode":"// Validate xDS priority config has at least one priority.\n// On the control plane, ensure the LB policy config includes priorities.\n// Check via:\n//   istioctl proxy-config cluster <pod> -o json | jq '.. | .priorities?'\n// Ensure the output is non-empty.","typeGuard":null,"tryCatchPattern":"// RPCs fail with this error when all priorities are removed.\n// This is a config error; retry after config is fixed.\nerr := client.Call(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"all priorities are removed\") {\n    log.Error(\"xDS priority config is empty; check management server CDS/LB policy\")\n}","preventionTips":["Ensure xDS cluster/LB policy config always has at least one priority/locality.","Validate xDS config completeness before pushing (use istioctl analyze).","Monitor for xDS config updates that produce empty priority lists.","Keep fallback cluster configurations to avoid total outage during config transitions."],"tags":["xds","load-balancer","priority","failover","grpc","config"],"backgroundTag":null,"analyzedSha":"0c51461d27177d997e14c642fe18c11668fc09a3","analyzedAt":"2026-08-11T14:49:15.055Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}