Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTP Hangs on MLSD Command #25

Closed
MWalid opened this issue Jul 22, 2015 · 8 comments
Closed

FTP Hangs on MLSD Command #25

MWalid opened this issue Jul 22, 2015 · 8 comments

Comments

@MWalid
Copy link

MWalid commented Jul 22, 2015

I have used this module for a while,,

Suddenly it stopped working, always hangs on MLSD command,

Here is shell output,

[13:44:49] CONN 
[13:44:49] READY
[13:44:49] MLSD  /public_html
[13:45:14] ERROR Error: read ETIMEDOUT
    at exports._errnoException (util.js:746:11)
    at TCP.onread (net.js:550:26) (ETIMEDOUT)
[13:45:14] DISC 

BTW filezilla is working without issues - so it's not port range issue as suggested here and there,,,,

@morris
Copy link
Owner

morris commented Jul 22, 2015

What you mean by "suddenly"? Have you updated vinyl-ftp? Or changed something else?

Can you paste a full log of FileZilla MLSDing correctly? Also, can you test if FileZilla still works in passive mode? (Server Manager > Transfer Settings > Passive) - because vinyl-ftp does not support active mode currently.

@MWalid
Copy link
Author

MWalid commented Jul 23, 2015

I didn't update vinyl-ftp nor changed any configuration recently,

I have tested FileZilla in passive mode, it's working seamlessly,

FileZilla logs:

Status:         Resolving address of ****.server.**
Status:         Connecting to *.*.*.*:21...
Status:         Connection established, waiting for welcome message...
Status:         Initializing TLS...
Status:         Verifying certificate...
Status:         TLS connection established.
Status:         Server does not support non-ASCII characters.
Status:         Connected
Status:         Retrieving directory listing...
Status:         Directory listing of "/" successful

@morris
Copy link
Owner

morris commented Jul 23, 2015

Ok, try settings "secure: true" in the vinyl-ftp options. Never tried this myself, but should work. Maybe your server requires TLS somehow. If possible, send me a sandbox FTP account so I can debug. [email protected]

@morris
Copy link
Owner

morris commented Jul 23, 2015

Also try with debug: gutil.log or console.log.bind( console ) to see some more logging

@MWalid
Copy link
Author

MWalid commented Jul 23, 2015

For now, secure: true didn't work,

Here is the full log,

[14:28:14] Starting 'ftp:d'...
[14:28:14] CONN 
[14:28:14] [connection] < '220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------\r\n220-You are user number 6 of 50 allowed.\r\n220-Local time is now 14:28. Server port: 21.\r\n220-This is a private system - No anonymous login\r\n220-IPv6 connections are also welcome on this server.\r\n220 You will be disconnected after 60 minutes of inactivity.\r\n'
[14:28:14] [parser] < '220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------\r\n220-You are user number 6 of 50 allowed.\r\n220-Local time is now 14:28. Server port: 21.\r\n220-This is a private system - No anonymous login\r\n220-IPv6 connections are also welcome on this server.\r\n220 You will be disconnected after 60 minutes of inactivity.\r\n'
[14:28:14] [parser] Response: code=220, buffer='--------- Welcome to Pure-FTPd [privsep] [TLS] ----------\r\nYou are user number 6 of 50 allowed.\r\nLocal time is now 14:28. Server port: 21.\r\nThis is a private system - No anonymous login\r\nIPv6 connections are also welcome on this server.\r\nYou will be disconnected after 60 minutes of inactivity.'
[14:28:14] [connection] > 'AUTH TLS'
[14:28:14] [connection] < '234 AUTH TLS OK.\r\n'
[14:28:14] [parser] < '234 AUTH TLS OK.\r\n'
[14:28:14] [parser] Response: code=234, buffer='AUTH TLS OK.'
[14:28:14] [connection] > 'PBSZ 0'
[14:28:14] [connection] < '200 PBSZ=0\r\n'
[14:28:14] [parser] < '200 PBSZ=0\r\n'
[14:28:14] [parser] Response: code=200, buffer='PBSZ=0'
[14:28:14] [connection] > 'PROT P'
[14:28:14] [connection] < '200 Data protection level set to "private"\r\n'
[14:28:14] [parser] < '200 Data protection level set to "private"\r\n'
[14:28:14] [parser] Response: code=200, buffer='Data protection level set to "private"'
[14:28:14] [connection] > 'USER ****'
[14:28:14] [connection] < '331 User **** OK. Password required\r\n'
[14:28:14] [parser] < '331 User **** OK. Password required\r\n'
[14:28:14] [parser] Response: code=331, buffer='User **** OK. Password required'
[14:28:14] [connection] > 'PASS ******'
[14:28:14] [connection] < '230 OK. Current restricted directory is /\r\n'
[14:28:14] [parser] < '230 OK. Current restricted directory is /\r\n'
[14:28:14] [parser] Response: code=230, buffer='OK. Current restricted directory is /'
[14:28:14] [connection] > 'FEAT'
[14:28:14] [connection] < '211-Extensions supported:\r\n EPRT\r\n IDLE\r\n MDTM\r\n SIZE\r\n MFMT\r\n REST STREAM\r\n MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;\r\n MLSD\r\n AUTH TLS\r\n PBSZ\r\n PROT\r\n TVFS\r\n ESTA\r\n PASV\r\n EPSV\r\n SPSV\r\r\n'
[14:28:14] [connection] < '211 End.\r\n'
[14:28:14] [parser] < '211-Extensions supported:\r\n EPRT\r\n IDLE\r\n MDTM\r\n SIZE\r\n MFMT\r\n REST STREAM\r\n MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;\r\n MLSD\r\n AUTH TLS\r\n PBSZ\r\n PROT\r\n TVFS\r\n ESTA\r\n PASV\r\n EPSV\r\n SPSV\r\r\n211 End.\r\n'
[14:28:14] [parser] Response: code=211, buffer='Extensions supported:\r\n EPRT\r\n IDLE\r\n MDTM\r\n SIZE\r\n MFMT\r\n REST STREAM\r\n MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;\r\n MLSD\r\n AUTH TLS\r\n PBSZ\r\n PROT\r\n TVFS\r\n ESTA\r\n PASV\r\n EPSV\r\n SPSV\r\r\nEnd.'
[14:28:14] [connection] > 'TYPE I'
[14:28:14] [connection] < '200 TYPE is now 8-bit binary\r\n'
[14:28:14] [parser] < '200 TYPE is now 8-bit binary\r\n'
[14:28:14] [parser] Response: code=200, buffer='TYPE is now 8-bit binary'
[14:28:14] READY
[14:28:14] MLSD  /public_html
[14:28:14] [connection] > 'PASV'
[14:28:14] [connection] < '227 Entering Passive Mode (*,*,*,*,181,224)\r\n'
[14:28:14] [parser] < '227 Entering Passive Mode (*,*,*,*,181,224)\r\n'
[14:28:14] [parser] Response: code=227, buffer='Entering Passive Mode (*,*,*,*,181,224)'
[14:28:14] [connection] PASV socket connected
[14:28:14] [connection] > 'MLSD /public_html'
[14:28:14] [connection] < '150 Accepted data connection\r\n'
[14:28:14] [parser] < '150 Accepted data connection\r\n'
[14:28:14] [parser] Response: code=150, buffer='Accepted data connection'
tls.js:182
      var commonNames = cert.subject.CN;
                                    ^
TypeError: Cannot read property 'CN' of undefined
    at Object.checkServerIdentity (tls.js:182:37)
    at TLSSocket.<anonymous> (_tls_wrap.js:932:31)
    at TLSSocket.emit (events.js:104:17)
    at TLSSocket._finishInit (_tls_wrap.js:458:8)

@MWalid
Copy link
Author

MWalid commented Jul 23, 2015

Full logs without secure: true

[14:31:50] Starting 'ftp:d'...
[14:31:50] CONN 
[14:31:50] [connection] < '220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------\r\n220-You are user number 5 of 50 allowed.\r\n220-Local time is now 14:31. Server port: 21.\r\n220-This is a private system - No anonymous login\r\n220-IPv6 connections are also welcome on this server.\r\n220 You will be disconnected after 60 minutes of inactivity.\r\n'
[14:31:50] [parser] < '220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------\r\n220-You are user number 5 of 50 allowed.\r\n220-Local time is now 14:31. Server port: 21.\r\n220-This is a private system - No anonymous login\r\n220-IPv6 connections are also welcome on this server.\r\n220 You will be disconnected after 60 minutes of inactivity.\r\n'
[14:31:50] [parser] Response: code=220, buffer='--------- Welcome to Pure-FTPd [privsep] [TLS] ----------\r\nYou are user number 5 of 50 allowed.\r\nLocal time is now 14:31. Server port: 21.\r\nThis is a private system - No anonymous login\r\nIPv6 connections are also welcome on this server.\r\nYou will be disconnected after 60 minutes of inactivity.'
[14:31:50] [connection] > 'USER *****'
[14:31:50] [connection] < '331 User ***** OK. Password required\r\n'
[14:31:50] [parser] < '331 User ***** OK. Password required\r\n'
[14:31:50] [parser] Response: code=331, buffer='User ***** OK. Password required'
[14:31:50] [connection] > 'PASS ******'
[14:31:50] [connection] < '230 OK. Current restricted directory is /\r\n'
[14:31:50] [parser] < '230 OK. Current restricted directory is /\r\n'
[14:31:50] [parser] Response: code=230, buffer='OK. Current restricted directory is /'
[14:31:50] [connection] > 'FEAT'
[14:31:50] [connection] < '211-Extensions supported:\r\n EPRT\r\n IDLE\r\n MDTM\r\n SIZE\r\n MFMT\r\n REST STREAM\r\n MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;\r\n MLSD\r\n AUTH TLS\r\n PBSZ\r\n PROT\r\n TVFS\r\n ESTA\r\n PASV\r\n EPSV\r\n SPSV\r\r\n211 End.\r\n'
[14:31:50] [parser] < '211-Extensions supported:\r\n EPRT\r\n IDLE\r\n MDTM\r\n SIZE\r\n MFMT\r\n REST STREAM\r\n MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;\r\n MLSD\r\n AUTH TLS\r\n PBSZ\r\n PROT\r\n TVFS\r\n ESTA\r\n PASV\r\n EPSV\r\n SPSV\r\r\n211 End.\r\n'
[14:31:50] [parser] Response: code=211, buffer='Extensions supported:\r\n EPRT\r\n IDLE\r\n MDTM\r\n SIZE\r\n MFMT\r\n REST STREAM\r\n MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;\r\n MLSD\r\n AUTH TLS\r\n PBSZ\r\n PROT\r\n TVFS\r\n ESTA\r\n PASV\r\n EPSV\r\n SPSV\r\r\nEnd.'
[14:31:50] [connection] > 'TYPE I'
[14:31:50] [connection] < '200 TYPE is now 8-bit binary\r\n'
[14:31:50] [parser] < '200 TYPE is now 8-bit binary\r\n'
[14:31:50] [parser] Response: code=200, buffer='TYPE is now 8-bit binary'
[14:31:50] READY
[14:31:50] MLSD  /public_html
[14:31:50] [connection] > 'PASV'
[14:32:33] ERROR Error: read ETIMEDOUT
    at exports._errnoException (util.js:746:11)
    at TCP.onread (net.js:550:26) (ETIMEDOUT)
[14:32:33] DISC 

@MWalid
Copy link
Author

MWalid commented Jul 29, 2015

@morris I've sent you ftp account to test the issue.

@morris
Copy link
Owner

morris commented Aug 16, 2015

Most likely the server does not allow non-TLS connections, however using TLS also suffers from #26.

@morris morris closed this as completed Aug 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants