n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
49.98k stars 8.1k forks source link

NocoDB node: two issues with attachments #7613

Open naamval opened 1 year ago

naamval commented 1 year ago

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. NocoDB

I think that this is caused by the n8n node uploading the file to the 'wrong' folder.

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):

Joffcom commented 1 year ago

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.

Joffcom commented 1 year ago

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.

naamval commented 1 year ago

Great, thank you!

zblesk commented 1 year ago

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.