{"record":{"id":"a5aa492bde11b438","repo":"weaviate/weaviate","slug":"prop-q-malformed-count-in-remote-shard-result","errorCode":null,"errorMessage":"prop %q: malformed count in remote shard result","messagePattern":"prop %q: malformed count in remote shard result","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/aggregator/shard_combiner.go","lineNumber":189,"sourceCode":"\t\t\t}\n\t\t\tif err := requirePairsForModeMedian(name, aggs, len(agg.pairs)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\taggs[\"_dateAggregator\"] = agg\n\t\t}\n\t}\n\n\tswitch count := aggs[\"count\"].(type) {\n\tcase nil, int64:\n\t\t// absent, or a local shard result: nothing to restore\n\tcase float64:\n\t\trestored, err := wireCount(count)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"prop %q: %w\", name, err)\n\t\t}\n\t\taggs[\"count\"] = int64(restored)\n\tdefault:\n\t\treturn fmt.Errorf(\"prop %q: malformed count in remote shard result\", name)\n\t}\n\treturn nil\n}\n\n// requirePairsForModeMedian rejects wire state that carries a mode or median\n// result but no distribution to recompute it from during the merge.\nfunc requirePairsForModeMedian(name string, aggs map[string]interface{}, numPairs int) error {\n\tif numPairs > 0 {\n\t\treturn nil\n\t}\n\t_, hasMode := aggs[\"mode\"]\n\t_, hasMedian := aggs[\"median\"]\n\tif hasMode || hasMedian {\n\t\treturn fmt.Errorf(\"prop %q: mode/median aggregation without value pairs in remote shard result\", name)\n\t}\n\treturn nil\n}\n","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/aggregator/shard_combiner.go#L171-L207","documentation":"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.","triggerScenarios":"Thrown at adapters/repos/db/aggregator/shard_combiner.go:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify peer versions and aggregation wire format","Retry the aggregation","Report the property if reproducible"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}