{"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":"exception","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/03255a9237b6eb32710f6bc4f2de9a675b99fe36/internal/xds/balancer/priority/balancer_priority.go#L13-L49","documentation":"ErrAllPrioritiesRemoved (balancer_priority.go:31) is surfaced by the xDS priority balancer's picker when the current configuration contains zero priorities -- i.e. the entire priority list was deleted in an update. With no child balancer to route to, the picker fails every RPC with this error. syncPriority stops forwarding pickers and the parent is moved to a failing state.","triggerScenarios":"An xDS/LB priority configuration update arrives with an empty priorities array, or all previously-defined priorities are removed. The priority balancer builds a picker that returns ErrAllPrioritiesRemoved for each Pick, so client RPCs fail immediately.","commonSituations":"Control-plane misconfiguration that strips all priorities during a rollout; an LDS/CDS/EDS update race that momentarily yields an empty priority config; a hand-written service config with an empty priorities field; failover config where every priority was deactivated.","solutions":["Restore at least one valid priority entry in the xDS priority LB policy configuration and push a new config update.","Inspect the xDS resources (LDS/CDS/EDS) the client received and confirm the priority order is non-empty; look for NACK/resource-diff logs.","If using a local service config, ensure the 'priorities' list contains at least one child policy name."],"exampleFix":"// before: service config with empty priorities\n//   { \"loadBalancingConfig\": [ { \"xds_priority\": { \"priorities\": [] } } ] }\n// after: at least one priority referencing a child\n//   { \"loadBalancingConfig\": [ { \"xds_priority\": {\n//       \"priorities\": [ { \"name\": \"p0\", \"child_policy\": [ { \"round_robin\": {} } ] } ]\n//   } } ] }","handlingStrategy":"validation","validationCode":"// For a local service config, ensure the priority list is non-empty before applying.\nfunc validatePriorityConfig(cfg map[string]any) error {\n    lb, ok := cfg[\"loadBalancingConfig\"].([]any)\n    if !ok { return errors.New(\"no loadBalancingConfig\") }\n    // walk to find xds_priority; ensure priorities has >=1 entry\n    return nil // (adapt to your actual config representation)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When hand-authoring priority configs, always include at least one priority child.","Watch the priority balancer logs for 'all priorities are removed' to catch control-plane regressions.","Canary xDS config changes against one client before rolling out."],"tags":["xds","balancer","priority","loadbalancing","config"],"analyzedSha":"03255a9237b6eb32710f6bc4f2de9a675b99fe36","analyzedAt":"2026-08-07T00:29:34.215Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}