liximomo / vscode-sftp

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

Login to FTP server fails with "Connection timeout" just before completion #643

Open rufw91 opened 5 years ago

rufw91 commented 5 years ago

Hey guys so i have run into an error i cant seem to figure out. The following is the background: I reinstalled VS Code after OS reinstall. Previously, SFTP was running fine. (Just to be clear it was a clean OS install so no AppData folder issues etc) After reinstalling the extension, i entered the proper config values

{
    "host": "######.com",
    "port": 21,
    "username": "######",
    "password": "######",
    "protocol": "ftp",
    "passive": true,
    "remotePath": "/",
    "uploadOnSave": true,
    "syncMode": "full",
    "watcher": {
        "files": "**/**",
        "autoUpload": false,
        "autoDelete": true
    },
    "concurrency": 512
}

Now, when i try to upload, sync or save to server i get "Connection timeout". The log is as below

09-12 11:54:57] [info] config at d:######{"remotePath":"/","uploadOnSave":true,"downloadOnOpen":false,"ignore":[],"concurrency":512,"protocol":"ftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"remoteTimeOffsetInHours":0,"host":"######.com","port":21,"username":"######","password":"######","passive":true,"syncMode":"full","watcher":{"files":"/","autoUpload":false,"autoDelete":true}} [09-12 11:55:06] [trace] run command 'Upload File' [09-12 11:55:06] [trace] handle upload file for d:######\img######.png [09-12 11:55:06] [debug] < '220 Microsoft FTP Service\r\n' [09-12 11:55:06] [debug] > USER ###### [09-12 11:55:06] [debug] < '331 Password required for ######.\r\n' [09-12 11:55:06] [debug] > PASS ###### [09-12 11:55:07] [debug] < '230-FTP-SSL (AUTH TLS, Explicit FTPS or FTPES) security is available\r\n' [09-12 11:55:07] [debug] < '230 User logged in.\r\n' [09-12 11:55:07] [debug] > FEAT [09-12 11:55:16] [error] Error: Timeout while connecting to server at Timeout.module.exports.t.default._doConnect.setTimeout [as _onTimeout] (c:\Users******.vscode\extensions\liximomo.sftp-1.12.8\dist\extension.js:70:109492) at ontimeout (timers.js:425:11) at tryOnTimeout (timers.js:289:5) at listOnTimeout (timers.js:252:5) at Timer.processTimers (timers.js:212:10)

IAluI commented 2 years ago

I seem to have a similar problem. I can't connect to GoDaddy ftp server with vscode-sftp. I think I found several related issues (#537, #309). Maybe in these cases the error is due to the fact that the server does not support the FEAT command?

If I use vscode-sftp I get the following log:

[07-04 12:04:07] [debug] > USER ******
[07-04 12:04:07] [debug] < '331 User ****** OK. Password required\r\n'
[07-04 12:04:07] [debug] > PASS ******
[07-04 12:04:08] [debug] > FEAT

and image if connectTimeout is default (10000) or image if connectTimeout greater than default (for example 20000).

But if i use FileZilla I get the the following log:

14:11:32    Status: Connecting to ******
14:11:32    Status: Connection established, waiting for welcome message...
14:11:32    Response:   220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
14:11:32    Response:   220-You are user number 3 of 500 allowed.
14:11:32    Response:   220-Local time is now 00:11. Server port: 21.
14:11:32    Response:   220-This is a private system - No anonymous login
14:11:32    Response:   220 You will be disconnected after 15 minutes of inactivity.
14:11:32    Command:    AUTH TLS
14:11:33    Response:   234 AUTH TLS OK.
14:11:33    Status: Initializing TLS...
14:11:33    Trace:  TLS Handshake successful
14:11:33    Trace:  Protocol: TLS1.2, Key exchange: ECDHE-SECP256R1-RSA-SHA384, Cipher: AES-256-GCM, MAC: AEAD
14:11:33    Status: TLS connection established.
14:11:33    Command:    USER ******
14:11:33    Response:   331 ****** OK. Password required
14:11:33    Command:    PASS ******
14:11:33    Response:   230-Your bandwidth usage is restricted
14:11:33    Response:   230 OK. Current restricted directory is /
14:11:33    Command:    OPTS UTF8 ON
14:11:34    Response:   504 Unknown command
14:11:34    Command:    PBSZ 0
14:11:34    Response:   200 PBSZ=0
14:11:34    Command:    PROT P
14:11:34    Response:   200 Data protection level set to "private"
14:11:34    Status: Logged in
14:11:34    Trace:  Measured latency of 179 ms
14:11:34    Status: Retrieving directory listing...
14:11:34    Command:    PWD
14:11:34    Response:   257 "/" is your current location
14:11:34    Status: Directory listing of "/" successful

and i success connect to ftp.

Is my assumption valid? And if that's the case, how can i make the vscode-sftp work with servers that don't support the FEAT command?