grpc/grpc-go · error · ErrAllPrioritiesRemoved

no priority is provided, all priorities are removed

Error message

no priority is provided, all priorities are removed

What it means

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.

Source

Thrown at internal/xds/balancer/priority/balancer_priority.go:31

 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package priority

import (
	"errors"
	"time"

	"google.golang.org/grpc/balancer"
	"google.golang.org/grpc/connectivity"
)

var (
	// ErrAllPrioritiesRemoved is returned by the picker when there's no priority available.
	ErrAllPrioritiesRemoved = errors.New("no priority is provided, all priorities are removed")
	// DefaultPriorityInitTimeout is the timeout after which if a priority is
	// not READY, the next will be started. It's exported to be overridden by
	// tests.
	DefaultPriorityInitTimeout = 10 * time.Second
)

// syncPriority handles priority after a config update or a child balancer
// connectivity state update. It makes sure the balancer state (started or not)
// is in sync with the priorities (even in tricky cases where a child is moved
// from a priority to another).
//
// It's guaranteed that after this function returns:
//
//	If some child is READY, it is childInUse, and all lower priorities are
//	closed.
//
//	If some child is newly started(in Connecting for the first time), it is
//	childInUse, and all lower priorities are closed.

View on GitHub (pinned to 03255a9237)

Solutions

  1. Restore at least one valid priority entry in the xDS priority LB policy configuration and push a new config update.
  2. Inspect the xDS resources (LDS/CDS/EDS) the client received and confirm the priority order is non-empty; look for NACK/resource-diff logs.
  3. If using a local service config, ensure the 'priorities' list contains at least one child policy name.

Example fix

// before: service config with empty priorities
//   { "loadBalancingConfig": [ { "xds_priority": { "priorities": [] } } ] }
// after: at least one priority referencing a child
//   { "loadBalancingConfig": [ { "xds_priority": {
//       "priorities": [ { "name": "p0", "child_policy": [ { "round_robin": {} } ] } ]
//   } } ] }
Defensive patterns

Strategy: validation

Validate before calling

// For a local service config, ensure the priority list is non-empty before applying.
func validatePriorityConfig(cfg map[string]any) error {
    lb, ok := cfg["loadBalancingConfig"].([]any)
    if !ok { return errors.New("no loadBalancingConfig") }
    // walk to find xds_priority; ensure priorities has >=1 entry
    return nil // (adapt to your actual config representation)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of grpc/grpc-go@03255a9237 (2026-08-07). Data as JSON: /api/errors/3af1874236698b21. Report an issue: GitHub.