morris / vinyl-ftp

Blazing fast vinyl adapter for FTP
Other
388 stars 31 forks source link

ECONNRESET #95

Open Emdot opened 7 years ago

Emdot commented 7 years ago

I'm trying to set up a gulp task using vinyl-ftp, but I keep getting ECONNRESET before it gets to the files. I can connect just fine with FileZilla. I'd initially assumed a configuration problem, but at this point it's looking more like a bug.

var connection = ftp.create({
    host: "myhostname.com",
    user: "myuser",
    password: "mypassword",
    parallel: 1,
    debug: gutil.log,
    log: gutil.log
    //secure: true
});
var remote = "myremotepath";

return gulp.src('./out/**', { base: '.', buffer: false })
    //.pipe(connection.newer(remote))
    .pipe(connection.dest(remote))
    ;

That yields:

[13:11:42] Starting 'publish'...
[13:11:42] CONN
[13:11:42] [connection] < '220 Microsoft FTP Service\r\n'
[13:11:42] [parser] < '220 Microsoft FTP Service\r\n'
[13:11:42] [parser] Response: code=220, buffer='Microsoft FTP Service'
[13:11:42] [connection] > 'USER myuser'
[13:11:42] [connection] < '331 Password required for myuser.\r\n'
[13:11:42] [parser] < '331 Password required for myuser.\r\n'
[13:11:42] [parser] Response: code=331, buffer='Password required for myuser.'
[13:11:42] [connection] > 'PASS mypassword'
[13:11:43] [connection] < '230-FTP-SSL (AUTH TLS, Explicit FTPS or FTPES) security is available\r\n230 User logged in.\r\n'
[13:11:43] [parser] < '230-FTP-SSL (AUTH TLS, Explicit FTPS or FTPES) security is available\r\n230 User logged in.\r\n'
[13:11:43] [parser] Response: code=230, buffer='FTP-SSL (AUTH TLS, Explicit FTPS or FTPES) security is available\r\nUser logged in.'
[13:11:43] [connection] > 'FEAT'
[13:11:53] ERROR Error: read ECONNRESET
    at exports._errnoException (util.js:856:11)
    at TCP.onread (net.js:546:26) (ECONNRESET)
[13:11:53] DISC
[13:11:53] 'publish' errored after 11 s
[13:11:53] Error: read ECONNRESET
    at exports._errnoException (util.js:856:11)
    at TCP.onread (net.js:546:26)

With FileZilla the connect uses TLS, so I also tried with secure: true. Then I get:

[13:19:23] Starting 'publish'...
[13:19:23] CONN
[13:19:23] [connection] < '220 Microsoft FTP Service\r\n'
[13:19:23] [parser] < '220 Microsoft FTP Service\r\n'
[13:19:23] [parser] Response: code=220, buffer='Microsoft FTP Service'
[13:19:23] [connection] > 'AUTH TLS'
[13:19:24] [connection] < '234 AUTH command ok. Expecting TLS Negotiation.\r\n'
[13:19:24] [parser] < '234 AUTH command ok. Expecting TLS Negotiation.\r\n'
[13:19:24] [parser] Response: code=234, buffer='AUTH command ok. Expecting TLS Negotiation.'
[13:19:34] ERROR Error: read ECONNRESET
    at exports._errnoException (util.js:856:11)
    at TLSWrap.onread (net.js:546:26) (ECONNRESET)
[13:19:34] DISC
[13:19:34] 'publish' errored after 10 s
[13:19:34] Error: read ECONNRESET
    at exports._errnoException (util.js:856:11)
    at TLSWrap.onread (net.js:546:26)

It looks like something's timing out somewhere, but I'm not sure what to do about it. For comparison, here's what I get from FileZilla, which does work.

Status: Connection established, waiting for welcome message...
Response:   220 Microsoft FTP Service
Command:    AUTH TLS
Response:   234 AUTH command ok. Expecting TLS Negotiation.
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
Command:    USER myuser
Response:   331 Password required for myuser.
Command:    PASS mypassword
Response:   230-FTP-SSL (AUTH TLS, Explicit FTPS or FTPES) security is available
Response:   230 User logged in.