Remote-ftp: v 1.1.0 Transfer issue : Failed to change directory

Created on 4 Jul 2017  路  3Comments  路  Source: icetee/remote-ftp

Remote FTP version 1.1.0 -- OS : Windows 10 -- Connection type : FTP

_(note: this probably affects sftp as well)_
When clicking a file in the remote pane, there is always an error notification that pops up in Atom which reads:

Remote FTP: Connection failed
550 Failed to change directory.

I have investigated and the error is triggered in the client.js file around line 531...
self.connector.on('response', ......

When a file is double-clicked in the 'remote pane', the get-function is called in ftp.js .
The first thing the get-function tries, is to cwd the path ( see line 167 and after in ftp.js ).
This fails because it is a file and not a directory --> leads to --> response emit 550 Failed to change directory.

After the error, it goes to the root directory and then downloads the file locally.
So except for an error notification when downloading a file, everything works.

Quick fix

I have temporary made a change to client.js line 532 to suppress the error notification :

if (code === 550 && !/No such file or directory/.test(text) && !/Failed to change directory/.test(text)) {

Although this is probably not the best way to go if anyone else is experiencing this issue, this could be a quick fix .

A better solution would be to somehow detect if the path has a filename at the end and skip the first cwd directly to the file.

bug

Most helpful comment

The hot-fix that worked for me was, adding this to rule 532:
!/Can't change directory to/.test(text)

PS. this is not a bug, just bad testing.

All 3 comments

Update : Just tested on SFTP connection, and this issue is not an issue on SFTP connections .

Update : Just tested on SFTP connection, and this issue is not an issue on SFTP connections .

SFTP is an encrypted protocol. You can not see communication. ;)

The hot-fix that worked for me was, adding this to rule 532:
!/Can't change directory to/.test(text)

PS. this is not a bug, just bad testing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukecywon picture lukecywon  路  6Comments

Darkspirit picture Darkspirit  路  4Comments

krkmzugur picture krkmzugur  路  7Comments

peterbode1989 picture peterbode1989  路  3Comments

fausto160792 picture fausto160792  路  7Comments