SFTP / FTP Node doesn't close connection

EDIT:
Sorted the problem with the filename. Had to use /Angebote/{{ $binary.data.fileName }}

Same issues here, have the same provider then @donniedarkowindsalt , Its all-inkl.com. Not sure what FTP they’re using. It’s a managed web-server

I had trouble with the filename while uploading a binary file from the previous node. For some reason it’s not enough to set just the PATH, you are required to set the filename too manually and can’t use the filename of the binary.

After a couple of errors with dynamic file name setting i got then the error for too many connections. Waited now over 30minutes and connections are still not possible trough n8n.

If i set a static file name, it seems not to be an problem. The PATH is set to this: /Angebote/Angebot_TKV_JuliaOrth-Test_und_Sidney-Sam_13_02_2024_09_02.pdf

ExpressionError: Can’t get data for expression
    at createExpressionError (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:468:20)
    at pairedItemMethod (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:699:43)
    at Object.get (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:740:40)
    at Proxy.eval (eval at getFunction (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/index.js:24:22), <anonymous>:7:116)
    at Proxy.eval (eval at getFunction (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/index.js:24:22), <anonymous>:14:3)
    at Tournament.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/index.js:33:19)
    at evaluateExpression (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/ExpressionEvaluatorProxy.js:110:16)
    at Expression.renderExpression (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:219:70)
    at Expression.resolveSimpleParameterValue (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:197:34)
    at Expression.getParameterValue (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:281:25)
    at getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1481:42)
    at Object.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2143:24)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Ftp/Ftp.node.js:605:49)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:706:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:656:53
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1058:20

And now i’m stuck with:

Error: Sorry, the maximum number of connections (10) for your host are already connected.
    at makeError (/usr/local/lib/node_modules/n8n/node_modules/@icetee/ftp/lib/connection.js:1128:13)
    at Parser.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/@icetee/ftp/lib/connection.js:122:25)
    at Parser.emit (node:events:517:28)
    at Parser.emit (node:domain:489:12)
    at Parser._write (/usr/local/lib/node_modules/n8n/node_modules/@icetee/ftp/lib/parser.js:61:10)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Parser.Writable.write (node:internal/streams/writable:337:10)
    at Socket.ondata (/usr/local/lib/node_modules/n8n/node_modules/@icetee/ftp/lib/connection.js:298:20)
    at Socket.emit (node:events:517:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:368:12)
    at readableAddChunk (node:internal/streams/readable:341:9)
    at Socket.Readable.push (node:internal/streams/readable:278:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

Hey @Bastian_Orth,

The first issue should be resolved with the next release I put in a fix for that yesterday, Is your workflow only running once or is it being triggered multiple times? I will need to look to make sure we are closing connections but they should be closing when the node finishes.

Just to double check are you using FTP or SFTP?

1 Like

Triggered by Webhook but with new data, so i have maybe worst case 2-3 executions at the same time. In one run there can between 1-3 uploads.

Using FTP

Hey @Bastian_Orth,

The good news is I have found 2 case where we were not correctly closing the connection, I have put in the PR below which once reviewed will be merged and available in a future release.

1 Like

New version [email protected] got released which includes the GitHub PR 8619.