morris / vinyl-ftp

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

Error: Write EPIPE #116

Closed DavidLozzi closed 6 years ago

DavidLozzi commented 6 years ago

I've confirmed FileZilla can connect just fine, with similar settings.

Here's my config:

module.exports = {
    FTP_CONNECTION: {
            host: 'x.x.x.x',
            user: 'me',
            pass: 'nunyabiz',
            secure: true,
            secureOptions: {"rejectUnauthorized":false}
        },
    FTP_PATH: '/themes/contrib/'
}

usage in gulp

function ftpCss(){
    var conn = ftp.create(config.FTP_CONNECTION);

    var globs = ['bos365/css/style.css'];
    return gulp.src(globs, { base: '.', buffer: false})
    .pipe(conn.dest(config.FTP_PATH));
}

The output error:

[09:20:22] Error: write EPIPE
    at _errnoException (util.js:992:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:864:14)
[09:20:22] Error in plugin "run-sequence(cssFtp)"
Message:
    write EPIPE
Details:
    code: EPIPE
    errno: EPIPE
    syscall: write

Stack:
Error: write EPIPE
    at _errnoException (util.js:992:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:864:14)
[09:20:22] 'templatesFtp' errored after 537 ms
[09:20:22] Error: write EPIPE
    at _errnoException (util.js:992:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:864:14)
DavidLozzi commented 6 years ago

Hmm so removing the function from runSequence, appears to work as expected. It does FTP up the file. I wrote out the config for further degbugging

VinylFtp {
  config:
   { parallel: 3,
     maxConnections: 5,
     log: null,
     timeOffset: 0,
     idleTimeout: 100,
     password: 'not4you',
     reload: false,
     host: 'x.x.x.x',
     user: 'me',
     pass: 'not4you',
     secure: true,
     secureOptions: { rejectUnauthorized: false } },
  queue: [],
  connectionCount: 0,
  idle: [],
  idleTimer: null }
DavidLozzi commented 6 years ago

Fixed it! I had 2 functions making FTP connections, and each one had it's own var conn =.. so I made it global and removed it from the two and it works fine now! Something odd with running these tasks in parallel, but this works now.