FTP Server cant connect, command unknown

Describe the issue/error/question

I want to connect to my own ftp server and its not working. Tried other ftp server, which are working, but my server is working just fine with filezilla and some ftp testing tools say, that the server is okay. I think the server ist sending a command n8n dont know, but i dont know how to know which command that is. I would prefer n8n ignoring unknown command instead of aborting.

What is the error message (if any)?

Error: Unknown command
    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 (events.js:315:20)
    at Parser._write (/usr/local/lib/node_modules/n8n/node_modules/@icetee/ftp/lib/parser.js:61:10)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at Parser.Writable.write (internal/streams/writable.js:303:10)
    at Socket.ondata (/usr/local/lib/node_modules/n8n/node_modules/@icetee/ftp/lib/connection.js:298:20)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)

Please share the workflow

Its only a ftp node im trying it with

Information on your n8n setup

  • n8n version: latest ( 0.156.0 )
  • Database you’re using (default: SQLite): postgres
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: docker (production) and desktop (testing)

Hi @KnudH, welcome to the community and sorry to hear you’re running into trouble. I’ve just tested the FTP node on my end and didn’t run into any trouble here though:

image

I’ve tested this using my own server as well as via this test server.

Are you by any chance using the wrong protocol in the node or have set the wrong port number in your credentials? FileZilla might detect the correct settings automatically, but n8n wouldn’t do any auto-configuration here.

Thanks for that fast reply.

Port ist default. (21). This is configured in FileZilla and n8n.
Protocoll is FTP, SFTP is not working with this server. TLS or not both is working with this server and so it is in FileZilla. I cant choose which I want in n8n (or am I wrong?).
Connection to the test server you mentioned is working just fine. Difference in FileZilla ist, that the testserver uses TLS 1.2 and my server uses TLS 1.3 (dont know if that matters).

Protocoll of FileZilla connecting to my server:

|Status:|Auflösen der IP-Adresse für ftp.xxx.xx|
|Status:|Verbinde mit XX.XX.XXX.XXX:21…|
|Status:|Verbindung hergestellt, warte auf Willkommensnachricht…|
|Antwort:|220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------|
|Antwort:|220-You are user number 1 of 50 allowed.|
|Antwort:|220-Local time is now 10:34. Server port: 21.|
|Antwort:|220-This is a private system - No anonymous login|
|Antwort:|220-IPv6 connections are also welcome on this server.|
|Antwort:|220 You will be disconnected after 15 minutes of inactivity.|
|Befehl:|AUTH TLS|
|Antwort:|234 AUTH TLS OK.|
|Status:|Initialisiere TLS…|
|Status:|TLS-Verbindung hergestellt.|
|Befehl:|USER dlrgrd_cloud_scans|
|Antwort:|331 User dlrgrd_cloud_scans OK. Password required|
|Befehl:|PASS *************|
|Antwort:|230 OK. Current restricted directory is /|
|Befehl:|OPTS UTF8 ON|
|Antwort:|200 OK, UTF-8 enabled|
|Befehl:|PBSZ 0|
|Antwort:|200 PBSZ=0|
|Befehl:|PROT P|
|Antwort:|200 Data protection level set to private|
|Status:|Angemeldet|
|Status:|Empfange Verzeichnisinhalt…|
|Befehl:|PWD|
|Antwort:|257 / is your current location|
|Status:|Anzeigen des Verzeichnisinhalts fĂĽr / abgeschlossen|

If your server uses FTPS this could indeed be a problem as it’s not supported by n8n I am afraid (see for example FTP over TLS planned or workaround known? - #5 by RicardoE105).

Though since you’ve mentioned FTP without TLS should also work (or in other words plain/insecure FTP), I am a bit puzzled what’s the issue here. The TLS version shouldn’t matter in this case. I have also tried running Pure-ftpd (which seems to power your server) myself. This was working fine with n8n, so I could not reproduce this even when running the same FTP server.

Would you be able to confirm which provider is hosting your FTP server? That might help with reproducing what might be happening here.

Also, could you double-check your server actually works without TLS? The Filezilla log you have shared suggests it’s being used. This would need to be set in the Encryption field:
image

2 Likes

Im hosting the server myself. Im running ISPConfig which brings pureftp.

Log with TLS disabled:

|Status:|Auflösen der IP-Adresse für ftp.xxx.xx|
|Status:|Verbinde mit XX.XX.XX.XX:21…|
|Status:|Verbindung hergestellt, warte auf Willkommensnachricht…|
|Antwort:|220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------|
|Antwort:|220-You are user number 1 of 50 allowed.|
|Antwort:|220-Local time is now 21:09. Server port: 21.|
|Antwort:|220-This is a private system - No anonymous login|
|Antwort:|220-IPv6 connections are also welcome on this server.|
|Antwort:|220 You will be disconnected after 15 minutes of inactivity.|
|Status:|UnverschlĂĽsseltes FTP ist unsicher. Bitte wechseln Sie zu FTP ĂĽber TLS.|
|Befehl:|USER dlrgrd_cloud_scans|
|Antwort:|331 User dlrgrd_cloud_scans OK. Password required|
|Befehl:|PASS *************|
|Antwort:|230 OK. Current restricted directory is /|
|Befehl:|OPTS UTF8 ON|
|Antwort:|200 OK, UTF-8 enabled|
|Status:|Angemeldet|
|Status:|Empfange Verzeichnisinhalt…|
|Befehl:|PWD|
|Antwort:|257 / is your current location|
|Status:|Anzeigen des Verzeichnisinhalts fĂĽr / abgeschlossen|

Hey @KnudH,

I may have missed it but do both your desktop and docker instance fail to connect?

In your node what command are you using is it just a list?

The FileZilla output looks fine there doesn’t appear to be anything odd coming back which is always good.

What version of pure ftpd is it?