weaviate/weaviate · error
identify groups
Error message
identify groups
What it means
groupedAggregator.Do wraps failures from identifyGroups, the phase that scans the shard(s) and partitions document IDs into groups by the GroupBy property value. Any error during that scan (store read failure, object unmarshal failure, grouper error such as 'group all (unfiltered)') is re-wrapped with this message. The aggregation aborted before any group-level aggregation ran.
Source
Thrown at adapters/repos/db/aggregator/grouped.go:38
// groupedAggregator performs aggregation in groups. This is a two-step
// process. First a whole-db scan is performed to identify the groups, then
// the top-n groups are selected (the rest is discarded). Only for those top
// groups an actual aggregation is performed
type groupedAggregator struct {
*Aggregator
}
func newGroupedAggregator(agg *Aggregator) *groupedAggregator {
return &groupedAggregator{Aggregator: agg}
}
func (ga *groupedAggregator) Do(ctx context.Context) (*aggregation.Result, error) {
out := aggregation.Result{}
groups, err := ga.identifyGroups(ctx)
if err != nil {
return nil, errors.Wrap(err, "identify groups")
}
out.Groups = make([]aggregation.Group, len(groups))
for i, g := range groups {
res, err := ga.aggregateGroup(ctx, g.res, g.docIDs)
if err != nil {
return nil, errors.Wrapf(err, "aggregate group %d (%v)", i,
g.res.GroupedBy.Value)
}
out.Groups[i] = res
}
return &out, nil
}
// group is a helper construct that contains the final aggregation.Group which
// will eventually be served to the user. But it also contains the list of
// docIDs in that group, so we can use those to perform the actual aggregationView on GitHub (pinned to 75aa4b6d11)
Solutions
- Inspect the wrapped inner error (this message is only a wrapper) to find the root cause
- Verify shard integrity; restore from backup if object corruption is reported
- Retry the aggregation if the cause was transient (disk/context timeout)
- Validate the groupBy property name and type against the schema
Defensive patterns
Strategy: try-catch
Try / catch
res, err := ga.Do(ctx)
if err != nil {
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
// increase timeout / reissue query
return retryWithLongerTimeout(ctx)
}
return fmt.Errorf("grouped aggregation failed: %w", err)
} Prevention
- Set generous timeouts for grouped aggregations on large collections
- Monitor shard disk health to avoid scan failures
- Validate the groupBy property exists in the schema before querying
When it happens
Trigger: Executing a grouped aggregation (groupBy parameter) where the underlying LSM scan or object decoding fails: corrupt objects, disk I/O errors, invalid GroupBy property, or context cancellation during the scan.
Common situations: Corrupted object data in a shard after a crash; groupBy on a property that cannot be extracted; disk errors; a query cancelled client-side that surfaces mid-scan.
Related errors
- aggregate group %d (%v)
- aggregate properties
- no groups found in aggregate result
- read bool: empty value
- date aggregator state missing from remote shard result, the
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/a68dd524e9413969.
Report an issue: GitHub.