FTPFS timeout

Kaptam egy sima FTP hozzáférést (21-es port), ami FileZilla alatt villámgyorsan és rendben működik is.
MC alatt elég lassan csatlakozik fel (értsd: percek alatt), de ha felkapcsolódott, akkor már rendben megy.
Mivel azonban rsync-elni szeretnék, curlftpfs-t használnék, ami azonban eltimeoutol.
Maga a mount megtörténik gyorsan, de amint a felcsatolt mappához nyúlnék, pl.: ls, az egész leáll, és nincs tovább.
Nem találtam egyelőre olyan opciót, amivel menne, de elképzelni sem igazán tudom, mi ölheti meg ennyire.
Van valamit tippetek, hogyan lehetne használhatóan felcsatolni egy ilyen ftp elérést?

Hozzászólások

Aktív vagy passzív módban tapasztalod? NAT-olt hálózaton van a kliensed? Mit mutat az FTP session log? Néztél pl. tcpdumpot? Az FTP ALG be van kapcsolva (pl. NAT és conntrack helper)? Mással nincs gond, csak az FTP-vel? MTU/MSS rendben van?

A FileZilla passzív módban kapcsolódik. A logjában azt írja:
"A kiszolgáló nem lekérdezhető című passzív választ küldött. A szerver címének használata ehelyett."

A kliensem NAT mögött van.

Nem találtam a routerben FTP ALG-t.

Nem csak az FTP-vel van gond, hanem csak ezzel az egy FTP-vel. Minden más FTP is rendben működik.

A felmountolt mappát lecsatolni sem tudom, mert foglalt, de a force umount sem működik. Teljesen belehalt.

Akkor most ez érthetőbben angolul: "Server sent passive reply with unroutable address. Using server address instead."

Szóval ("unroutable" = "nem lekérdezhető") vélhetőleg a szerver privát IP-t mutat magából, és vélhetőleg az is NAT mögött van, és ott van a gond. Keresd meg a szerver üzemeltetőjét.
Másik lehetőség, hogy megfordítod, és aktív módban próbálod meg.

Sajnos az ftp szerver üzemeltetőjére nincs ráhatásom.
A log üzenetet csak azért írtam, mert számomra fura, és más logot nem is nagyon találtam.
A FileZille problémamentesen kezeli az FTP-t, a fenti üzenet mellett is.
Általában a curlftpfs is problémamentesen kezeli a passzív ftp-ket is, de lehet, hogy valamilyen paramétert kellene adnom neki, hogy ezt is jól kezelje?

"Sajnos az ftp szerver üzemeltetőjére nincs ráhatásom."
Azért egy jelzést, egy mailt megér felé, hogy vélhetőleg nem jól működik a szervere vagy a natolása, természetesen alátámasztva egy FTP session loggal/debuggal.
Neked is javaslom, hogy ezt tedd meg, akár egy parancssori FTP-vel is, de bármelyik klienssel, amelyik kiírja a küldött és kapott parancsokat, hogy a PASV résznél milyen IP-t kapsz a szervertől. És akkor biztos lehetsz abban, hogy ez-e a probléma gyökere vagy sem.

Annyit előreléptem, hogy gvfs-mount paranccsal sikerült felcsatolnom a távoli ftp-t fájlrendszerként. Ez ugyanúgy viselkedik, mint az mc, azaz lassan csatlakozik, de aztán használható.
Jelezném én az FTP felé a problémát, ha valóban szerver probléma lenne. A FileZilla azonban minden gond nélkül felcsatlakozik, amiből én mégis azt gyanítom, hogy a kliensek beállításaival van gond. Van valamilyen opció még, amit nem próbáltam.

Akkor ismét: légy szíves debugot nyomni neki, tegyél hozzá "-v -o debug" opciókat.
És ismét: a passzív és aktív mód abban különbözik, hogy a kliens vagy a szerver nyitja az adatkapcsolatot a másik felé. Lehet, hogy az aktív működik, de a passzív nem, ha a szerver oldali NAT nem jó.

Ehhez hasonlót fogsz látni, egy ls kiadásakor:


> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 227 Entering Passive Mode (203,0,113,1,160,61).
*   Trying 203.0.113.1...
* TCP_NODELAY set
* Connecting to 203.0.113.1 (203.0.113.1) port 41021
* Connected to 203.0.113.1 (203.0.113.1) port 21 (#0)
> LIST -a

Ha az IP helyén valami RFC1918-as privát IP-t látsz, akkor a szerver oldali NAT-tal van baj. Ha publikus IP-t látsz, akkor vélhetőleg nem ez a baj.


* Connection #0 to host xxx.xxx left intact
FUSE library version: 2.9.7
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.26
flags=0x001ffffb
max_readahead=0x00020000
   INIT: 7.19
   flags=0x00000011
   max_readahead=0x00020000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   unique: 1, success, outsize: 40
unique: 2, opcode: ACCESS (34), nodeid: 1, insize: 48, pid: 1980
   unique: 2, error: -38 (Function not implemented), outsize: 16
unique: 3, opcode: LOOKUP (1), nodeid: 1, insize: 47, pid: 1980
LOOKUP /.Trash
getattr /.Trash
* Couldn't find host xxx.xxx in the .netrc file; using defaults
* Found bundle for host xxx.xxx: 0x564231f85db0 [serially]
* Re-using existing connection! (#0) with host xxx.xxx
* Connected to xxx.xxx (x.x.x.x) port 21 (#0)
* Request has same path as previous transfer
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
unique: 4, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 1847
   unique: 4, success, outsize: 32
unique: 5, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 1847
getattr /
< 227 Entering Passive Mode (x,x,x,x,x,x).
*   Trying x.x.x.x...
* TCP_NODELAY set
* Connecting to x.x.x.x (x.x.x.x) port 61127
unique: 6, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 19222
getattr /
* connect to x.x.x.x port 21 failed: Connection timed out
* Failed to connect to xxx.xxx port 21: Connection timed out
* Closing connection 0
ftpfs: operation ftpfs_getattr failed because No such file or directory
   unique: 3, error: -2 (No such file or directory), outsize: 16
* Couldn't find host xxx.xxx in the .netrc file; using defaults
unique: 7, opcode: LOOKUP (1), nodeid: 1, insize: 45, pid: 19208
LOOKUP /BDMV
getattr /BDMV
*   Trying x.x.x.x...
* TCP_NODELAY set
* Connected to xxx.xxx (x.x.x.x) port 21 (#1)
< 220 ProFTPD 1.3.5a Server (Axio FTP) [x.x.x.x]
> USER xxx
< 331 Password required for xxx
> PASS xxx
< 230 User xxx logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 227 Entering Passive Mode (x,x,x,x,x,x).
*   Trying x.x.x.x...
* TCP_NODELAY set
* Connecting to x.x.x.x (x.x.x.x) port 63092
* connect to x.x.x.x port 21 failed: Connection timed out
* Failed to connect to xxx.xxx port 21: Connection timed out
* Closing connection 1
   unique: 5, success, outsize: 120
* Couldn't find host xxx.xxx in the .netrc file; using defaults
*   Trying x.x.x.x...
* TCP_NODELAY set
* Connected to xxx.xxx (x.x.x.x) port 21 (#2)
< 220 ProFTPD 1.3.5a Server (Axio FTP) [x.x.x.x]
> USER xxx
< 331 Password required for xxx
> PASS xxx
< 230 User xxx logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 227 Entering Passive Mode (x,x,x,x,x,x).
*   Trying x.x.x.x...
* TCP_NODELAY set
* Connecting to x.x.x.x (x.x.x.x) port 64637
* connect to x.x.x.x port 21 failed: Connection timed out
* Failed to connect to xxx.xxx port 21: Connection timed out
* Closing connection 2
   unique: 6, success, outsize: 120
* Couldn't find host xxx.xxx in the .netrc file; using defaults
*   Trying x.x.x.x...
* TCP_NODELAY set
* Connected to xxx.xxx (x.x.x.x) port 21 (#3)
< 220 ProFTPD 1.3.5a Server (Axio FTP) [x.x.x.x]
> USER xxx
< 331 Password required for xxx
> PASS xxx
< 230 User xxx logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 227 Entering Passive Mode (x,x,x,x,x,x).
*   Trying x.x.x.x...
* TCP_NODELAY set
* Connecting to x.x.x.x (x.x.x.x) port 63358

Ami nem látszik a GDPR logban, hogy két IP cím jelenik meg váltakozva. Az egyik az ftp szerver külső publikus IP címe, a másik egy B osztályú privát IP cím.
Ettől függetlenül én csak annyit tudtam kiolvasni belőle, hogy timeout-tal megszakad. A megszakadás okát nem.
Megpróbáltam úgy is felcsatlakozni, hogy hostnév helyett a feloldott IP címet adom meg. Az eredmény ugyanez.

Izé: ha anonimizálsz, akkor azt úgy tedd, hogy maradjon értelme a lognak. Ha mindent "x"-re cserélsz, akkor honnan fogom tudni, hogy két "x" az azonos értéket, IP-t, portot jelent-e? Ha megnézed, a fenti hozzászólásomban én is anonimizáltam, azonban értelmes, dokumentációs célra fenntartott IP-t írtam. Van belőle pár, lehet válogatni.

Most amilyen IP-t láttál a 227 kezdetű sorban, az ugye nem ugyanaz az IP, mint amit a 21-es porton próbált megszólítani?
Nem lennék meglepve, ha a 172.16.50.110 látszana a 227-es sorban is. Így van? Ha igen, akkor nyilván nem fog tudni csatlakozni hozzá, hiszen az interneten nem route-olt a 172.16.0.0/12, ergo te nem tudod megszólítani ezen a címen.


< 227 Entering Passive Mode (x,x,x,x,x,x).
*   Trying x.x.x.x...
* TCP_NODELAY set
* Connecting to x.x.x.x (x.x.x.x) port 63092
* connect to x.x.x.x port 21 failed: Connection timed out
* Failed to connect to xxx.xxx port 21: Connection timed out

Amúgy biztosan jó az, hogy a 21-es portra sem tud visszacsatlakozni? Ez elég furcsa.

Úgy érted, hogy miért tud egyáltalán, vagy úgy, hogy azok miért tudnak passzív módban?
Aktívban miért ne tudna? Ott a kliens mond IP-t és portot, amit a routered jól NAT-ol, és ezért a szerver a kliensedre tud kapcsolatot nyitni.
Ha passzív módban tud, akkor arra nem tudom a választ, így segítene, ha azokból a kliensekből is tudnál logot szerezni.

A FileZilla is passzív módban kapcsolódik.

Itt egy jobban olvasható log. Ebben már közvetlenül a publikus IP-hez kapcsolódtam, és nem a hostnévhez:


* Couldn't find host 195.x.x.x in the .netrc file; using defaults
*   Trying 195.x.x.x...
* TCP_NODELAY set
* Connected to 195.x.x.x (195.x.x.x) port 21 (#0)
< 220 ProFTPD 1.3.5a Server (Axio FTP) [172.16.x.x]
> USER xxx
< 331 Password required for xxx
> PASS xxx
< 230 User xxx logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
* ftp_perform ends with SECONDARY: 0
* Remembering we are in dir ""
* Connection #0 to host 195.x.x.x left intact
FUSE library version: 2.9.7
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.26
flags=0x001ffffb
max_readahead=0x00020000
   INIT: 7.19
   flags=0x00000011
   max_readahead=0x00020000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   unique: 1, success, outsize: 40
unique: 2, opcode: ACCESS (34), nodeid: 1, insize: 48, pid: 1980
   unique: 2, error: -38 (Function not implemented), outsize: 16
unique: 3, opcode: LOOKUP (1), nodeid: 1, insize: 47, pid: 1980
LOOKUP /.Trash
getattr /.Trash
* Couldn't find host 195.x.x.x in the .netrc file; using defaults
* Found bundle for host 195.x.x.x: 0x557ff10fadb0 [serially]
* Re-using existing connection! (#0) with host 195.x.x.x
* Connected to 195.x.x.x (195.x.x.x) port 21 (#0)
* Request has same path as previous transfer
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
unique: 4, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 1847
   unique: 4, success, outsize: 32
unique: 5, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 1847
getattr /
< 227 Entering Passive Mode (172,16,x,x,245,214).
*   Trying 172.16.x.x...
* TCP_NODELAY set
* Connecting to 172.16.x.x (172.16.x.x) port 62934
unique: 6, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 9611
getattr /
* connect to 172.16.x.x port 21 failed: Connection timed out
* Failed to connect to 195.x.x.x port 21: Connection timed out
* Closing connection 0
ftpfs: operation ftpfs_getattr failed because No such file or directory
   unique: 3, error: -2 (No such file or directory), outsize: 16
* Couldn't find host 195.x.x.x in the .netrc file; using defaults
* unique: 7, opcode: LOOKUP (1), nodeid: 1, insize: 45, pid: 19776
  Trying 195.x.x.x...
* TCP_NODELAY set
LOOKUP /BDMV
getattr /BDMV
* Connected to 195.x.x.x (195.x.x.x) port 21 (#1)
< 220 ProFTPD 1.3.5a Server (Axio FTP) [172.16.x.x]
> USER xxx
< 331 Password required for xxx
> PASS xxx
< 230 User xxx logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 227 Entering Passive Mode (172,16,x,x,254,189).
*   Trying 172.16.x.x...
* TCP_NODELAY set
* Connecting to 172.16.x.x (172.16.x.x) port 65213
* connect to 172.16.x.x port 21 failed: Connection timed out
* Failed to connect to 195.x.x.x port 21: Connection timed out
* Closing connection 1
   unique: 5, success, outsize: 120
* Couldn't find host 195.x.x.x in the .netrc file; using defaults
*   Trying 195.x.x.x...
* TCP_NODELAY set
* Connected to 195.x.x.x (195.x.x.x) port 21 (#2)
< 220 ProFTPD 1.3.5a Server (Axio FTP) [172.16.x.x]
> USER xxx
< 331 Password required for xxx
> PASS xxx
< 230 User xxx logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 227 Entering Passive Mode (172,16,x,x,240,18).
*   Trying 172.16.x.x...
* TCP_NODELAY set
* Connecting to 172.16.x.x (172.16.x.x) port 61458
* connect to 172.16.x.x port 21 failed: Connection timed out
* Failed to connect to 195.x.x.x port 21: Connection timed out
* Closing connection 2
   unique: 6, success, outsize: 120
* Couldn't find host 195.x.x.x in the .netrc file; using defaults
*   Trying 195.x.x.x...
* TCP_NODELAY set
unique: 8, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 9611
getattr /
   unique: 8, success, outsize: 120
* Connected to 195.x.x.x (195.x.x.x) port 21 (#3)
< 220 ProFTPD 1.3.5a Server (Axio FTP) [172.16.x.x]
> USER xxx
< 331 Password required for xxx
> PASS xxx
< 230 User xxx logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 227 Entering Passive Mode (172,16,x,x,245,120).
*   Trying 172.16.x.x...
* TCP_NODELAY set
* Connecting to 172.16.x.x (172.16.x.x) port 62840
* connect to 172.16.x.x port 21 failed: Connection timed out
* Failed to connect to 195.x.x.x port 21: Connection timed out
* Closing connection 3
ftpfs: operation ftpfs_getattr failed because No such file or directory
   unique: 7, error: -2 (No such file or directory), outsize: 16
unique: 9, opcode: LOOKUP (1), nodeid: 1, insize: 57, pid: 19775
LOOKUP /.xdg-volume-info
getattr /.xdg-volume-info
* Couldn't find host 195.x.x.x in the .netrc file; using defaults
*   Trying 195.x.x.x...
* TCP_NODELAY set
* Connected to 195.x.x.x (195.x.x.x) port 21 (#4)
< 220 ProFTPD 1.3.5a Server (Axio FTP) [172.16.x.x]
> USER xxx
< 331 Password required for xxx
> PASS xxx
< 230 User xxx logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 227 Entering Passive Mode (172,16,x,x,248,103).
*   Trying 172.16.x.x...
* TCP_NODELAY set
* Connecting to 172.16.x.x (172.16.x.x) port 63591
unique: 10, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 9611
getattr /
* connect to 172.16.x.x port 21 failed: Connection timed out
* Failed to connect to 195.x.x.x port 21: Connection timed out
* Closing connection 4
ftpfs: operation ftpfs_getattr failed because No such file or directory
   unique: 9, error: -2 (No such file or directory), outsize: 16
* Couldn't find host 195.x.x.x in the .netrc file; using defaults
unique: 11, opcode: LOOKUP (1), nodeid: 1, insize: 52, pid: 19777
LOOKUP /autorun.inf
getattr /autorun.inf
*   Trying 195.x.x.x...
* TCP_NODELAY set
* Connected to 195.x.x.x (195.x.x.x) port 21 (#5)
< 220 ProFTPD 1.3.5a Server (Axio FTP) [172.16.x.x]
> USER xxx
< 331 Password required for xxx
> PASS xxx
< 230 User xxx logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 227 Entering Passive Mode (172,16,x,x,238,108).
*   Trying 172.16.x.x...
* TCP_NODELAY set
* Connecting to 172.16.x.x (172.16.x.x) port 61036
* connect to 172.16.x.x port 21 failed: Connection timed out
* Failed to connect to 195.x.x.x port 21: Connection timed out
* Closing connection 5
   unique: 10, success, outsize: 120
* Couldn't find host 195.x.x.x in the .netrc file; using defaults
*   Trying 195.x.x.x...
* TCP_NODELAY set
* Connected to 195.x.x.x (195.x.x.x) port 21 (#6)
< 220 ProFTPD 1.3.5a Server (Axio FTP) [172.16.x.x]
> USER xxx
< 331 Password required for xxx
> PASS xxx
< 230 User xxx logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> PASV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 227 Entering Passive Mode (172,16,x,x,249,82).
*   Trying 172.16.x.x...
* TCP_NODELAY set
* Connecting to 172.16.x.x (172.16.x.x) port 63826
* connect to 172.16.x.x port 21 failed: Connection timed out
* Failed to connect to 195.x.x.x port 21: Connection timed out

A FileZilla logja nagyon szűkszavú, bár lehet, hogy pont a lényeget elárulja:


Állapot:	Cím feloldása a következőhöz: xxx.xxx
Állapot:	Csatlakozás a következő kiszolgálóhoz: 195.x.x.x:21...
Állapot:	Az adatkapcsolat létrejött, várakozás az üdvözlő üzenetre...
Állapot:	Belépve
Állapot:	Könyvtár lista lekérdezése...
Állapot:	A kiszolgáló nem lekérdezhető című passzív választ küldött. A szerver címének használata ehelyett.
Állapot:	Könyvtár listázás sikerült: "/"

Akkor ezek szerint egyes FTP kliensek, ha nem használható IP címet kapnak, akkor az eredetit használják tovább, de a curl azt próbálja meg használni, amit kap.
Vagyis ez így már egy jelenthető konfigurációs hiba az FTP szerver üzemeltetője felé.