{"record":{"id":"17841183d3a72b71","repo":"weaviate/weaviate","slug":"marshal-request-payload","errorCode":null,"errorMessage":"marshal request payload","messagePattern":"marshal request payload","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/clients/remote_index.go","lineNumber":464,"sourceCode":"\t\tfmt.Sprintf(\"/indices/%s/shards/%s/objects/_aggregations\", index, shard),\n\t\t\"\", bytes.NewReader(body))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create http request: %w\", err)\n\t}\n\tclusterapi.IndicesPayloads.AggregationParams.SetContentTypeHeaderReq(req)\n\n\t// send request\n\tresp := &aggregateResp{}\n\terr = c.doWithCustomMarshaller(c.timeoutUnit*QUERY_TIMEOUT_VALUE, req, body, resp.decode, successCode, MAX_RETRIES)\n\treturn resp.Result, err\n}\n\nfunc (c *RemoteIndex) FindUUIDs(ctx context.Context, hostName, indexName,\n\tshardName string, filters *filters.LocalFilter, limit int,\n) ([]strfmt.UUID, error) {\n\tparamsBytes, err := clusterapi.IndicesPayloads.FindUUIDsParams.Marshal(filters, limit)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"marshal request payload\")\n\t}\n\treq, err := setupRequest(ctx, http.MethodPost, hostName,\n\t\tfmt.Sprintf(\"/indices/%s/shards/%s/objects/_find\", indexName, shardName),\n\t\t\"\", bytes.NewReader(paramsBytes))\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"open http request\")\n\t}\n\n\tclusterapi.IndicesPayloads.FindUUIDsParams.SetContentTypeHeaderReq(req)\n\tres, err := c.client.Do(req)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"send http request\")\n\t}\n\n\tdefer res.Body.Close()\n\tif res.StatusCode != http.StatusOK {\n\t\tbody, _ := io.ReadAll(res.Body)\n\t\treturn nil, errors.Errorf(\"unexpected status code %d (%s)\", res.StatusCode,","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/clients/remote_index.go#L446-L482","documentation":"RemoteIndex.FindUUIDs builds a filtered-object lookup request by marshaling the LocalFilter and limit through clusterapi.IndicesPayloads.FindUUIDsParams.Marshal. This error wraps any failure of that marshaling step. It means the request could not even be serialized — no HTTP call was made — typically due to an unsupported or malformed filter structure.","triggerScenarios":"Calling FindUUIDs (e.g. during classification or filter-based remote scans) with a LocalFilter containing values, operators, or nested structures that the clusterapi FindUUIDsParams encoder cannot serialize (e.g. unencodable filter value types).","commonSituations":"Programmatically constructed filters with unusual operand types; a filter built by a newer client/feature not representable in the internal payload schema; nil or inconsistent filter trees passed down from upper layers.","solutions":["Inspect the wrapped inner error to identify which filter value/field failed to encode.","Simplify or normalize the LocalFilter (valid operators, encodable operand values) before calling FindUUIDs.","Check that the filter originates from a supported API path rather than hand-constructed internals.","Verify cluster/client versions match so the payload schema supports the filter features used."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Sanity-check the filter before handing it to remote lookups\nif filters == nil {\n    return errors.New(\"FindUUIDs requires a non-nil LocalFilter\")\n}\nif limit <= 0 {\n    return fmt.Errorf(\"FindUUIDs limit must be > 0, got %d\", limit)\n}","typeGuard":null,"tryCatchPattern":"uuids, err := idx.FindUUIDs(ctx, host, index, shard, filter, limit)\nif err != nil && strings.Contains(err.Error(), \"marshal request payload\") {\n    // filter is not encodable — do not retry, fix the filter construction\n    return nil, fmt.Errorf(\"filter not serializable for remote lookup: %w\", err)\n}","preventionTips":["Build filters only through supported schema/filter APIs, never hand-assembled filter trees","Validate operand value types against supported clusterapi payload encodings","Test new filter features end-to-end against the same version deployed in the cluster","Log the inner wrapped error — it names the exact field that failed to encode"],"tags":["serialization","filters","cluster-api"],"backgroundTag":"marshal-request-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"}