gulpvinyl-ftp

Vinyl-ftp strange error


I am using Vinyl-ftp to do deployment, when i try to connect with FileZilla or Total Commander everything works ok, but when i try wirh Gulp task i got strange error, i dont see the difference, here is my Gulp task and error message

gulp.task('ftp-test-connection', function () {


var conn = ftp.create({
    host: 'hostname',
    user: 'user',
    password: 'password',
    parallel: 10,
    log: gutil.log
});

var globs = [
      './styles/**/*{css,png,jpg,gif,ttf,woff,eof,svg,woff2}',
      './images/**',
      './views/**',
      './scripts/vendor.scripts.min.js',
      './dist/index.html',
      './dist_test/main.scripts.min.js',
      './dist_test/web.config'
];

return gulp.src(globs, { base: '.', buffer: false })
    .pipe(gulpIf('dist/index.html', rename({ dirname: '' })))
    .pipe(gulpIf('dist/web.config', rename({ dirname: '' })))
    .pipe(gulpIf('dist_test/main.scripts.min.js', rename({ dirname: '/scripts' })))
    .pipe(conn.newer('/site/wwwroot'))
    .pipe(conn.dest('/site/wwwroot'));

});

And here is my error **

[11:31:59] ERROR Error: User cannot log in.
    at makeError (C:\node_modules\vinyl-ftp\node_modules\ftp\lib\connection.js:1067:13)
    at Parser.<anonymous> (C:\node_modules\vinyl-ftp\node_modules\ftp\lib\connection.js:113:25)
    at emitTwo (events.js:87:13)
    at Parser.emit (events.js:172:7)
    at Parser._write (C:\node_modules\vinyl-ftp\node_modules\ftp\lib\parser.js:59:10)
    at doWrite (_stream_writable.js:292:12)
    at writeOrBuffer (_stream_writable.js:278:5)
    at Parser.Writable.write (_stream_writable.js:207:11)
    at Socket.ondata (C:\node_modules\vinyl-ftp\node_modules\ftp\lib\connection.js:273:20)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at Socket.Readable.push (_stream_readable.js:110:10)
    at TCP.onread (net.js:523:20) (530)
Process terminated with code 1.

**


Solution

  • I faced the same issue with "vinyl-gulp" and Azure App Services (a.k.a. Azure Web Sites).

    In my case the problem was caused by the "\" character contained on the Azure FTP username. I just had to double the "\" (ex: "someuser\$someuser") to solve the issue.

    I hope it helps...

    M.