{"record":{"id":"24b96564a6db768f","repo":"weaviate/weaviate","slug":"aggregate-w","errorCode":null,"errorMessage":"aggregate: %w","messagePattern":"aggregate: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/handlers/grpc/v1/service.go","lineNumber":124,"sourceCode":"\tif req.Collection, _, err = namespacing.Resolve(principal, s.schemaManager, s.config.Namespaces.Enabled, req.Collection); err != nil {\n\t\treturn nil, err\n\t}\n\n\tgetClass := s.classGetterWithAuthzFunc(ctx, principal, req.Tenant)\n\tparser := NewAggregateParser(\n\t\tgetClass,\n\t\ts.config.Namespaces.Enabled,\n\t\tprincipal,\n\t)\n\n\tparams, err := parser.Aggregate(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parse params: %w\", err)\n\t}\n\n\tres, err := s.traverser.Aggregate(restCtx.AddPrincipalToContext(ctx, principal), principal, params)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"aggregate: %w\", err)\n\t}\n\n\treplier := NewAggregateReplier(\n\t\tprincipal,\n\t\tgetClass,\n\t\tparams,\n\t)\n\treply, err = replier.Aggregate(res, params.GroupBy != nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"prepare reply: %w\", err)\n\t}\n\n\treply.Took = float32(time.Since(before).Seconds())\n\treturn reply, nil\n}\n\nfunc (s *Service) TenantsGet(ctx context.Context, req *pb.TenantsGetRequest) (reply *pb.TenantsGetReply, retErr error) {\n\tbefore := time.Now()","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/handlers/grpc/v1/service.go#L106-L142","documentation":"The underlying traverser.Aggregate() call failed after params parsed successfully. This wraps any error from the aggregation execution pipeline (shard access, permission checks, index errors, timeout) and marks it as originating from the aggregate stage of the gRPC Aggregate RPC.","triggerScenarios":"Calling the gRPC Aggregate RPC when the traverser fails: collection deleted concurrently, shard unavailable/unhealthy, authorization denied inside traversal, context cancelled/timeout, or internal aggregation errors on remote shards.","commonSituations":"Cluster node down or shard still migrating; RBAC principal lacks aggregate permission; aggregation timeout on very large collections; client cancelled the RPC mid-query.","solutions":["Inspect the wrapped error to determine the traversal-stage cause","Verify cluster health and that all shards of the collection are available","Check the principal's authorization for the aggregate action on the collection","Retry with backoff on transient shard/timeout errors; increase server timeout for large collections"],"exampleFix":"// before: no deadline, giant aggregation times out\nres, err := client.Aggregate(ctx, req)\n// after: bounded deadline and retry on transient errors\nctx, cancel := context.WithTimeout(ctx, 30*time.Second)\ndefer cancel()\nres, err := client.Aggregate(ctx, req)","handlingStrategy":"retry","validationCode":"if !clusterHealthy() { return errors.New(\"cluster unhealthy; defer aggregation\") }","typeGuard":null,"tryCatchPattern":"res, err := client.Aggregate(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"aggregate:\") {\n  return retryWithBackoff(func() error { _, err := client.Aggregate(ctx, req); return err })\n}","preventionTips":["Set explicit deadlines on aggregation calls","Monitor shard/replica health before large aggregations","Verify principal has aggregate permissions in your RBAC policy"],"tags":["grpc","aggregation","query-execution"],"backgroundTag":"grpc-query-execution-failed","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}