{"record":{"id":"35bf0596fac97c1c","repo":"n8n-io/n8n","slug":"no-binary-data-exists-on-item","errorCode":null,"errorMessage":"No binary data exists on item!","messagePattern":"No binary data exists on item!","errorType":"validation","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/v1/actions/image/analyze.operation.ts","lineNumber":188,"sourceCode":"\t\tconst binaryPropertyName = this.getNodeParameter('binaryPropertyName', i)\n\t\t\t.split(',')\n\t\t\t.map((propertyName) => propertyName.trim());\n\n\t\tfor (const propertyName of binaryPropertyName) {\n\t\t\tconst binaryData = this.helpers.assertBinaryData(i, propertyName);\n\n\t\t\tlet fileBase64;\n\t\t\tif (binaryData.id) {\n\t\t\t\tconst chunkSize = 256 * 1024;\n\t\t\t\tconst stream = await this.helpers.getBinaryStream(binaryData.id, chunkSize);\n\t\t\t\tconst buffer = await this.helpers.binaryToBuffer(stream);\n\t\t\t\tfileBase64 = buffer.toString('base64');\n\t\t\t} else {\n\t\t\t\tfileBase64 = binaryData.data;\n\t\t\t}\n\n\t\t\tif (!binaryData) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'No binary data exists on item!');\n\t\t\t}\n\n\t\t\tcontent.push({\n\t\t\t\ttype: 'image_url',\n\t\t\t\timage_url: {\n\t\t\t\t\turl: `data:${binaryData.mimeType};base64,${fileBase64}`,\n\t\t\t\t\tdetail,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\tconst body = {\n\t\tmodel,\n\t\tmessages: [\n\t\t\t{\n\t\t\t\trole: 'user',\n\t\t\t\tcontent,","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/v1/actions/image/analyze.operation.ts#L170-L206","documentation":"This error is intended to fire when no binary data exists on the item for the Analyze Image operation. However, the code has a logic bug: it calls this.helpers.assertBinaryData() first (line 175), which itself throws if binary data is missing, and then accesses binaryData.id and binaryData.data before the !binaryData check on line 187. The check is dead code — if binaryData were falsy, assertBinaryData would already have thrown. This error as written is unreachable.","triggerScenarios":"Intended to fire when binaryPropertyName does not resolve to binary data on the item. In practice, assertBinaryData() (line 175) throws first with its own error, so this NodeOperationError is never reached. The error is effectively dead code due to the check ordering.","commonSituations":"The binary property name specified in the node does not match any binary data on the input item; upstream node did not produce binary output; wrong binary property name configured.","solutions":["Verify the binary property name matches what the upstream node outputs (check the 'Binary' tab in the input data)","Ensure an upstream node (e.g. Read Binary File, HTTP Request) actually produces binary data on the item","Note: the actual error you see will come from assertBinaryData(), not this check — but the fix is the same"],"exampleFix":"// The !binaryData check at line 187 is dead code; assertBinaryData() at line 175 throws first.\n// To actually guard, check BEFORE calling assertBinaryData:\n// before:\n//   const binaryData = this.helpers.assertBinaryData(i, propertyName);\n//   ... use binaryData.id / binaryData.data ...\n//   if (!binaryData) { throw ... }  // unreachable\n// after:\n//   const binaryData = this.helpers.assertBinaryData(i, propertyName);\n//   // assertBinaryData already throws if missing; no additional guard needed","handlingStrategy":"validation","validationCode":"// Validate binary data exists BEFORE processing\nconst binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);\nconst binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);\n// assertBinaryData throws if missing — this is the real guard\n// The !binaryData check in the source is dead code","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the binary property name matches upstream node output (check 'Binary' tab)","Ensure upstream nodes produce binary data before this operation","Use an IF node to check for binary data presence before routing to this node","Note: the actual error comes from assertBinaryData(), not the dead-code check"],"tags":["openai","image","binary-data","dead-code","v1","bug"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}