{"record":{"id":"682dcaee574ba130","repo":"n8n-io/n8n","slug":"operation-error-message-unknown-error","errorCode":null,"errorMessage":"${operation.error.message ?? 'Unknown error'}","messagePattern":"\\$\\{operation\\.error\\.message \\?\\? 'Unknown error'\\}","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/helpers/utils.ts","lineNumber":307,"sourceCode":"\n\tconst operationName = uploadResponse.body.name;\n\tlet operation = (await apiRequest.call(\n\t\tthis,\n\t\t'GET',\n\t\t`/v1beta/${operationName}`,\n\t)) as FileSearchOperation;\n\n\twhile (!operation.done) {\n\t\tawait new Promise((resolve) => setTimeout(resolve, OPERATION_CHECK_INTERVAL));\n\t\toperation = (await apiRequest.call(\n\t\t\tthis,\n\t\t\t'GET',\n\t\t\t`/v1beta/${operationName}`,\n\t\t)) as FileSearchOperation;\n\t}\n\n\tif (operation.error) {\n\t\tthrow new NodeOperationError(this.getNode(), operation.error.message ?? 'Unknown error', {\n\t\t\tdescription: 'Error uploading file to File Search store',\n\t\t});\n\t}\n\n\treturn operation.response;\n}\n\nexport async function listFileSearchStores(\n\tthis: IExecuteFunctions,\n\tpageSize?: number,\n\tpageToken?: string,\n) {\n\tconst qs: IDataObject = {};\n\tif (pageSize !== undefined) {\n\t\tqs.pageSize = pageSize;\n\t}\n\tif (pageToken) {\n\t\tqs.pageToken = pageToken;","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/helpers/utils.ts#L289-L325","documentation":"Failure in uploadToFileSearchStore: after the uploadToFileSearchStore LRO completes polling (operation.done === true), if the operation carries an 'error' object the node throws operation.error.message ?? 'Unknown error' with description 'Error uploading file to File Search store'. This is a server-side failure during indexing into a File Search store.","triggerScenarios":"The file bytes uploaded fine but indexing into the File Search store failed: unsupported document type for retrieval, file too large for the store, duplicate displayName, store quota exceeded, or the store was concurrently deleted.","commonSituations":"Pointing a File Search operation at a store that doesn't exist anymore; uploading a scanned image PDF that can't be parsed; exceeding per-store file count/size; transient backend indexing error.","solutions":["Read operation.error.message for the exact server reason.","Confirm the fileSearchStoreName still exists (listFileSearchStores) and the displayName is unique.","Use a text-based or text-layer PDF / supported doc; retry on transient errors.","Reduce the file size / split large documents before upload."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"function isIndexableDoc(buf: Buffer, mime: string): boolean {\n  return mime === 'application/pdf' || mime.startsWith('text/') || mime === 'text/plain';\n}","typeGuard":"interface FileSearchLro { done: boolean; error?: { message: string }; response?: unknown }\nfunction isFileSearchFailure(op: FileSearchLro): boolean {\n  return op.done === true && !!op.error;\n}","tryCatchPattern":"for (let attempt = 1; attempt <= 3; attempt++) {\n  try { return await uploadToFileSearchStore(i, store, name, url, mime); }\n  catch (e) {\n    if (attempt === 3 || /quota|unsupported|not exist/i.test(e.message)) throw e;\n    await new Promise(r => setTimeout(r, 1000 * attempt));\n  }\n}","preventionTips":["Confirm the File Search store exists (listFileSearchStores) before uploading.","Use text-layer PDFs / plain text for reliable indexing.","Keep within per-store file count/size; retry once for transient indexing errors."],"tags":["google-gemini","file-search","upload","api-error","long-running-operation","node-operation-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}