weaviate/weaviate · error
nearAudio.targetVectors cannot provide more than 1 target ve
Error message
nearAudio.targetVectors cannot provide more than 1 target vector value
What it means
Weaviate's nearAudio GraphQL/media argument validator rejects the request when the targetVectors array contains more than one entry. nearAudio performs similarity search against a single audio vector, so multiple target vectors are meaningless; the validator (validateNearAudioFn in usecases/modulecomponents/arguments/nearAudio/param.go) fails fast before the search is executed. This is a client request-shape error, not a server fault.
Source
Thrown at usecases/modulecomponents/arguments/nearAudio/param.go:58
}
func validateNearAudioFn(param interface{}) error {
nearAudio, ok := param.(*NearAudioParams)
if !ok {
return errors.New("'nearAudio' invalid parameter")
}
if len(nearAudio.Audio) == 0 {
return errors.New("'nearAudio.audio' needs to be defined")
}
if nearAudio.Certainty != 0 && nearAudio.WithDistance {
return errors.New(
"nearAudio cannot provide both distance and certainty")
}
if len(nearAudio.TargetVectors) > 1 {
return errors.New(
"nearAudio.targetVectors cannot provide more than 1 target vector value")
}
return nil
}
View on GitHub (pinned to 75aa4b6d11)
Solutions
- Pass at most one vector name in nearAudio.targetVectors
- If you need to search multiple named vectors, issue one nearAudio query per vector instead of one query with several targets
- Omit targetVectors entirely to use the collection's default vector
Example fix
// before
nearAudio: { audio: "base64...", targetVectors: ["default", "custom"] }
// after
nearAudio: { audio: "base64...", targetVectors: ["default"] } Defensive patterns
Strategy: validation
Validate before calling
if (Array.isArray(args.nearAudio?.targetVectors) && args.nearAudio.targetVectors.length > 1) {
throw new Error("nearAudio.targetVectors allows at most 1 entry");
} Type guard
function hasAtMostOneTargetVector(clause) {
return !Array.isArray(clause.targetVectors) || clause.targetVectors.length <= 1;
} Prevention
- Never emit more than one entry in near* targetVectors arrays
- Build queries through a typed helper that enforces single-target semantics
- Omit targetVectors when using the default vector
When it happens
Trigger: Sending a GraphQL nearAudio query whose targetVectors argument is an array with 2+ names, e.g. targetVectors: ["vecA","vecB"]. Called via validateNearAudioFn during argument extraction.
Common situations: Copy-pasting a multi-vector nearText pattern into a nearAudio query; misunderstanding that targetVectors selects one named vector per search; scripting query generation that always emits a targetVectors list.
Related errors
- 'nearAudio.audio' needs to be defined
- nearAudio cannot provide both distance and certainty
- no properties provided
- 'nearAudio' invalid parameter
- 'nearDepth.depth' needs to be defined
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/443fe54ccc09cadf.
Report an issue: GitHub.