Fix econnrefused, the data connection could not be established

     

jdomain.vn Answers was designed khổng lồ reduce the constant googling that comes with debugging 3rd các buổi tiệc nhỏ libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

Bạn đang xem: Fix econnrefused, the data connection could not be established

And, if you’re still stuck at the end, we’re happy to lớn hop on a hotline to see how we can help out.


The data connection could not be established: ECONNREFUSED - Connection refused by server

See original GitHub issue

Using the test.js example & attempting khổng lồ connect to lớn the vps from Filezilla I am getting the response:

Error: The data connection could not be established: ECONNREFUSED - Connection refused by server

After the menu command is issued. On the vps it looks lượt thích this:

FTP command: LISTDirectory has 0 filesCurrently no data connection; expecting client khổng lồ connect to pasv vps shortly...What would be causing this?


*
Top GitHub Comments


What would be causing this?

My guess: firewall rules. Vì you see in the log which port was used for PASV? If not, limit the PASV port range to lớn very few ports (dunno if 1 is enough). Then try opening any kind of server (e.g. Netcat) on these port(s) and check whether you can connect there.

Xem thêm: Cách Đăng Nhập Outlook 2013, Hướng Dẫn Cài Đặt Mail Trên Outlook 2013


OK I think I found what was not working. I write it here lớn help other in my situation…

First, my configuration :

Windows 7 ProNode 4.4.4npm 4.1.2

First of all, I was using the test.js configuration example :

pasvPortRangeStart: 1025, pasvPortRangeEnd: 1050}Then I had to confirm that the pasv selected port was not in used by other system services. So using the command netstat -abn > d:ftpd-test-port.txt give me interesting result

WcesComm TCP 0.0.0.0:1025 0.0.0.0:0 LISTENING TCP 0.0.0.0:1026 0.0.0.0:0 LISTENING eventlog TCP 0.0.0.0:1027 0.0.0.0:0 LISTENINGA lot of conflicts, there is the ActiveSync (Windows CE Synchronization & Communication Manager), wininit.exe và IIS.

This is not mention in the readme but when looking at the source code, we can mix null lớn port range & this will let the OS choose a không tính phí port,

pasvPortRangeStart: null, pasvPortRangeEnd: null}Now this is working properly.

BUT, looking at the source code of ftpd there a demo loop until we get a không tính phí port but what I’m not sure lớn understand is : If the port choose by ftpd (in specifed range 1025-1050) was not không tính phí (EADDRINUSE) then the loop should try another one a so one until we get free one or we exhausted the range… so why I’m getting a kind of freeze (Currently no data connection; expecting client lớn connect to lớn pasv server shortly…) ? It is a ftpd bug ?


Chuyên mục: Domain Hosting