node-ftp icon indicating copy to clipboard operation
node-ftp copied to clipboard

ECONNRESET Error using ftp

Open StuartMorris0 opened this issue 10 years ago • 15 comments

Hello,

I am experiencing an issue on one windows machine trying to use node-ftp. The issue appears to be network related, as I can complete this on another machine without issue.

The script I am using is the following:

var FTP = require( 'ftp' );
var client = new FTP();

client.on( 'ready', onReady );

function onReady() {
    client.list( '/', onList );
}

function onList( err, list ) {
    if ( err ) console.log( err.stack );
    else console.log( list );
}

client.connect( {
    user: '',
    password: '',
    host: '',
    debug: console.log.bind( console )
} );

The error is shown here: nodeftperror

FileZilla on the same machine with the same setup seems to work without issue.

Is there anything that could be causing this?

Thanks

StuartMorris0 avatar Aug 18 '15 14:08 StuartMorris0

+1 for this, getting the same error

PinkPandaAU avatar Sep 25 '15 04:09 PinkPandaAU

+1, got similar issues from a Linux server. Our Node.js script is launched daily with cron, and I often got the same ECONNRESET error.

igabesz avatar Sep 30 '15 16:09 igabesz

+1 as I get the same error using any gulp, grunt plugins using the node-ftp module

SubZane avatar Oct 20 '15 14:10 SubZane

+1

leggomuhgreggo avatar Apr 06 '16 14:04 leggomuhgreggo

Seems this happening when node code behind certain firewall, such as dell's sonicwall. Set socket keep alive to false should fix this problem.

connection.js line 106 socket.setKeepAlive(false);

Add an option would be nice.

ruiwei avatar Apr 26 '16 13:04 ruiwei

+1 same error, it make the library unusable

michalhudecek avatar May 26 '16 12:05 michalhudecek

+1

CcHard avatar Aug 25 '16 08:08 CcHard

+1 same error

radiocold avatar Nov 21 '16 17:11 radiocold

+1 same error

Only on specific networks. I was only able to solve it by using with my private VPN 😔

lajlev avatar Nov 24 '16 13:11 lajlev

I get this same error when downloading a large file via FTP.

bllevy avatar Apr 21 '17 20:04 bllevy

+1, same error, but sometimes it works

read ECONNRESET { Error: read ECONNRESET at _errnoException (util.js:1022:11) at TCP.onread (net.js:615:25) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }

gabrielCortesReyes avatar Apr 12 '18 15:04 gabrielCortesReyes

I was having the same problem, but after this command every all its okay now :

npm install @ionic/app-scripts@nightly --save-dev

matheusrolima avatar May 15 '18 16:05 matheusrolima

I have a problem when I connect localhost using FTP server. Give me suggestions

err { Error: connect ECONNREFUSED 127.0.0.1:21 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14) errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 21 }

I am also changing port but it not work.

sagardere avatar Nov 20 '18 11:11 sagardere

You have to put pass "pasv_url" value to its constructor :

const ftpServer = new FtpSrv({ url:'ftp://' + '127.0.0.1' + ':' + '21', pasv_url:'0.0.0.0', anonymous: true }); it's work for me .

vestige06 avatar Jun 10 '19 08:06 vestige06

My application connects to a filezilla server to perform a put method. The file appears on the server without issue, but I always see this error: read ECONNRESET. The server and my client application are on the same LAN. The keepalive false suggestion has no effect for me.

Robguzi avatar Sep 17 '19 16:09 Robguzi