n8n
n8n copied to clipboard
NocoDB node: two issues with attachments
Describe the bugs
Bug 1: Attachment upload via NocoDB node
When uploading attachments to NocoDB, the files cannot be seen in NocoDB's interface. A row with an attachment uploaded via n8n's NocoDB node (option selected: API version v.0.90.0 onwards) will look like row 1 here. The attachment cannot be downloaded or viewed.
I think that this is caused by the n8n node uploading the file to the 'wrong' folder.
- When using NocoDB node in n8n, the file ends up in /nc/uploads/{filename.extension}.
- When using NocoDB's own UI, the attachment is uploaded to /nc/uploads/noco/{projectid}/{tableid}/{columnid}/{filename.extension}. In that case, the attachment can be viewed and downloaded (see row 2 in the image above). This seems to be the 'correct' way, although I cannot find this stated clearly in NocoDB's documentation.
Bug 2: Attachment download via NocoDB node 'Download Attachments' in the NocoDB node (get/get many) does not work. It returns ERROR: Unexpected token o in JSON at position 1 with the following details:
SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at jsonParse (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/utils.js:62:21)
at Object.downloadRecordAttachments (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/NocoDB/GenericFunctions.js:55:80)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/NocoDB/NocoDB.node.js:370:97)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:670:19)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:652:53
Environment (please complete the following information):
- n8n Version 1.14.2 (Docker)
- Database system Postgres
- Operation mode Queue
Hey @naamval
There is a PR in that resolves the first issue, I will give it a test to see if it fixes the second issue as well.
Hey @naamval,
I have given it a quick test and the download attachments also fails in the node update, I will get this added to the same PR hopefully this week.
Great, thank you!
I've also gotten the "Unexpected token o in JSON at position 1". I got rid of it by adding quotes; so instead of File
I wrote "File"
.
I do get a JSON response, but I don't see the file anywhere - I'm trying to pass it to a CSV reader node, but the data don't seem to be there.