当前位置:   article > 正文

node上传文件到FTP服务器报Error: Timed out while making data connection_vscode ftp-sync: listing failed: error: timed out

vscode ftp-sync: listing failed: error: timed out while making data connecti

错误原因

在局域网内搭建了一个FTP服务器,因为项目使用node-ftp封装的一个FTP文件上传和下载服务,在上传文件的时候报如下错误:

(node:29020) UnhandledPromiseRejectionWarning: Error: Timed out while making data connection
at Timeout. (D:\git project\nexrender\packages\nexrender-provider-ftp\node_modules\ftp\lib\connection.js:901:12)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
(Use node --trace-warnings ... to show where the warning was created)
(node:29020) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:29020) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

问题分析

  1. 在服务器上开放了21端口
  2. 在本地使用cmd连接ftp服务是能够正常连接和上传下载文件的

解决办法

关闭防火墙,服务器是CentOS7,关闭的步骤如下

#查看防火墙开放的端口
firewall-cmd --list-ports
#8008/tcp 21/tcp 80/tcp
#查看防火墙的状态
firewall-cmd --state
#running
#关闭防火墙
systemctl stop firewalld
#查看防火墙状态
firewall-cmd --state
#not running
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/69087
推荐阅读
相关标签
  

闽ICP备14008679号