I am using the FTP download node and I have a zip file I am trying to download and I get the following error:
“ERROR: Cannot create a string longer than 0x3fffffe7 characters”
Error: Cannot create a string longer than 0x3fffffe7 characters
at Object.slice (buffer.js:653:37)
at Buffer.toString (buffer.js:801:14)
at Object.prepareBinaryData (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/NodeExecuteFunctions.js:34:26)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Ftp.node.js:427:84)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:395:47
I’ve looked online and the solution is to change the way this node works:
It’s 1 GB, and I expect it to be a little bit larger than that.
I wouldn’t have thought this is a problem for real FTP (so please don’t say, make the file smaller).
Yes, that will currently not be possible with n8n. The reason is the design. It was simply never written to handle huge files. That is maybe something that will change in the future but that would require a bigger refactor.
Technical explanation. All data in n8n gets saved as JSON. All binary data gets converted to base64 and so also saved as a string. The maximum size of a string in Node.js is 1GB. Considering that base64 increases the file size, does it mean that the maximum file size n8n can handle is probably around 750 MB.
I’ve no idea how it might work with the Execute Command Node.
I can’t even install PIP on Execute Command Node?
It might be easier to run n8n on a LXC/VM that has a mounted NFS folder, and copy it. But I’d still need to download it first.
That are two totally different systems. n8n runs in the Docker image and that one will not have sshpass installed unless you build a custom n8n image and you add it there manually.
Strange, because I’ve ran docker stuff before and were able to run system stuff to install Python, Pip packages and much more.
What’s required for customising the image? Just adding a few lines to the docker-compose.yml file?
If that doesn’t work, then I guess I’m stuck with waiting for this refactoring… or reinstalling n8n and not using docker…