liximomo / vscode-sftp

Super fast sftp/ftp extension for VS Code
MIT License
1.51k stars 265 forks source link

Getting ECONNRESET on FTP connect #309

Open ghost opened 6 years ago

ghost commented 6 years ago

Expected Behavior

Connecting without problems to the host.

Actual Behavior

Receiving ECONNRESET error.

Steps to Reproduce the Problem

  1. Configure FTP
  2. Trying to connect but got "230-Your bandwidth usage is restricted\r\n230 OK. Current restricted directory is /". I'm talking about a GoDaddy account here.
  3. It works using other editors or using other ftp plugins for VS Code editor, but with this plugin it's not working. Other FTP accounts work.

Specifications

Requisites (important to diagnose the problem!)

My current connection

{ "name": "MyName", "protocol": "ftp", "host": "MyHostName", "port": 21, "username": "MyUsername", "password": "MyPassword", "remotePath": "/", "connectTimeout": 20000
}

Output connect info

[info] config at d:\asd {"remotePath":"/","uploadOnSave":false,"downloadOnOpen":false,"syncMode":"update","ignore":[],"concurrency":4,"protocol":"ftp","connectTimeout":20000,"interactiveAuth":false,"secure":false,"passive":false,"port":21,"name":"MyName","host":"MyHostName","username":"MyUsername","password":"MyPassword","context":"d:\asd"}

ghost commented 6 years ago

Just discussed with GoDaddy guys about it and it's not a problem from them. As I said, it works with FileZilla and with other FTP plugins for VS Code.

liximomo commented 6 years ago

The problem is that a list command is failed because your server has a bandwidth restriction for all FTP connections to the server. I think this will still happen if you try to list your remote dir with other FTP plugins for vscode.

ghost commented 6 years ago

Ok, but I tried to connect with Filezilla, WinSCP, Atom, Notepad++, Php Storm, VSCode with ftp-sync, ftp-simple plugins and they are all working.

What can I do? Should I increase the bandwidth or check something else?

liximomo commented 6 years ago

What actually have you done with sftp. How to trigger this error?

ghost commented 6 years ago
  1. Created a directory on my disk and loaded that directory in VSCode.
  2. Inside that directory, I pressed F1, hit SFTP: Config
  3. Configured sftp.json file as I presented above on "My Current Connection" sub-section
  4. Got timeout error while connecting to server and that's why I added 20000 instead of 10000
  5. After that I got ECONNRESET error and by enabling debug, I got the following error: "230-Your bandwidth usage is restricted\r\n230 OK. Current restricted directory is /".
  6. Discussed with GoDaddy guys about it, but everything is working fine on any other FTP connect.
liximomo commented 6 years ago

Can you provide the full logs?

ghost commented 6 years ago

This is strange. I tried on different computer and it works. I don't think there's something which should be set up on the computer, right?

On my personal computer, where it's not working, I reinstalled the extension for a couple of times, I removed all FTP connections from that IP to not fall into "Too many connections from this IP" error and also I switched connections to mobile hotspot, thinking that maybe there was some errors regarding the the network.

ghost commented 6 years ago

I'll try in couple of hours on my personal computer again. On question until then, a little bit off-topic maybe.

The "name" parameter shouldn't change the main folder name which is showed in the Remote Explorer? Everytime is showed in there the name of the last directory from the "remotePath" parameter. If I have "/home/dev", I'll have "dev" in there, if I have just "/", then the folder name is empty and it's a little bit annoying, considering that I have around 10-15 ftp connections and a couple of them have no folder name.

ghost commented 6 years ago

Just tried on my personal computer with the same settings used earlier, but same error message. Also, I tried using my mobile phone hotspot, through cable and also using another laptop, but same error.

I have no explanation for this. Just installed again WinSCP, Filezilla and works like a charm.

Below is a screenshot with the full output. https://drive.google.com/file/d/1aBWWawlP6JH0EtTLaIgvTTWxklRD9hMA/view?usp=sharing

liximomo commented 6 years ago

I didn't see anything wrong in the logs. I don't think this is a full output.

ghost commented 6 years ago

The full output is exactly as I posted above. Here I attach it again:

[info] config at c:\Users\Iulian\Downloads\Test {"remotePath":"/","uploadOnSave":false,"downloadOnOpen":false,"syncMode":"update","ignore":[],"concurrency":4,"protocol":"ftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"passive":false,"port":21,"name":"Test","host":"MyHostName","username":"**","password":"**","context":"c:\Users\Iulian\Downloads\Test"} [debug] < 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------\r\n220-You are user number 4 of 500 allowed.\r\n220-Local time is now 11:57. Server port: 21.\r\n220-This is a private system - No anonymous login\r\n220 You will be disconnected after 15 minutes of inactivity. [debug] > USER MyUserName [debug] < 331 User MyUserName OK. Password required [debug] > PASS **

liximomo commented 6 years ago

@klopp1892 I don't see ECONNRESET in the log. How did you know there is a ECONNRESET error?

ghost commented 6 years ago

That's because with the previous configuration, it gives a timeout error due to 10000 connectionTimeout value. If I change that value to 20000 and try to connect again, connectionTimeout error dissapears and the ECONNRESET error appears, with the following error: 230-Your bandwidth usage is restricted\r\n230 OK. Current restricted directory is /.

liximomo commented 6 years ago

Try to close the firewall in your computer.

ghost commented 6 years ago

Still not working with closed firewall.

ghost commented 6 years ago

Does it have something about passive mode maybe?

sassoleo commented 5 years ago

I have the exact same problem with Godaddy. Is there a way to set PASV mode in sftp?

ali-han commented 5 years ago

I get the same error in every attempt to connect. FileZilla is forcing the connection attempt. Because the connection with Filezilla sometimes fails. Filezilla is trying again and succeeding. Is there a setting about this? The "retry" setting would be perfect.

Screen Shot 2019-03-10 at 20 22 22

dg11arindam commented 3 years ago

I'm having the same issue, but with the SFTP extension. I'm new to this... how to solve this?

image

Sourabh-Semalty commented 2 years ago

[11-27 13:11:13] [info] config at c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple {"remotePath":"/var/www/html/MachPrinciple/","uploadOnSave":true,"downloadOnOpen":false,"ignore":[],"concurrency":4,"protocol":"sftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"remoteTimeOffsetInHours":0,"name":"sourabh","host":"ec2-3-6-39-138.ap-south-1.compute.amazonaws.com","port":22,"username":"**","password":"**"} [11-27 13:11:31] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.htaccess [11-27 13:11:41] [error] Error: [ec2-3-6-39-138.ap-south-1.compute.amazonaws.com]: Timed out while waiting for handshake at Client. (c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:70:107548) at Client.emit (events.js:327:22) at Timeout._onTimeout (c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2\lib\client.js:697:14) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.htaccess [11-27 13:11:51] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.htaccess [11-27 13:12:01] [error] Error: [ec2-3-6-39-138.ap-south-1.compute.amazonaws.com]: Timed out while waiting for handshake at Client. (c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:70:107548) at Client.emit (events.js:327:22) at Timeout._onTimeout (c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\node_modules\ssh2\lib\client.js:697:14) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.htaccess [11-27 13:12:18] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.htaccess [11-27 13:12:33] [info] local ➞ remote c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.htaccess [11-27 13:12:58] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.htaccess [11-27 13:13:19] [info] local ➞ remote c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.htaccess [11-27 13:14:13] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:14:14] [info] local ➞ remote c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:15:20] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:15:34] [info] local ➞ remote c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:16:42] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:16:57] [info] local ➞ remote c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:22:55] [info] config at c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple {"remotePath":"/var/www/html/MachPrinciple/","uploadOnSave":true,"downloadOnOpen":false,"ignore":[],"concurrency":4,"protocol":"sftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"remoteTimeOffsetInHours":0,"name":"sourabh","host":"103.102.234.200","port":22,"username":"**","password":"**"} [11-27 13:24:00] [info] config at c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple {"remotePath":"/var/www/html/MachPrinciple/","uploadOnSave":true,"downloadOnOpen":false,"ignore":[],"concurrency":4,"protocol":"ftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"remoteTimeOffsetInHours":0,"name":"sourabh","host":"103.102.234.200","port":21,"username":"**","password":"**"} [11-27 13:24:08] [info] config at c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple {"remotePath":"/var/www/html/MachPrinciple/","uploadOnSave":true,"downloadOnOpen":false,"ignore":[],"concurrency":4,"protocol":"ftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"remoteTimeOffsetInHours":0,"name":"sourabh","host":"103.102.234.200","port":21,"username":"**","password":"**"} [11-27 13:24:11] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:24:12] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:24:18] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:24:18] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:24:28] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:24:28] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:09] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:09] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:10] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:10] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:10] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:10] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:11] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:11] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:11] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:11] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:11] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:11] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:11] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:11] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:11] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:11] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:12] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:12] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:25:58] [error] SyntaxError: c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.vscode\sftp.json: Unexpected token } in JSON at position 219 at JSON.parse () at c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:70:88376 at c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:1:10296 at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) [11-27 13:26:00] [error] SyntaxError: c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.vscode\sftp.json: Unexpected token } in JSON at position 219 at JSON.parse () at c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:70:88376 at c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:1:10296 at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) [11-27 13:26:01] [error] SyntaxError: c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.vscode\sftp.json: Unexpected token } in JSON at position 219 at JSON.parse () at c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:70:88376 at c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:1:10296 at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) [11-27 13:26:05] [info] config at c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple {"remotePath":"/var/www/html/MachPrinciple/","uploadOnSave":false,"downloadOnOpen":false,"ignore":[],"concurrency":4,"protocol":"ftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"remoteTimeOffsetInHours":0,"name":"sourabh","host":"103.102.234.200","port":21,"username":"**","password":"**"} [11-27 13:27:31] [error] SyntaxError: c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.vscode\sftp.json: Unexpected token { in JSON at position 193 at JSON.parse () at c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:70:88376 at c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:1:10296 at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) [11-27 13:27:48] [error] SyntaxError: c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple.vscode\sftp.json: Unexpected string in JSON at position 195 at JSON.parse () at c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:70:88376 at c:\Users\Demon.vscode\extensions\liximomo.sftp-1.12.9\dist\extension.js:1:10296 at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) [11-27 13:27:52] [info] config at c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple {"remotePath":"/","uploadOnSave":true,"downloadOnOpen":false,"ignore":[],"concurrency":4,"protocol":"ftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"remoteTimeOffsetInHours":0,"name":"sourabh","host":"103.102.234.200","port":21,"username":"**","password":"**"} [11-27 13:27:54] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:27:54] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:27:55] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:27:55] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:27:55] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:27:55] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:27:55] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:27:56] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:28:11] [info] [file-save] c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:28:11] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20) download c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple\config\predefine.php [11-27 13:28:12] [info] config at c:\Users\Demon\AppData\Local\Programs\xampp\htdocs\MachPrinciple {"remotePath":"/","uploadOnSave":false,"downloadOnOpen":false,"ignore":[],"concurrency":4,"protocol":"ftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"remoteTimeOffsetInHours":0,"name":"sourabh","host":"103.102.234.200","port":21,"username":"**","password":"**"} [11-27 13:28:25] [error] Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:209:20)

baikov commented 2 years ago

Try to close the firewall in your computer.

it worked for me, thx!