weaviate/weaviate · error

prop %q: malformed count in remote shard result

Error message

prop %q: malformed count in remote shard result

What it means

Validation error in restoreDateAggregations: the 'count' entry in a remote shard's result is neither absent, int64 (local result), nor float64 (JSON wire form) — some other Go type, meaning the peer sent a malformed count. Caught by a type switch so that corrupt wire data fails loudly instead of producing a wrong aggregated count.

Source

Thrown at adapters/repos/db/aggregator/shard_combiner.go:189

			}
			if err := requirePairsForModeMedian(name, aggs, len(agg.pairs)); err != nil {
				return err
			}
			aggs["_dateAggregator"] = agg
		}
	}

	switch count := aggs["count"].(type) {
	case nil, int64:
		// absent, or a local shard result: nothing to restore
	case float64:
		restored, err := wireCount(count)
		if err != nil {
			return fmt.Errorf("prop %q: %w", name, err)
		}
		aggs["count"] = int64(restored)
	default:
		return fmt.Errorf("prop %q: malformed count in remote shard result", name)
	}
	return nil
}

// requirePairsForModeMedian rejects wire state that carries a mode or median
// result but no distribution to recompute it from during the merge.
func requirePairsForModeMedian(name string, aggs map[string]interface{}, numPairs int) error {
	if numPairs > 0 {
		return nil
	}
	_, hasMode := aggs["mode"]
	_, hasMedian := aggs["median"]
	if hasMode || hasMedian {
		return fmt.Errorf("prop %q: mode/median aggregation without value pairs in remote shard result", name)
	}
	return nil
}

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Verify peer versions and aggregation wire format
  2. Retry the aggregation
  3. Report the property if reproducible
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at adapters/repos/db/aggregator/shard_combiner.go:189 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/a5aa492bde11b438. Report an issue: GitHub.