weaviate/weaviate · error

marshal object %q: %w

Error message

marshal object %q: %w

What it means

Wrapped error from Replicas.MarshalBinary when an individual replica's storobj.Object fails binary serialization during a Replicas batch encode (used in replication transports). The failing object's ID is included; the underlying storobj error is chained.

Source

Thrown at usecases/replica/replica.go:96

	return nil
}

type Replicas []Replica

func (ro Replicas) MarshalBinary() ([]byte, error) {
	ms := make([]robjectMarshaler, len(ro))

	for i, obj := range ro {
		m := robjectMarshaler{
			ID:                      obj.ID,
			Deleted:                 obj.Deleted,
			LastUpdateTimeUnixMilli: obj.LastUpdateTimeUnixMilli,
		}
		if obj.Object != nil {
			b, err := obj.Object.MarshalBinary()
			if err != nil {
				return nil, fmt.Errorf("marshal object %q: %w", obj.ID, err)
			}
			m.Object = b
		}
		ms[i] = m
	}

	return json.Marshal(ms)
}

func (ro *Replicas) UnmarshalBinary(data []byte) error {
	var ms []robjectMarshaler

	err := json.Unmarshal(data, &ms)
	if err != nil {
		return err
	}

	reps := make(Replicas, len(ms))

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Inspect the wrapped error to see which part of the object failed to serialize
  2. Check for unsupported property types or oversized payloads on the named object
  3. Verify schema/object version compatibility between sender and receiver
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at usecases/replica/replica.go:96 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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