FlowiseAI/Flowise · error · Error
Error loading collection: ${loadResp}
Error message
Error loading collection: ${loadResp} What it means
After confirming the collection exists, the helper calls loadCollectionSync; if the response error_code is not SUCCESS, this error is thrown. Loading pulls the collection's data into memory for searching — it can fail on memory limits, schema issues, or server state.
Source
Thrown at packages/components/nodes/vectorstores/Milvus/Milvus.ts:359
collection_name: vectorStore.collectionName
})
if (hasColResp.status.error_code !== ErrorCode.SUCCESS) {
throw new Error(`Error checking collection: ${hasColResp}`)
}
if (hasColResp.value === false) {
throw new Error(`Collection not found: ${vectorStore.collectionName}, please create collection before search.`)
}
const filterStr = milvusFilter ?? filter ?? ''
await vectorStore.grabCollectionFields()
const loadResp = await vectorStore.client.loadCollectionSync({
collection_name: vectorStore.collectionName
})
if (loadResp.error_code !== ErrorCode.SUCCESS) {
throw new Error(`Error loading collection: ${loadResp}`)
}
const outputFields = vectorStore.fields.filter((field) => field !== vectorStore.vectorField)
const search_params: any = {
anns_field: vectorStore.vectorField,
topk: k.toString(),
metric_type: vectorStore.indexCreateParams.metric_type,
params: JSON.stringify(vectorStore.indexSearchParams)
}
const searchResp = await vectorStore.client.search({
collection_name: vectorStore.collectionName,
search_params,
output_fields: outputFields,
vector_type: DataType.FloatVector,
vectors: [query],
filter: filterStr
})View on GitHub (pinned to abe4a8601a)
Solutions
- Ensure a vector index is created on the collection before loading.
- Check Milvus query-node memory; scale up if collection exceeds available memory.
- Wait for any in-progress index build to finish before searching.
- Inspect loadResp.error_code/reason and address the specific failure.
Example fix
// before
if (loadResp.error_code !== ErrorCode.SUCCESS) {
throw new Error(`Error loading collection: ${loadResp}`)
}
// after
if (loadResp.error_code !== ErrorCode.SUCCESS) {
throw new Error(`Error loading collection ${vectorStore.collectionName}: ${loadResp.error_code} - ${loadResp.reason}`, { cause: loadResp })
} Defensive patterns
Strategy: validation
Validate before calling
const loaded = await vectorStore.client.getLoadState({ collection_name: vectorStore.collectionName })
if (loaded.state !== LoadState.LoadStateLoaded) {
// ensure index exists before loading
const idxInfo = await vectorStore.client.describeIndex({ collection_name: vectorStore.collectionName, field_name: vectorStore.vectorField })
if (!idxInfo.index_descriptions?.length) throw new Error('Build a vector index before load')
} Type guard
function isLoadFailure(r: unknown): r is { error_code: string | number; reason?: string } {
return typeof r === 'object' && r !== null && (r as any).error_code !== undefined && (r as any).error_code !== ErrorCode.SUCCESS
} Try / catch
try {
await vectorStore.client.loadCollectionSync({ collection_name: vectorStore.collectionName })
} catch (e) {
if (/memory|resource/i.test(String(e))) {
throw new Error('Insufficient memory to load collection — scale Milvus query nodes', { cause: e })
}
throw e
} Prevention
- Always build a vector index before loading a collection.
- Size query-node memory to exceed the collection's footprint.
- Wait for in-progress index builds to finish before searching.
When it happens
Trigger: Search path: collection exists, grabCollectionFields succeeds, then loadCollectionSync returns a non-SUCCESS error_code. Happens when the collection has no index, insufficient memory, or is in a bad state.
Common situations: Vector index not built before load, collection too large for query-node memory, concurrent load/unload races, or schema/index build still in progress.
Related errors
- Error checking collection: ${hasColResp}
- Collection not found: ${vectorStore.collectionName}, please
- Invalid JSON in the Additional Configuration:
- Invalid JSON in the Additional Configuration:
- Invalid table name
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/3912ef42a7886f30.
Report an issue: GitHub.