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

Problem with DISC on uploading

Open naymapl opened this issue 7 years ago • 4 comments

Hi.

I have settings like this:

var user = "...";
var password = "...";
var host = "...";
var port = 21;
var localFilesGlob = ['dist/**/*'];
var remoteFolder = '/websites/doopaaaa/'

function getFtpConnection() {
    return ftp.create({
        host: host,
        port: port,
        user: user,
        password: password,
        parallel: 6,
        maxConnections: 6,
        reload : true,
        log: $.util.log
    });
}

then the gulp function:

gulp.task('upload', function() {

  $.util.log($.util.colors.yellow("Coping new files on FTP..."));

    var conn = getFtpConnection();

    return gulp.src(localFilesGlob, {base: 'dist/', buffer: false })
        .pipe( conn.newer( remoteFolder ) ) 
        .pipe( conn.dest( remoteFolder ) );
});

And sometimes page upload in 1-2 sec and sometimes stuck like that:

gulp upload
[14:44:47] Using gulpfile ~/Projekty/doopa/gulpfile.js
[14:44:47] Starting 'upload'...
[14:44:47] Coping new files on FTP...
[14:44:47] CONN
[14:44:47] READY
[14:44:47] MLSD  /websites/doopaaaa
[14:44:47] MLSD  /websites
[14:44:47] CONN
[14:44:47] CONN
[14:44:47] MLSD  /
[14:44:47] MKDIR /websites/doopaaaa
[14:44:47] READY
[14:44:47] MLSD  /websites/doopaaaa/css
[14:44:47] READY
[14:44:47] MLSD  /websites/doopaaaa/fonts
[14:44:47] PUT   /websites/doopaaaa/analitycs.php
[14:44:47] CONN
[14:44:47] CONN
[14:44:47] CONN
[14:44:47] MKDIR /websites/doopaaaa/fonts
[14:44:47] MKDIR /websites/doopaaaa/img
[14:44:47] UP    100% /websites/doopaaaa/analitycs.php
[14:44:47] MLSD  /websites/doopaaaa/js
[14:44:47] MLSD  /websites/doopaaaa/img
[14:44:47] MKDIR /websites/doopaaaa/js
[14:44:47] READY
[14:44:47] PUT   /websites/doopaaaa/index-1.html
[14:44:47] READY
[14:44:47] PUT   /websites/doopaaaa/index.html
[14:44:47] READY
[14:44:47] MKDIR /websites/doopaaaa/css
[14:44:48] PUT   /websites/doopaaaa/robots.txt
[14:44:48] PUT   /websites/doopaaaa/css/style.css
[14:44:48] PUT   /websites/doopaaaa/fonts/FontAwesome.otf
[14:44:48] UP    100% /websites/doopaaaa/index-1.html
[14:44:48] UP    100% /websites/doopaaaa/index.html
[14:44:48] UP    100% /websites/doopaaaa/robots.txt
[14:44:48] UP     34% /websites/doopaaaa/css/style.css
[14:44:48] UP     69% /websites/doopaaaa/css/style.css
[14:44:48] UP    100% /websites/doopaaaa/css/style.css
[14:44:48] UP     48% /websites/doopaaaa/fonts/FontAwesome.otf
[14:44:48] UP     97% /websites/doopaaaa/fonts/FontAwesome.otf
[14:44:48] UP    100% /websites/doopaaaa/fonts/FontAwesome.otf
[14:44:48] DISC
[14:44:48] DISC
[14:44:48] DISC
[14:44:48] DISC
[14:44:48] DISC

Have no idea why is runing well sometimes and sometimes stuck and need to quit task by CTRL+C.

Do you have any ideas what is wrong ??

naymapl avatar Mar 11 '17 13:03 naymapl

I`m testing that on few FTP and everywhere I had this same issue. 2-3 times evrything upload well and sometimes on upload stuck on DISC and stop uploading.

naymapl avatar Mar 11 '17 15:03 naymapl

The pool opens 6 connections but only closes 5. I'm unsure how this is possible right now. Have you tried using parallel < 6? Also, are you sure you need reload: true? This definitely looks like a bug, but if changing parallel or reload remedies the issue this would also help in finding the bug's cause. Thanks for reporting 🍰

morris avatar Mar 12 '17 12:03 morris

I have a similiar issue. Not sure if it is the servers fault, but the connections close at random points of time and not all files are uploaded. Maybe vynil-ftp could attempt to reopen those closed connections?

johannesjo avatar Jul 10 '18 13:07 johannesjo

Same problem here. And I don't know why that happen too. It would be useful to know if this problem is caused by the server. Does anyone find out how to bypass this failure?

patrickeller avatar Dec 18 '18 12:12 patrickeller