weaviate/weaviate · error

drop-vector-index payload missing collection

Error message

drop-vector-index payload missing collection

What it means

After unmarshaling, decodeDropVectorIndexPayload requires p.Collection to be non-empty; a drop-vector task without a target collection is meaningless and would otherwise trigger unsafe cross-collection matching, so it is rejected at decode time.

Source

Thrown at adapters/repos/db/drop_vector_index_payload.go:443

}

func (p *DropVectorIndexTaskPayload) encode() ([]byte, error) {
	return json.Marshal(p)
}

// DecodeDropVectorIndexTaskPayload decodes and validates a drop-vector task
// payload; the single decode path for out-of-package callers (REST enqueuer).
func DecodeDropVectorIndexTaskPayload(data []byte) (*DropVectorIndexTaskPayload, error) {
	return decodeDropVectorIndexPayload(data)
}

func decodeDropVectorIndexPayload(data []byte) (*DropVectorIndexTaskPayload, error) {
	var p DropVectorIndexTaskPayload
	if err := json.Unmarshal(data, &p); err != nil {
		return nil, fmt.Errorf("unmarshal drop-vector-index payload: %w", err)
	}
	if p.Collection == "" {
		return nil, fmt.Errorf("drop-vector-index payload missing collection")
	}
	if len(p.Targets) == 0 {
		return nil, fmt.Errorf("drop-vector-index payload missing targets")
	}
	for _, t := range p.Targets {
		// Targets are filepath.Joined and os.RemoveAll'd by removeVectorIndexFiles;
		// reject empty / separators / ".." so a target can't escape the shard dir.
		if t == "" || strings.ContainsAny(t, `/\`) || strings.Contains(t, "..") {
			return nil, fmt.Errorf("drop-vector-index payload has an invalid target name %q", t)
		}
	}
	if p.OpID == "" {
		return nil, fmt.Errorf("drop-vector-index payload missing opId")
	}
	return &p, nil
}

// ExtractDropVectorIndexTaskTargets is the target extractor registered with

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Fix the producer to set Collection in DropVectorIndexTaskPayload before enqueue
  2. Delete and re-enqueue the malformed task via reconciliation
  3. Add a pre-enqueue validation that Collection != ""
  4. Check the code path that serialized the payload for field omission

Example fix

// before
payload := DropVectorIndexTaskPayload{Targets: []string{"vec_a"}}
// after
payload := DropVectorIndexTaskPayload{Collection: "Article", Targets: []string{"vec_a"}}
Defensive patterns

Strategy: validation

Validate before calling

if payload.Collection == "" {
    return fmt.Errorf("refusing to enqueue: collection is required")
}
if len(payload.Targets) == 0 {
    return fmt.Errorf("refusing to enqueue: at least one target required")
}

Type guard

func (p DropVectorIndexTaskPayload) Valid() bool {
    return p.Collection != "" && len(p.Targets) > 0
}

Try / catch

if _, err := decodeDropVectorIndexPayload(raw); err != nil {
    if strings.Contains(err.Error(), "missing collection") {
        // rebuild the payload with the collection set and re-enqueue
    }
}

Prevention

When it happens

Trigger: Enqueuing or replaying a drop-vector task whose payload was built without setting Collection — a producer bug, hand-crafted payload, or partial JSON missing the collection field.

Common situations: Custom tooling that constructs drop-vector task payloads; version skew where an older producer omitted a now-required field; truncated JSON that zero-valued the struct.

Related errors


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