- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2.8k
 
Description
Checked other resources
- This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
 - I added a very descriptive title to this issue.
 - I searched the LangChain.js documentation with the integrated search.
 - I used the GitHub search to find a similar question and didn't find it.
 - I am sure that this is a bug in LangChain.js rather than my code.
 - The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
 
Example Code
no code
Error Message and Stack Trace (if applicable)
{
"errorMessage": "The field "title_vector" is not provided in documents[0].metadata.",
"errorDetails": {},
"n8nDetails": {
"n8nVersion": "1.116.2 (Self Hosted)",
"binaryDataMode": "default",
"stackTrace": [
"Error: The field "title_vector" is not provided in documents[0].metadata.",
"    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/@langchain[email protected]_a15f2f07b13189caf0f9b792748d9f32/node_modules/@langchain/community/dist/vectorstores/milvus.cjs:277:35",
"    at Array.forEach ()",
"    at Milvus.addVectors (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@langchain[email protected]_a15f2f07b13189caf0f9b792748d9f32/node_modules/@langchain/community/dist/vectorstores/milvus.cjs:256:25)",
"    at processTicksAndRejections (node:internal/process/task_queues:105:5)",
"    at Milvus.addDocuments (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@langchain[email protected]_a15f2f07b13189caf0f9b792748d9f32/node_modules/@langchain/community/dist/vectorstores/milvus.cjs:229:9)",
"    at Function.fromDocuments (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@langchain[email protected]_a15f2f07b13189caf0f9b792748d9f32/node_modules/@langchain/community/dist/vectorstores/milvus.cjs:567:9)",
"    at Object.populateVectorStore (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_a24dca14d97268ba43379590ce508ab3/node_modules/@n8n/n8n-nodes-langchain/nodes/vector_store/VectorStoreMilvus/VectorStoreMilvus.node.ts:94:3)",
"    at handleInsertOperation (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_a24dca14d97268ba43379590ce508ab3/node_modules/@n8n/n8n-nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.ts:73:4)",
"    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+n8n-nodes-langchain@file+packages+@n8n+nodes-langchain_a24dca14d97268ba43379590ce508ab3/node_modules/@n8n/n8n-nodes-langchain/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts:286:24)",
"    at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1093:8)",
"    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1274:11)",
"    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1699:27",
"    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2315:11"
]
}
}
Description
I am a user of n8n and Milvus Db so cannot provide any code of mine, just my thoughts.
Given:
- n8n MilvusVectorStore node uses langchain/community v0.3.50
 - Collection schema on Milvus db has field 
title_vectorof SparseVectorType, which value is calculated on insert fromtitlefield - When I try to insert a document, the error with message "The field "title_vector" is not provided in documents[0].metadata."
 
After some research, I found out that this message is triggered in langchain/community package:
- Package fetches collection schema: field 
title_vectoris in the list (Postman shows that it has flag "isFunctionOutput": true) - On insert, package checks if doc.metadata map has entry for 
title_vector. If not - error link. The check is same in current version. - If I provide dummy data for 
title_vectorin metadata, then Milvus returns error with message: "fail to deal the insert data, error: invalid parameter[expected=][actual=not allowed to provide input data for function output field: title_vector]" 
I think, calculated on Db side fields should not be expected to be provided by client.
System Info
n8nVersion": "1.116.2 (Self Hosted)
MilvusVectoreStore Node with langchain/community:0.3.50