Open aviynw opened 10 years ago
Can you show the code you're using and what proftpd version is this, just in case?
Thanks for the quick reply! The proftp version is 1.3.5. I actually had it working yesterday, and am not sure what changed. But come to think of it, I had been using a precompiled binary package for proftp yesterday before deciding to compile it from source. I thought I tested it after compiling from source as well, but its possible I only tested it with filezilla and not with my node program. So maybe I'm just missing a necessary proftp module?
The modules I have are
mod_core.c
mod_xfer.c
mod_rlimit.c
mod_auth_unix.c
mod_auth_file.c
mod_auth.c
mod_ls.c
mod_log.c
mod_site.c
mod_delay.c
mod_facts.c
mod_ident.c
mod_auth_pam.c
mod_deflate.c
I'm comparing them to whats listed here, http://www.proftpd.org/docs/modules/index.html , maybe there's something I need? The connection that filezilla successfully makes is also a passive one, so its not that my server can only make active connections which was one of my early thoughts.
Anyways, here is the relevant section from my code. The "_" object has all the appropriate properties. I logged them and quadruple checked.
.connection.on('ready', function() { .connection.list(function(e, list) { if (e) { throw e } else{ console.log('SUCESS! ' +list); } }); });
_.connection.on('error', function(e) {
throw e;
});
var obj={
host: _.host,
port: Number(_.port),
user: _.user,
password: _.password,
};
_.connection.connect(obj);
The exact Error is: ^
Error: Unable to parse PASV server response
at Object.reentry as cb
at Parser.
Can you set debug: console.log
in the object passed to connect()
and post the output somewhere (be sure to remove/mask sensitive information)?
Yes, here is the output. I haven't had a chance to see if playing with the proftp modules makes a difference. If it will help I can also set up a user for you to test on my server. Thanks.
DEBUG: [connection] < '220 you\'re at home\r\n' DEBUG: [parser] < '220 you\'re at home\r\n' DEBUG: [parser] Response: code=220, buffer='you\'re at home' DEBUG: [connection] > 'USER USERNAME_REMOVED' DEBUG: [connection] < '220 you\'re at home\r\n' DEBUG: [parser] < '220 you\'re at home\r\n' DEBUG: [parser] Response: code=220, buffer='you\'re at home' DEBUG: [connection] > 'FEAT' DEBUG: [connection] < '220 you\'re at home\r\n' DEBUG: [parser] < '220 you\'re at home\r\n' DEBUG: [parser] Response: code=220, buffer='you\'re at home' DEBUG: [connection] > 'TYPE I' DEBUG: [connection] < '220 you\'re at home\r\n' DEBUG: [parser] < '220 you\'re at home\r\n' DEBUG: [parser] Response: code=220, buffer='you\'re at home' DEBUG: [connection] > 'PASV' DEBUG: [connection] < '331 Password required for userftp\r\n'
Can you try the master branch now?
So, it now looks like its getting passed the authentication! But it still throws an error in the exact same place. The output is now
DEBUG: [connection] < '220 you\'re at home\r\n' DEBUG: [parser] < '220 you\'re at home\r\n' DEBUG: [parser] Response: code=220, buffer='you\'re at home' DEBUG: [connection] > 'USER USERNAME_REMOVED' DEBUG: [connection] < '220 you\'re at home\r\n' DEBUG: [parser] < '220 you\'re at home\r\n' DEBUG: [parser] Response: code=220, buffer='you\'re at home' DEBUG: [connection] > 'PASS PASSWORD REMOVED' DEBUG: [connection] < '220 you\'re at home\r\n' DEBUG: [parser] < '220 you\'re at home\r\n' DEBUG: [parser] Response: code=220, buffer='you\'re at home' DEBUG: [connection] > 'FEAT' DEBUG: [connection] < '220 you\'re at home\r\n' DEBUG: [parser] < '220 you\'re at home\r\n' DEBUG: [parser] Response: code=220, buffer='you\'re at home' DEBUG: [connection] > 'TYPE I' DEBUG: [connection] < '331 Password required forUSERNAME_REMOVED\r\n' DEBUG: [parser] < '331 Password required forUSERNAME_REMOVED\r\n' DEBUG: [parser] Response: code=331, buffer='Password required for USERNAME_REMOVED' DEBUG: [connection] > 'PASV' DEBUG: [connection] < '230 welcome !!!\r\n'
Error is:
Error: Unable to parse PASV server response
at Object.reentry as cb
at Parser.
This client library also throws this same error while using npm ftpd as a server. Both these things would be great for testing and should totally work together. https://www.npmjs.com/package/ftpd
Is this fixed? I am also getting this error....intermittently
@samkohli Can you post your debug output?
@phishy If you have have debug output, can you post it too?
Hi, I am also facing the same issue in the 'c.list' and 'c.put' methods. My code is given below:
c.on('ready', function() {
c.list('/monthly_stmt/',0,function(errftp,dataftp){
if (errftp){
console.log(errftp);
}
else{
console.log(dataftp);
}
});
});
c.connect(config);
Error: Unable to parse PASV server response
at Object.reentry [as cb] (/Users/kadasiddha/Documents/Documents/Backend/node_modules/ftp/lib/connection.js:857:19)
at Parser.
I met this issue today. For my case, its due to network ip.
Server log:
39.106.123.123:41678-[testuser] Rejected data connection from foreign address 172.17.135.124:39686.
Client log:
[Error] ftp disconnet!
[Error][uploadFtpAsync] Error: Unable to parse PASV server response
at Object.reentry [as cb] (/usr/share/nginx/html/data-center-admin/node_modules/ftp/lib/connection.js:857:19)
at Parser.<anonymous> (/usr/share/nginx/html/data-center-admin/node_modules/ftp/lib/connection.js:117:20)
at emitTwo (events.js:126:13)
at Parser.emit (events.js:214:7)
at Parser._write (/usr/share/nginx/html/data-center-admin/node_modules/ftp/lib/parser.js:59:10)
at doWrite (_stream_writable.js:396:12)
at writeOrBuffer (_stream_writable.js:382:5)
at Parser.Writable.write (_stream_writable.js:290:11)
at Socket.ondata (/usr/share/nginx/html/data-center-admin/node_modules/ftp/lib/connection.js:273:20)
at emitOne (events.js:116:13)
Error: Unable to parse PASV server response
at Object.reentry [as cb] (/usr/share/nginx/html/data-center-admin/node_modules/ftp/lib/connection.js:857:19)
at Parser.<anonymous> (/usr/share/nginx/html/data-center-admin/node_modules/ftp/lib/connection.js:117:20)
at emitTwo (events.js:126:13)
at Parser.emit (events.js:214:7)
at Parser._write (/usr/share/nginx/html/data-center-admin/node_modules/ftp/lib/parser.js:59:10)
at doWrite (_stream_writable.js:396:12)
at writeOrBuffer (_stream_writable.js:382:5)
at Parser.Writable.write (_stream_writable.js:290:11)
at Socket.ondata (/usr/share/nginx/html/data-center-admin/node_modules/ftp/lib/connection.js:273:20)
at emitOne (events.js:116:13)
39.106.123.123 is the public internet ip of ftp client machine and 172.17.135.124 is the local area network ip of ftp client machine. Ftp client and server are in the same local area network. I create the connetion using FTP server's public internet ip. And then transport data, received the above error, seems it's due to data trasporting using local area network ip. Connection ip is different to data transport ip. So rejected by server.
Fixed by changing connection ip to local area network ip.
I had the same issue when setting the host to localhost
Fixed by using 127.0.0.1
It's like that with me too sometimes, is there a solution to this?
It's like that with me too sometimes, is there a solution to this?
In my case, this problem occurred due to an attempt to transfer files in parallel (accidentally). Just don't do that :)
Indeed it happened to me because I transferred files at the same time There is no possibility to transfer files at the same time?
Indeed it happened to me because I transferred files at the same time There is no possibility to transfer files at the same time?
Nope. But you can create multiple clients and share files for sending
Indeed it happened to me because I transferred files at the same time There is no possibility to transfer files at the same time?
Nope. But you can create multiple clients and share files for sending
Can you write an example please?
Can you write an example please?
It all depends on your task. Such logic can be very complex depending on the capabilities of the server: someone allows many connections from one client, and someone restricts it. To implement complex logic, I would recommend switching to lftp - it takes on a lot of complexity.
if you are using internet with jio sim , then you will have to change your sim APN setting ,replace with www.google.com or JioNet
I'm getting "Unable to parse PASV server response" when I try to run any command (get/put/list). Everything is running fine when I run a number of other ftp programs like filezilla.
Here is the output in my server log which is running proftp.
"IP ADDRESS" UNKNOWN - [15/Aug/2014:19:03:22 +0000] "USER userftp" 331 - "IP ADDRESS" UNKNOWN - [15/Aug/2014:19:03:22 +0000] "FEAT" - - "IP ADDRESS" UNKNOWN - [15/Aug/2014:19:03:22 +0000] "TYPE I" 200 - "IP ADDRESS" UNKNOWN - [15/Aug/2014:19:03:22 +0000] "TYPE A" 200 - "IP ADDRESS" UNKNOWN - [15/Aug/2014:19:03:22 +0000] "TYPE A" 200 - "IP ADDRESS" UNKNOWN - [15/Aug/2014:19:03:23 +0000] "PASV" 530 -
And here is my output for a successful connection from filezilla
"IP ADDRESS" UNKNOWN userftp [15/Aug/2014:19:03:12 +0000] "PASS (hidden)" 230 - "IP ADDRESS" UNKNOWN userftp [15/Aug/2014:19:03:13 +0000] "SYST" 215 - "IP ADDRESS" UNKNOWN userftp [15/Aug/2014:19:03:13 +0000] "FEAT" - - "IP ADDRESS" UNKNOWN userftp [15/Aug/2014:19:03:13 +0000] "PWD" 257 - "IP ADDRESS" UNKNOWN userftp [15/Aug/2014:19:03:13 +0000] "TYPE I" 200 - "IP ADDRESS" UNKNOWN userftp [15/Aug/2014:19:03:13 +0000] "PASV" 227 - "IP ADDRESS" UNKNOWN userftp [15/Aug/2014:19:03:13 +0000] "MLSD" 226 221
I'm not sure the best way to debug. Any help would be appreciated. Looking at the server logs it looks like it might not not be sending the password? There is no log for a "PWD" command like there is for the filezilla request.
Thanks.