FTP Connection dont anymore (node runs indefinitely without error)

A few days ago, the connection to some FTP servers suddenly stopped working in my workflows. Everything worked perfectly before.

Affected are the FTP servers I normally use to log in with SFTP on port 22.
When I start the FTP node or start the workflow, the FTP process runs indefinitely without an error message.

When saving the connection with port 22, the saving also runs indefinitely but the entry is created. If I change the port to 21 (which also works perfectly via Filezilla) then the message “Connection tested successfully” appears when saving. If I then start the FTP module, the following error message appears:

Error: Unknown command
    at makeError (/home/user/.nvm/versions/node/v18.19.0/lib/node_modules/n8n/node_modules/@icetee/ftp/lib/connection.js:1128:13)
    at Parser.<anonymous> (/home/user/.nvm/versions/node/v18.19.0/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 (/home/user/.nvm/versions/node/v18.19.0/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 (/home/user/.nvm/versions/node/v18.19.0/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)

Please let me know if I should provide more information. Unfortunately I have not found a log.

Information on your n8n setup

  • n8n version: 1.26.0
  • Database (default: SQLite): MySQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): manual
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu 22 LTS

Hey @duck,

It sounds like there might have been a change to the SFTP servers you are using, Are they in your control or ran by a third party?

When using FTP on port 21 I suspect the connection is trying to use TLS which we don’t support and will result in the unknown command error or the server is saying it supports PASV and when we try to use it the server is rejecting the command.

When you tried connecting from Filezilla using sftp was that from the Ubuntu host running n8n or from a different machine?

No changes have been made to the FTP server. All FTP servers that are connected via SFTP are also affected. The FTP servers that do not support SFTP work.
On the Ubuntu host I can log in via Filezilla on the affected servers (both via port 21 and 22).

I updated to V 1.2.6. a few days ago, this could be the reason.

Hey @duck,

It shouldn’t be as we have not changed anything in the node that would impact that. Would you be able to enable debug logging in Filezilla, Make the connection using SFTP and send me the log output?

I have uninstalled n8n and installed it via docker this time. Now everything works again without any problems and it also runs more smoothly.

1 Like