FEAT命令后Gulp Vinyl FTP ECONNRESET错误

时间:2017-11-08 14:46:27

标签: ftp gulp

我正在尝试使用gulp-vinyl-ftp插件上传到远程站点。

gulp.task("deploy", ["default"], function () {

    var conn = ftp.create({
        host: "mywebsite",
        user: "****",
        password: "******",
       // secure: true,
      timeOffset: -301,
       parallel: 1,
       debug: gutil.log
    });    

    var globs = [
        "distr/**/*.php",
        "!out/vendor/**",
        "!out/config.php",
        "out/**/*.map",
        "out/**/*.css",
        "out/**/*.js"
    ];
    return gulp.src(globs)
        .pipe(conn.newer("/")).pipe(debug({ title: "Deploy New: " }))

});

但是,我收到以下错误:

events.js:182
  throw er; // Unhandled 'error' event
  ^

Error: read ECONNRESET
    at exports._errnoException (util.js:1016:11)
    at TCP.onread (net.js:609:25)

调试输出如下:

[08:37:28] [connection] < '220 Microsoft FTP Service\r\n'
[08:37:28] [parser] < '220 Microsoft FTP Service\r\n'
[08:37:28] [parser] Response: code=220, buffer='Microsoft FTP Service'
[08:37:28] [connection] > 'USER xxx'
[08:37:29] [connection] < '331 Password required\r\n'
[08:37:29] [parser] < '331 Password required\r\n'
[08:37:29] [parser] Response: code=331, buffer='Password required'
[08:37:29] [connection] > 'PASS xxxx'
[08:37:29] [connection] < '230 User logged in.\r\n'
[08:37:29] [parser] < '230 User logged in.\r\n'
[08:37:29] [parser] Response: code=230, buffer='User logged in.'
[08:37:29] [connection] > 'FEAT'

结束那里。

但是,我可以通过WinSCP轻松连接。

. 2017-11-08 08:36:24.161 Connecting to mywebsite ...
. 2017-11-08 08:36:24.192 Connected with  mywebsite. Waiting for welcome message...
< 2017-11-08 08:36:24.285 220 Microsoft FTP Service
> 2017-11-08 08:36:24.285 USER xxxx
< 2017-11-08 08:36:24.379 331 Password required
> 2017-11-08 08:36:25.861 PASS ********
< 2017-11-08 08:36:25.970 230 User logged in.
> 2017-11-08 08:36:25.970 SYST
. 2017-11-08 08:36:26.064 The server is probably running Windows, assuming that directory listing timestamps are affected by DST.
< 2017-11-08 08:36:26.064 215 Windows_NT
> 2017-11-08 08:36:26.064 FEAT
< 2017-11-08 08:36:26.157 211-Extended features supported:
< 2017-11-08 08:36:26.157  LANG EN*
< 2017-11-08 08:36:26.157  UTF8
< 2017-11-08 08:36:26.157  AUTH TLS;TLS-C;SSL;TLS-P;
< 2017-11-08 08:36:26.157  PBSZ
< 2017-11-08 08:36:26.157  PROT C;P;
< 2017-11-08 08:36:26.157  CCC
< 2017-11-08 08:36:26.157  HOST
< 2017-11-08 08:36:26.157  SIZE
< 2017-11-08 08:36:26.157  MDTM
< 2017-11-08 08:36:26.157  REST STREAM
< 2017-11-08 08:36:26.157 211 END
> 2017-11-08 08:36:26.157 OPTS UTF8 ON
< 2017-11-08 08:36:26.251 200 OPTS UTF8 command successful - UTF8 encoding now ON.
. 2017-11-08 08:36:26.298 Connected

我在主机字段中尝试了IP地址和域名,注释掉了timeOffset和并行选项。

我不确定从哪里可以诚实地离开这里;任何建议将不胜感激。

感谢。

1 个答案:

答案 0 :(得分:1)

在收到FEAT命令后,您会发现很多关于IIS的帖子神秘地(并且不一致)关闭了连接。

我还没有找到任何明确的解决方案,但是工作解决方法似乎是拒绝FEAT命令(如果Gulp可以处理)。

在IIS管理器中,转到 FTP&gt; FTP请求过滤&gt;命令选项卡&gt;行动&gt;拒绝命令并输入FEAT

另见Microsoft FTP fails to connect after the client requests the list of features (FEAT)