weaviate/weaviate · error

marshal request payload

Error message

marshal request payload

What it means

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.

Source

Thrown at adapters/clients/remote_index.go:464

		fmt.Sprintf("/indices/%s/shards/%s/objects/_aggregations", index, shard),
		"", bytes.NewReader(body))
	if err != nil {
		return nil, fmt.Errorf("create http request: %w", err)
	}
	clusterapi.IndicesPayloads.AggregationParams.SetContentTypeHeaderReq(req)

	// send request
	resp := &aggregateResp{}
	err = c.doWithCustomMarshaller(c.timeoutUnit*QUERY_TIMEOUT_VALUE, req, body, resp.decode, successCode, MAX_RETRIES)
	return resp.Result, err
}

func (c *RemoteIndex) FindUUIDs(ctx context.Context, hostName, indexName,
	shardName string, filters *filters.LocalFilter, limit int,
) ([]strfmt.UUID, error) {
	paramsBytes, err := clusterapi.IndicesPayloads.FindUUIDsParams.Marshal(filters, limit)
	if err != nil {
		return nil, errors.Wrap(err, "marshal request payload")
	}
	req, err := setupRequest(ctx, http.MethodPost, hostName,
		fmt.Sprintf("/indices/%s/shards/%s/objects/_find", indexName, shardName),
		"", bytes.NewReader(paramsBytes))
	if err != nil {
		return nil, errors.Wrap(err, "open http request")
	}

	clusterapi.IndicesPayloads.FindUUIDsParams.SetContentTypeHeaderReq(req)
	res, err := c.client.Do(req)
	if err != nil {
		return nil, errors.Wrap(err, "send http request")
	}

	defer res.Body.Close()
	if res.StatusCode != http.StatusOK {
		body, _ := io.ReadAll(res.Body)
		return nil, errors.Errorf("unexpected status code %d (%s)", res.StatusCode,

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Inspect the wrapped inner error to identify which filter value/field failed to encode.
  2. Simplify or normalize the LocalFilter (valid operators, encodable operand values) before calling FindUUIDs.
  3. Check that the filter originates from a supported API path rather than hand-constructed internals.
  4. Verify cluster/client versions match so the payload schema supports the filter features used.
Defensive patterns

Strategy: validation

Validate before calling

// Sanity-check the filter before handing it to remote lookups
if filters == nil {
    return errors.New("FindUUIDs requires a non-nil LocalFilter")
}
if limit <= 0 {
    return fmt.Errorf("FindUUIDs limit must be > 0, got %d", limit)
}

Try / catch

uuids, err := idx.FindUUIDs(ctx, host, index, shard, filter, limit)
if err != nil && strings.Contains(err.Error(), "marshal request payload") {
    // filter is not encodable — do not retry, fix the filter construction
    return nil, fmt.Errorf("filter not serializable for remote lookup: %w", err)
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


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