【问题标题】:Gulp Vinyl FTP ECONNRESET error after FEAT commandFEAT 命令后 Gulp Vinyl FTP ECONNRESET 错误
【发布时间】:2017-11-09 22:08:54
【问题描述】:

我正在尝试使用 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 和并行选项。

老实说,我不确定从这里去哪里;任何建议将不胜感激。

谢谢。

【问题讨论】:

    标签: ftp gulp


    【解决方案1】:

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

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

    在 IIS 管理器中,转到 FTP > FTP 请求过滤 > 命令选项卡 > 操作 > 拒绝命令 并输入 FEAT

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

    【讨论】:

    • 非常感谢。不幸的是,我对该网站的服务器访问权限非常有限,但我会看看我能做些什么。非常感谢您至少为我指明了正确的方向;我不会怀疑 IIS 的“奇怪之处”是促成因素。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-09
    • 2018-05-06
    • 2014-07-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-14
    相关资源
    最近更新 更多