# Sftp SSH\_FX\_FAILURE directory not found

**URL:** <https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436>\
**Category:** Help and Support\
**Created:** [June 25, 2020, 3:08pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436 "2020-06-25T15:08:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 25, 2020, 3:08pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/1 "2020-06-25T15:08:20Z")

</div>

looks like a similar issue to:

> [@Failed to copy: sftp: "Folder not found: c:\\\\ftpsites... SSH\_FX\_FAILURE](https://forum.rclone.org/t/failed-to-copy-sftp-folder-not-found-c-ftpsites-ssh-fx-failure/9778):
>
> I connected a remote SFTP source, which I am able to ls just fine. But when I try to sync or copy, I receive an error as rclone attempts to transfer each file. I'm running on OSX, and I believe the remote server is running on a Windows system win win\_scp.. I am getting error like this: rclone sync aiep:./ ~/home/Download/PEIA\_CCP 2019/04/30 12:13:27 NOTICE: aaaaa\_valley\_hhhhhh\_ccp/CCP\_Valley\_hhhhhh\_190429.csv: Removing partially written file on error: sftp: "Folder not found: c:\ftpsites\aie…

however, the links are broken and i cannot see the solution.

#### What is the problem you are having with rclone?

cannot copy to or from sftp server i have no control over.

#### What is your rclone version (output from `rclone version`)

```auto
rclone v1.52.2
- os/arch: linux/amd64
- go version: go1.14.4

```

#### Which OS you are using and how many bits (eg Windows 7, 64 bit)

ubuntu 18.04, 64bit

#### Which cloud storage system are you using? (eg Google Drive)

sftp

#### The command you were trying to run (eg `rclone copy /tmp remote:tmp`)

```auto
# to get the SSH_FX_FAILURE error
rclone copy test.txt eleadtrack:
# attempt to debug
rclone copyto --low-level-retries 1 --retries 1 -vv eleadtrack:/Hendrick_SourceSubsource_USED_06252020.csv ./test.csv

```

#### The rclone config contents with secrets removed.

```auto
[eleadtrack]
type = sftp
host = example.com
user = <user>
pass = <encryptedpass>

```

#### A log from the command with the `-vv` flag

```auto
2020/06/25 07:50:58 DEBUG : rclone: Version "v1.52.2" starting with parameters ["rclone" "copyto" "--low-level-retries" "1" "--retries" "1" "-vv" "eleadtrack_old:/Hendrick_SourceSubsource_USED_06252020.csv" "./test.csv"]
2020/06/25 07:50:58 DEBUG : Using config file from "/home/ak_zuar01/.config/rclone/rclone.conf"
2020/06/25 07:50:58 DEBUG : sftp://user@example.com:22//Hendrick_SourceSubsource_USED_06252020.csv: New connection 1.2.3.4:43808->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.7"
2020/06/25 07:50:58 DEBUG : fs cache: renaming cache item "./test.csv" to be canonical "/home/ak_zuar01/test.csv"
2020/06/25 07:50:58 ERROR : : error reading source directory: directory not found
2020/06/25 07:50:58 DEBUG : Local file system at /home/ak_zuar01/test.csv: Waiting for checks to finish
2020/06/25 07:50:58 DEBUG : Local file system at /home/ak_zuar01/test.csv: Waiting for transfers to finish
2020/06/25 07:50:58 INFO : There was nothing to transfer
2020/06/25 07:50:58 ERROR : Attempt 1/1 failed with 1 errors and: directory not found
2020/06/25 07:50:58 INFO : 
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s

2020/06/25 08:15:33 DEBUG : 12 go routines active
2020/06/25 08:15:33 Failed to copyto: directory not found

```

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 25, 2020, 7:36pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/2 "2020-06-25T19:36:01Z")

</div>

same exact error on another machine running 1.52.2 connecting to a totally different sftp server.

```auto
$ rclone copy nohup.out dddOutgoing:IN
2020/06/25 13:34:28 ERROR : nohup.out: Failed to copy: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
2020/06/25 13:34:28 ERROR : Attempt 1/3 failed with 1 errors and: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
2020/06/25 13:34:28 ERROR : nohup.out: Failed to copy: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
2020/06/25 13:34:28 ERROR : Attempt 2/3 failed with 1 errors and: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
2020/06/25 13:34:28 ERROR : nohup.out: Failed to copy: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
2020/06/25 13:34:28 ERROR : Attempt 3/3 failed with 1 errors and: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
2020/06/25 13:34:28 Failed to copy: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)

```

what am i doing wrong??

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 25, 2020, 7:39pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/3 "2020-06-25T19:39:26Z")

</div>

I've tried use\_insecure\_cypher = true and disable\_hashcheck = true .. no change.

any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 25, 2020, 7:54pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/4 "2020-06-25T19:54:25Z")

</div>

both ftp servers are similar versions:

```auto
SSH-2.0-WS_FTP-SSH_7.6.2

```

and

```auto
SSH-2.0-WS_FTP-SSH_7.7

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 25, 2020, 8:56pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/5 "2020-06-25T20:56:40Z")

</div>

> [@andyklier](#):
>
> `error reading source directory: directory not found`

This is indicating that the source directory can't be found

> [@andyklier](#):
>
> "eleadtrack\_old:/Hendrick\_SourceSubsource\_USED\_06252020.csv"

If you start a path with a leading `/` on the sftp remote then it means start from the root which is probably not what you want.

If that file is in the user's home directory then you want

```
"eleadtrack_old:Hendrick_SourceSubsource_USED_06252020.csv"

```

> [@andyklier](#):
>
> ```auto
> 2020/06/25 13:34:28 ERROR : Attempt 1/3 failed with 1 errors and: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
> 
> ```

I'm not 100% sure what is going on here. Rclone attempted to create the IN directory (which is what it normally does) but the server replied "Folder already exists: IN" (SSH\_FX\_FAILURE) which also seems fair enough. However rclone should have checked that directory did exist before trying to create it, so it looks like that check failed for some reason.

If the server is a Windows server, then maybe the case of the directory is different - that might make a difference. So you could try `In` and `in` to see if that works.

This will show you what rclone sees

```
rclone lsf dddOutgoing:

```

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 25, 2020, 9:17pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/6 "2020-06-25T21:17:41Z")

</div>

Hey thanks for the reply.

The only similarity i can see is both of these are w\_ftp servers of similar versions.

```auto
SSH-2.0-WS_FTP-SSH_7.7
# and ...
SSH-2.0-WS_FTP-SSH_7.62

```

On this particular server there are no directories beyond the root. if i rclone lsf, it just lists a bunch of csv files. I get the same results with or without the /

```auto
$ rclone -vv copyto eleadtrack:Hendrick_SourceSubsource_USED_06252020.csv ./text.csv
2020/06/25 14:10:27 DEBUG : rclone: Version "v1.49.0" starting with parameters ["rclone" "-vv" "copyto" "eleadtrack:Hendrick_SourceSubsource_USED_06252020.csv" "./text.csv"]
2020/06/25 14:10:27 DEBUG : Using config file from "/home/ak_zuar01/.config/rclone/rclone.conf"
2020/06/25 14:10:27 DEBUG : sftp://user@example.com:22/Hendrick_SourceSubsource_USED_06252020.csv: New connection 1.2.3.4:44066->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.7"
2020/06/25 14:10:27 Failed to create file system for "eleadtrack:Hendrick_SourceSubsource_USED_06252020.csv": stat failed: sftp: "Folder not found: Hendrick_SourceSubsource_USED_06252020.csv" (SSH_FX_FAILURE)

```

```auto
$ rclone --low-level-retries 1 --retries 1 -vv copy test.txt eleadtrack:
2020/06/25 14:14:18 DEBUG : rclone: Version "v1.49.0" starting with parameters ["rclone" "--low-level-retries" "1" "--retries" "1" "-vv" "copy" "test.txt" "eleadtrack:"]
2020/06/25 14:14:18 DEBUG : Using config file from "/home/ak_zuar01/.config/rclone/rclone.conf"
2020/06/25 14:14:18 DEBUG : sftp://user@example.com:22/: New connection 1.2.3.4:44074->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.7"
2020/06/25 14:14:19 ERROR : : error reading source directory: directory not found
2020/06/25 14:14:19 INFO : sftp://user@example.com:22/: Waiting for checks to finish
2020/06/25 14:14:19 INFO : sftp://user@example.com:22/: Waiting for transfers to finish
2020/06/25 14:14:19 ERROR : Attempt 1/1 failed with 2 errors and: directory not found
2020/06/25 14:14:19 Failed to copy with 2 errors: last error was: directory not found

```

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 25, 2020, 10:08pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/7 "2020-06-25T22:08:51Z")

</div>

on this server the folders IN and OUT exist. and i was attempting to write to IN. I tried In and in as well with the same results.

> [@ncw](#):
>
> If the server is a Windows server, then maybe the case of the directory is different - that might make a difference. So you could try `In` and `in` to see if that works.

more efforts include:

```auto
$ rclone lsl dddOutgoing:
2020/06/25 15:34:04 ERROR : OUT: error listing: List failed: dirExists stat failed: sftp: "Folder not found: OUT" (SSH_FX_FAILURE)
2020/06/25 15:34:05 ERROR : IN: error listing: directory not found
2020/06/25 15:34:05 Failed to lsl with 3 errors: last error was: directory not found

```

```auto
$ rclone lsf dddOutgoing:/IN
2020/06/25 15:35:02 ERROR : : error listing: directory not found
2020/06/25 15:35:02 Failed to lsf with 2 errors: last error was: error in ListJSON: directory not found

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 26, 2020, 9:23am UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/8 "2020-06-26T09:23:49Z")

</div>

> [@andyklier](#):
>
> `stat failed: sftp: "Folder not found: Hendrick_SourceSubsource_USED_06252020.csv"`

What this is saying is that rclone asked for the details of "Hendrick\_SourceSubsource\_USED\_06252020.csv" and the server replied "Folder not found" which is a bit odd.

In fact all the oddities seem to be due to `stat` not working as rclone expects.

It would be worth trying rclone 1.52.2 which was released recently to see if that is any different.

If that doesn't work can you try this which has a bit more debugging in which should hopefully help see what is going on - thanks!

[https://beta.rclone.org/branch/v1.52.2-134-ga70bf051-fix-sftp-wsftp-beta/](https://beta.rclone.org/branch/v1.52.2-134-ga70bf051-fix-sftp-wsftp-beta/) (uploaded in 15-30 mins)

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 26, 2020, 2:33pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/9 "2020-06-26T14:33:43Z")

</div>

Morning. We have tried 1.52.2 on both servers. dddOutgoing output above was 1.52.2

tried a few things with the beta you linked to:

```auto
$ rclone version
rclone v1.52.2-134-ga70bf051-fix-sftp-wsftp-beta
- os/arch: linux/amd64
- go version: go1.14.4

```

```auto
$ rclone -vv lsd dddOutgoing:
2020/06/26 08:28:20 DEBUG : rclone: Version "v1.52.2-134-ga70bf051-fix-sftp-wsftp-beta" starting with parameters ["rclone" "-vv" "lsd" "dddOutgoing:"]
2020/06/26 08:28:20 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2020/06/26 08:28:21 DEBUG : sftp://user@example.com:22/: New connection 1.2.3.4:36218->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.6.2"
2020/06/26 08:28:21 DEBUG : Dir Stat result for "." is &sftp.fileInfo{name:".", size:0, mode:0x800001e8, mtime:time.Time{wall:0x0, ext:63728709547, loc:(*time.Location)(0x2a053a0)}, sys:(*sftp.FileStat)(0xc00003a280)}, <nil>
          -1 2020-06-08 23:47:31 -1 IN
          -1 2020-06-08 23:47:39 -1 OUT
2020/06/26 08:28:21 DEBUG : 11 go routines active

```

```auto
$ rclone -vv lsl dddOutgoing:
2020/06/26 08:31:47 DEBUG : rclone: Version "v1.52.2-134-ga70bf051-fix-sftp-wsftp-beta" starting with parameters ["rclone" "-vv" "lsl" "dddOutgoing:"]
2020/06/26 08:31:47 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2020/06/26 08:31:47 DEBUG : sftp://user@example.com:22/: New connection 1.2.3.4:36222->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.6.2"
2020/06/26 08:31:47 DEBUG : Dir Stat result for "." is &sftp.fileInfo{name:".", size:0, mode:0x800001e8, mtime:time.Time{wall:0x0, ext:63728709547, loc:(*time.Location)(0x2a053a0)}, sys:(*sftp.FileStat)(0xc00003b4c0)}, <nil>
2020/06/26 08:31:47 DEBUG : Dir Stat result for "OUT" is <nil>, &sftp.StatusError{Code:0x4, msg:"Folder not found: OUT", lang:""}
2020/06/26 08:31:47 ERROR : OUT: error listing: List failed: dirExists stat failed: sftp: "Folder not found: OUT" (SSH_FX_FAILURE)
2020/06/26 08:31:48 DEBUG : sftp://user@example.com:22/: New connection 1.2.3.4:36224->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.6.2"
2020/06/26 08:31:48 DEBUG : Dir Stat result for "IN" is <nil>, &errors.errorString{s:"file does not exist"}
2020/06/26 08:31:48 ERROR : IN: error listing: directory not found
2020/06/26 08:31:48 DEBUG : 20 go routines active
2020/06/26 08:31:48 Failed to lsl with 3 errors: last error was: directory not found

```

```auto
$ rclone --low-level-retries 1 --retries 1 -vv copy nohup.out dddOutgoing:IN
2020/06/26 08:28:06 DEBUG : rclone: Version "v1.52.2-134-ga70bf051-fix-sftp-wsftp-beta" starting with parameters ["rclone" "--low-level-retries" "1" "--retries" "1" "-vv" "copy" "nohup.out" "dddOutgoing:IN"]
2020/06/26 08:28:06 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2020/06/26 08:28:06 DEBUG : fs cache: renaming cache item "nohup.out" to be canonical "/home/ubuntu"
2020/06/26 08:28:06 DEBUG : sftp://user@example.com:22/IN: New connection 1.2.3.4:36216->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.6.2"
2020/06/26 08:28:07 DEBUG : Stat result for "IN" is <nil>, &errors.errorString{s:"file does not exist"}
2020/06/26 08:28:07 DEBUG : Stat result for "IN/nohup.out" is <nil>, &errors.errorString{s:"file does not exist"}
2020/06/26 08:28:07 DEBUG : nohup.out: Need to transfer - File not found at Destination
2020/06/26 08:28:07 DEBUG : Dir Stat result for "IN" is <nil>, &errors.errorString{s:"file does not exist"}
2020/06/26 08:28:07 ERROR : nohup.out: Failed to copy: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
2020/06/26 08:28:07 ERROR : Attempt 1/1 failed with 1 errors and: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
2020/06/26 08:28:07 INFO : 
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s

2020/06/26 08:28:07 DEBUG : 11 go routines active
2020/06/26 08:28:07 Failed to copy: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)

```

thanks again!

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 27, 2020, 12:02pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/10 "2020-06-27T12:02:07Z")

</div>

> [@andyklier](#):
>
> Morning. We have tried 1.52.2 on both servers. dddOutgoing output above was 1.52.2
> 
> tried a few things with the beta you linked to:
> 
> ```auto
> 
> ```

Thanks! Those are useful logs.

This shows that rclone can find the current directory and the two directories within it `IN` and `OUT`.

> [@andyklier](#):
>
> ```auto
> 2020/06/26 08:28:21 DEBUG : Dir Stat result for "." is &sftp.fileInfo{name:".", size:0, mode:0x800001e8, mtime:time.Time{wall:0x0, ext:63728709547, loc:(*time.Location)(0x2a053a0)}, sys:(*sftp.FileStat)(0xc00003a280)}, <nil>
> -1 2020-06-08 23:47:31 -1 IN
> -1 2020-06-08 23:47:39 -1 OUT
> 
> ```

However this shows that the server can't return a `stat` result for the IN directory and the OUT directory.

> [@andyklier](#):
>
> ```auto
> 2020/06/26 08:31:47 DEBUG : Dir Stat result for "." is &sftp.fileInfo{name:".", size:0, mode:0x800001e8, mtime:time.Time{wall:0x0, ext:63728709547, loc:(*time.Location)(0x2a053a0)}, sys:(*sftp.FileStat)(0xc00003b4c0)}, <nil>
> 2020/06/26 08:31:47 DEBUG : Dir Stat result for "OUT" is <nil>, &sftp.StatusError{Code:0x4, msg:"Folder not found: OUT", lang:""}
> 2020/06/26 08:31:47 ERROR : OUT: error listing: List failed: dirExists stat failed: sftp: "Folder not found: OUT" (SSH_FX_FAILURE)
> 2020/06/26 08:31:48 DEBUG : sftp://user@example.com:22/: New connection 1.2.3.4:36224->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.6.2"
> 2020/06/26 08:31:48 DEBUG : Dir Stat result for "IN" is <nil>, &errors.errorString{s:"file does not exist"}
> 2020/06/26 08:31:48 ERROR : IN: error listing: directory not found
> 
> ```

Which is very strange!

A bit of searching lead me to this very similar problem

> <https://github.com/pkg/sftp/issues/288>
>
> \[An rclone user has reported\](https://forum.rclone.org/t/failed-to-copy-sftp-fol…der-not-found-c-ftpsites-ssh-fx-failure/9778) that rclone with a certain sftp server reports the error \`"Folder not found: c:\\xxx\\yyy.csv" (SSH\_FX\_FAILURE)\`. As far as I can work out this is being generated by the \`Read()\` call on an open file, though looking at the trace below it seems to come from \`Fstat\` on the open file - not sure what is calling that.
> 
> The user reports that other sftp clients work just fine.
> 
> I turned on debugging and sent the user a binary to try.
> 
> Here is rclone logs interleaved with sftp debugs
> 
> \`\`\`
> ./rclone copyto --low-level-retries 1 --retries 1 -vv aiep:aaaaaaa\_valley\_hhhhh\_ccp/CCP\_Valley\_hhhhh\_190429.csv ~/Downloads/z.csv
> \`\`\`
> 
> \`\`\`
> 2019/05/02 13:00:24 DEBUG : rclone: Version “v1.47.0-032-g5c0574ea-fix-sftp-folder-beta” starting with parameters \["./rclone" “copyto” “–low-level-retries” “1” “–retries” “1” “-vv” “aiep:aaaaaaa\_valley\_hhhhh\_ccp/CCP\_Valley\_hhhhh\_190429.csv” “/Users/auser/Downloads/z.csv”\]
> 2019/05/02 13:00:24 DEBUG : Using config file from “/Users/auser/.config/rclone/rclone.conf”
> \`\`\`
> 
> \`\`\`
> 2019/05/02 13:00:24 send packet: SSH\_FXP\_INIT 5 bytes 00000003
> 2019/05/02 13:00:24 recv packet: SSH\_FXP\_VERSION 5 bytes 00000003
> 2019/05/02 13:00:24 send packet: SSH\_FXP\_STAT 63 bytes 0000000100000036616c65646164655f76616c6c65795f6865616c74685f6363702f4343505f56616c6c65795f4865616c74685f3139303432392e637376
> 2019/05/02 13:00:24 recv packet: SSH\_FXP\_ATTRS 29 bytes 000000010000003d000000000024230c000081ef5cc6dc835cc6dc83
> 2019/05/02 13:00:24 send packet: SSH\_FXP\_STAT 63 bytes 0000000200000036616c65646164655f76616c6c65795f6865616c74685f6363702f4343505f56616c6c65795f4865616c74685f3139303432392e637376
> 2019/05/02 13:00:24 recv packet: SSH\_FXP\_ATTRS 29 bytes 000000020000003d000000000024230c000081ef5cc6dc835cc6dc83
> \`\`\`
> 
> Rclone has identified the file as needing to transfer
> 
> \`\`\`
> 2019/05/02 13:00:24 DEBUG : CCP\_Valley\_hhhhh\_190429.csv: Couldn’t find file - need to transfer
> \`\`\`
> 
> Now we open it
> 
> \`\`\`
> 2019/05/02 13:00:25 send packet: SSH\_FXP\_OPEN 71 bytes 0000000300000036616c65646164655f76616c6c65795f6865616c74685f6363702f4343505f56616c6c65795f4865616c74685f3139303432392e6373760000000100000000
> 2019/05/02 13:00:25 recv packet: SSH\_FXP\_HANDLE 12 bytes 0000000300000003323535
> 2019/05/02 13:00:25 send packet: SSH\_FXP\_FSTAT 12 bytes 0000000400000003323535
> 2019/05/02 13:00:25 recv packet: SSH\_FXP\_STATUS 94 bytes 00000004000000040000004d466f6c646572206e6f7420666f756e643a20633a5c66747073697465735c706569615c76616c6c65795f6865616c74685c4343505f56616c6c65795f4865616c74685f3139303432392e63737600000000
> 2019/05/02 13:00:25 send packet: SSH\_FXP\_CLOSE 12 bytes 0000000500000003323535
> 2019/05/02 13:00:25 recv packet: SSH\_FXP\_STATUS 17 bytes 00000005000000000000000000000000
> \`\`\`
> 
> However the SSH\_FXP\_FSTAT returned an error. I don't know why! Rclone doesn't directly call \`Stat()\` on the handle returned - I'm not sure where that gets called.
> 
> \`\`\`
> 2019/05/02 13:00:25 DEBUG : CCP\_Valley\_hhhhh\_190429.csv: Reopening on read failure after 0 bytes: retry 1/1: sftp: “Folder not found: c:\\ftpsites\\aiep\\valley\_hhhhh\\CCP\_Valley\_hhhhh\_190429.csv” (SSH\_FX\_FAILURE)
> 2019/05/02 13:00:25 DEBUG : CCP\_Valley\_hhhhh\_190429.csv: Reopen failed after 0 bytes read: failed to reopen: too many retries
> 2019/05/02 13:00:25 NOTICE: z.csv: Removing partially written file on error: sftp: “Folder not found: c:\\ftpsites\\aiep\\valley\_hhhhh\\CCP\_Valley\_hhhhh\_190429.csv” (SSH\_FX\_FAILURE)
> 2019/05/02 13:00:25 ERROR : CCP\_Valley\_hhhhh\_190429.csv: Failed to copy: sftp: “Folder not found: c:\\ftpsites\\aiep\\valley\_hhhhh\\CCP\_Valley\_hhhhh\_190429.csv” (SSH\_FX\_FAILURE)
> 2019/05/02 13:00:25 ERROR : Attempt 1/1 failed with 2 errors and: sftp: “Folder not found: c:\\ftpsites\\aiep\\valley\_hhhhh\\CCP\_Valley\_hhhhh\_190429.csv” (SSH\_FX\_FAILURE)
> 2019/05/02 13:00:25 Failed to copyto: sftp: “Folder not found: c:\\ftpsites\\aiep\\valley\_hhhhh\\CCP\_Valley\_hhhhh\_190429.csv” (SSH\_FX\_FAILURE)
> \`\`\`
> 
> I attempted to decode the sftp debug using the RFC but it wasn't making sense, so I'm asking for help here.
> 
> Thanks in advance!

So apparently I diagnosed and fixed this very similar problem in the upstream library already!

I checked and rclone is using the patched library. However the problem is very similar...

OK here is a trial fix which probably won't work, but you never know! I tried prefixing the direcotyr paths with `./`.

[https://beta.rclone.org/branch/v1.52.2-137-g43c4109a-fix-sftp-wsftp-beta/](https://beta.rclone.org/branch/v1.52.2-137-g43c4109a-fix-sftp-wsftp-beta/) (uploaded in 15-30 mins)

Is there any way I could get access to the server? I'm guessing not, but if it would it would speed up this process! Email [nick@craig-wood.com](mailto:nick@craig-wood.com) or PM me if you want to discuss further.

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 27, 2020, 4:13pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/11 "2020-06-27T16:13:53Z")

</div>

No sorry. It's a customer's server so i can't give out creds. Tried the latest beta you shared:

```auto
$ rclone version
rclone v1.52.2-137-g43c4109a-fix-sftp-wsftp-beta
- os/arch: linux/amd64
- go version: go1.14.4

```

doing the same three commands for consistency. Got slightly different results on `lsl`

```auto
$ rclone -vv lsd dddOutgoing:
2020/06/27 09:55:37 DEBUG : rclone: Version "v1.52.2-137-g43c4109a-fix-sftp-wsftp-beta" starting with parameters ["rclone" "-vv" "lsd" "dddOutgoing:"]
2020/06/27 09:55:37 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2020/06/27 09:55:38 DEBUG : sftp://user@example.com:22/: New connection 1.2.3.4:40768->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.6.2"
2020/06/27 09:55:39 DEBUG : Dir Stat result for "." is &sftp.fileInfo{name:".", size:0, mode:0x800001e8, mtime:time.Time{wall:0x0, ext:63728709547, loc:(*time.Location)(0x2a063a0)}, sys:(*sftp.FileStat)(0xc0001b7600)}, <nil>
          -1 2020-06-08 23:47:31 -1 IN
          -1 2020-06-08 23:47:39 -1 OUT
2020/06/27 09:55:40 DEBUG : 11 go routines active

```

```auto
$ rclone -vv lsl dddOutgoing:
2020/06/27 09:55:50 DEBUG : rclone: Version "v1.52.2-137-g43c4109a-fix-sftp-wsftp-beta" starting with parameters ["rclone" "-vv" "lsl" "dddOutgoing:"]
2020/06/27 09:55:50 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2020/06/27 09:55:50 DEBUG : sftp://user@example.com:22/: New connection 1.2.3.4:40770->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.6.2"
2020/06/27 09:55:50 DEBUG : Dir Stat result for "." is &sftp.fileInfo{name:".", size:0, mode:0x800001e8, mtime:time.Time{wall:0x0, ext:63728709547, loc:(*time.Location)(0x2a063a0)}, sys:(*sftp.FileStat)(0xc00003a640)}, <nil>
2020/06/27 09:55:51 DEBUG : Dir Stat result for "./OUT" is &sftp.fileInfo{name:"OUT", size:0, mode:0x800001e8, mtime:time.Time{wall:0x0, ext:63727278459, loc:(*time.Location)(0x2a063a0)}, sys:(*sftp.FileStat)(0xc00003bd00)}, <nil>
2020/06/27 09:55:51 ERROR : OUT: error listing: error listing "OUT": sftp: "Folder not found: OUT/" (SSH_FX_FAILURE)
2020/06/27 09:55:51 DEBUG : sftp://user@example.com:22/: New connection 1.2.3.4:40772->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.6.2"
2020/06/27 09:55:51 DEBUG : Dir Stat result for "./IN" is &sftp.fileInfo{name:"IN", size:0, mode:0x800001e8, mtime:time.Time{wall:0x0, ext:63727278451, loc:(*time.Location)(0x2a063a0)}, sys:(*sftp.FileStat)(0xc000125300)}, <nil>
2020/06/27 09:55:51 ERROR : IN: error listing: error listing "IN": sftp: "Permission Denied! " (SSH_FX_PERMISSION_DENIED)
2020/06/27 09:55:51 DEBUG : 20 go routines active
2020/06/27 09:55:51 Failed to lsl with 3 errors: last error was: error listing "IN": sftp: "Permission Denied! " (SSH_FX_PERMISSION_DENIED)

```

```auto
$ rclone --low-level-retries 1 --retries 1 -vv copy nohup.out dddOutgoing:IN
2020/06/27 10:07:11 DEBUG : rclone: Version "v1.52.2-137-g43c4109a-fix-sftp-wsftp-beta" starting with parameters ["rclone" "--low-level-retries" "1" "--retries" "1" "-vv" "copy" "nohup.out" "dddOutgoing:IN"]
2020/06/27 10:07:11 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2020/06/27 10:07:11 DEBUG : fs cache: renaming cache item "nohup.out" to be canonical "/home/ubuntu"
2020/06/27 10:07:11 DEBUG : sftp://user@example.com:22/IN: New connection 1.2.3.4:40780->4.5.6.7:22 to "SSH-2.0-WS_FTP-SSH_7.6.2"
2020/06/27 10:07:13 DEBUG : Stat result for "IN" is <nil>, &errors.errorString{s:"file does not exist"}
2020/06/27 10:07:13 DEBUG : Stat result for "IN/nohup.out" is <nil>, &errors.errorString{s:"file does not exist"}
2020/06/27 10:07:13 DEBUG : nohup.out: Need to transfer - File not found at Destination
2020/06/27 10:07:13 DEBUG : Dir Stat result for "./IN" is <nil>, &errors.errorString{s:"file does not exist"}
2020/06/27 10:07:13 ERROR : nohup.out: Failed to copy: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
2020/06/27 10:07:13 ERROR : Attempt 1/1 failed with 1 errors and: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)
2020/06/27 10:07:13 INFO : 
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s

2020/06/27 10:07:13 DEBUG : 11 go routines active
2020/06/27 10:07:13 Failed to copy: Put mkParentDir failed: mkdir "IN" failed: sftp: "Folder already exists: IN" (SSH_FX_FAILURE)

```

if there's something i can do on the server to test, lemme know. `sftp` works fine, get, put, etc.

```auto
$ sftp <USERNAME>@example.com
<USERNAME>@example.com's password: 
Connected to example.com.
sftp> ls
IN OUT  
Connected to example.com.
sftp> cd IN
sftp> put nohup.out 
Uploading nohup.out to /user/IN/nohup.out
nohup.out 100% 187 8.3KB/s 00:00    
sftp> ls
nohup.out  

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 27, 2020, 9:10pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/12 "2020-06-27T21:10:04Z")

</div>

Interesting. It looks like it would work if rclone just used ./IN to do the listing.

The put from your sftp log makes me wonder if it is using absolute paths internally.

Is there more debug for it you could turn on so we can see what it is doing?

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 29, 2020, 1:15pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/13 "2020-06-29T13:15:43Z")

</div>

> [@andyklier](#):
>
> /user/IN/

All I have for either of these servers is the sftp user/pass. I don't have any deeper access, cannot ssh in.

Is there something i can do on the machine i'm connecting with other than `sftp -vv`? Added logging to sshd, but it doesn't offer much info.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 29, 2020, 2:51pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/14 "2020-06-29T14:51:14Z")

</div>

That gives me an idea...

Does it work if you use `dddOutgoing:/user` and `dddOutgoing:/user/IN`

I'd temporarily forgotten rclone could use the absolute path.

If that works then this will probably work without the `/user` prefix.

[v1.52.2-138-gff714654-fix-sftp-wsftp-beta](https://beta.rclone.org/branch/v1.52.2-138-gff714654-fix-sftp-wsftp-beta/) on branch [fix-sftp-wsftp](https://github.com/rclone/rclone/tree/fix-sftp-wsftp) (uploaded in 15-30 mins)

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 29, 2020, 5:45pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/15 "2020-06-29T17:45:10Z")

</div>

> [@ncw](#):
>
> v1.52.2-138-gff714654-fix-sftp-wsftp-beta

I dont see a linux amd64 option?

trying absolute paths with the current version, but no dice:

```auto
$ rclone version
rclone v1.52.2-137-g43c4109a-fix-sftp-wsftp-beta
- os/arch: linux/amd64
- go version: go1.14.4

```

```auto
$ rclone --low-level-retries 1 --retries 1 -vv copy nohup.out dddOutgoing:/user
2020/06/29 11:41:26 DEBUG : rclone: Version "v1.52.2-137-g43c4109a-fix-sftp-wsftp-beta" starting with parameters ["rclone" "--low-level-retries" "1" "--retries" "1" "-vv" "copy" "nohup.out" "dddOutgoing:/user"]
2020/06/29 11:41:26 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2020/06/29 11:41:26 DEBUG : fs cache: renaming cache item "nohup.out" to be canonical "/home/ubuntu"
2020/06/29 11:41:28 DEBUG : Stat result for "/user" is &sftp.fileInfo{name:"user", size:0, mode:0x800001e8, mtime:time.Time{wall:0x0, ext:63728709547, loc:(*time.Location)(0x2a063a0)}, sys:(*sftp.FileStat)(0xc0004bfa00)}, <nil>
2020/06/29 11:41:28 DEBUG : Stat result for "/user/nohup.out" is <nil>, &errors.errorString{s:"file does not exist"}
2020/06/29 11:41:28 DEBUG : nohup.out: Need to transfer - File not found at Destination
2020/06/29 11:41:28 DEBUG : Dir Stat result for ".//user" is <nil>, &errors.errorString{s:"file does not exist"}
2020/06/29 11:41:28 ERROR : nohup.out: Failed to copy: Put mkParentDir failed: mkdir "/user" failed: sftp: "Folder already exists: /user" (SSH_FX_FAILURE)
2020/06/29 11:41:28 ERROR : Attempt 1/1 failed with 1 errors and: Put mkParentDir failed: mkdir "/user" failed: sftp: "Folder already exists: /user" (SSH_FX_FAILURE)
2020/06/29 11:41:28 INFO : 
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s

2020/06/29 11:41:28 DEBUG : 12 go routines active
2020/06/29 11:41:28 Failed to copy: Put mkParentDir failed: mkdir "/user" failed: sftp: "Folder already exists: /user" (SSH_FX_FAILURE)

```

```auto
$ rclone --low-level-retries 1 --retries 1 -vv copy nohup.out dddOutgoing:/user/IN
2020/06/29 11:41:37 DEBUG : rclone: Version "v1.52.2-137-g43c4109a-fix-sftp-wsftp-beta" starting with parameters ["rclone" "--low-level-retries" "1" "--retries" "1" "-vv" "copy" "nohup.out" "dddOutgoing:/user/IN"]
2020/06/29 11:41:37 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2020/06/29 11:41:37 DEBUG : fs cache: renaming cache item "nohup.out" to be canonical "/home/ubuntu"
2020/06/29 11:41:38 DEBUG : Stat result for "/user/IN" is &sftp.fileInfo{name:"IN", size:0, mode:0x800001e8, mtime:time.Time{wall:0x0, ext:63729033927, loc:(*time.Location)(0x2a063a0)}, sys:(*sftp.FileStat)(0xc00015ad40)}, <nil>
2020/06/29 11:41:38 DEBUG : Stat result for "/user/IN/nohup.out" is <nil>, &errors.errorString{s:"file does not exist"}
2020/06/29 11:41:38 DEBUG : nohup.out: Need to transfer - File not found at Destination
2020/06/29 11:41:38 DEBUG : Dir Stat result for ".//user/IN" is <nil>, &sftp.StatusError{Code:0x4, msg:"Folder not found: /user/IN/user/IN", lang:""}
2020/06/29 11:41:38 ERROR : nohup.out: Failed to copy: Put mkParentDir failed: mkdir dirExists failed: dirExists stat failed: sftp: "Folder not found: /user/IN/user/IN" (SSH_FX_FAILURE)
2020/06/29 11:41:38 ERROR : Attempt 1/1 failed with 1 errors and: Put mkParentDir failed: mkdir dirExists failed: dirExists stat failed: sftp: "Folder not found: /user/IN/user/IN" (SSH_FX_FAILURE)
2020/06/29 11:41:38 INFO : 
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s

2020/06/29 11:41:38 DEBUG : 11 go routines active
2020/06/29 11:41:38 Failed to copy: Put mkParentDir failed: mkdir dirExists failed: dirExists stat failed: sftp: "Folder not found: /user/IN/user/IN" (SSH_FX_FAILURE)

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 29, 2020, 7:20pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/16 "2020-06-29T19:20:53Z")

</div>

Can you try the absolute test with this rclone

[https://beta.rclone.org/branch/v1.52.2-134-ga70bf051-fix-sftp-wsftp-beta/](https://beta.rclone.org/branch/v1.52.2-134-ga70bf051-fix-sftp-wsftp-beta/)

I think the previous experiment is interfering.

I'll rebuild the failed test and post a new link in a bit.

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 29, 2020, 7:42pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/17 "2020-06-29T19:42:10Z")

</div>

absolutes worked with `rclone v1.52.2-134-ga70bf051-fix-sftp-wsftp-beta` !!

```auto
$ rclone --low-level-retries 1 --retries 1 -vv copy nohup.out dddOutgoing:/user/IN
2020/06/29 13:41:01 DEBUG : rclone: Version "v1.52.2-134-ga70bf051-fix-sftp-wsftp-beta" starting with parameters ["rclone" "--low-level-retries" "1" "--retries" "1" "-vv" "copy" "nohup.out" "dddOutgoing:/user/IN"]
2020/06/29 13:41:01 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2020/06/29 13:41:01 DEBUG : fs cache: renaming cache item "nohup.out" to be canonical "/home/ubuntu"
2020/06/29 13:41:01 DEBUG : nohup.out: Need to transfer - File not found at Destination
2020/06/29 13:41:02 INFO : nohup.out: Copied (new)
2020/06/29 13:41:02 INFO : 
Transferred: 187 / 187 Bytes, 100%, 1.057 kBytes/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 0.1s

2020/06/29 13:41:02 DEBUG : 11 go routines active

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 29, 2020, 7:50pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/18 "2020-06-29T19:50:52Z")

</div>

Whoo! We are getting somewhere.

So it looks like the WS FTP server has a problem with relative paths.

I could do a server quirk for it.

I think we need to take a look at what the sftp command does. Can you try your sftp session with -vvvvv and see if it logs anything about the sftp commands used?

---

<div class="post-metadata">

**Author:** ![andyklier](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@andyklier](https://forum.rclone.org/u/andyklier)\
**Post date:** [June 29, 2020, 8:13pm UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/19 "2020-06-29T20:13:52Z")

</div>

I was looking for this earlier.. needed more v's. here you go:

```auto
sftp> ls
debug3: Sending SSH2_FXP_READDIR I:3
debug3: Received reply T:104 I:3
debug3: Received 4 SSH2_FXP_NAME responses
debug3: Sending SSH2_FXP_READDIR I:4
debug3: Received reply T:101 I:4
debug3: Received SSH2_FXP_STATUS 1
debug3: Sent message SSH2_FXP_CLOSE I:5
debug3: SSH2_FXP_STATUS 0
IN OUT

```

```auto
sftp> cd IN/
debug3: Sent message fd 3 T:16 I:11
debug3: SSH_FXP_REALPATH /user/IN/ -> /user/IN size 0
debug3: Sent message fd 3 T:17 I:12
debug3: Received stat reply T:105 I:12

```

```auto
sftp> put nohup.out 
debug3: Looking up nohup.out
Uploading nohup.out to /user/IN/nohup.out
debug3: Sent message SSH2_FXP_OPEN I:17 P:/user/IN/nohup.out

nohup.out 0% 0 0.0KB/s --:-- ETAdebug3: Sent message SSH2_FXP_WRITE I:18 O:0 S:187
debug3: SSH2_FXP_STATUS 0
debug3: In write loop, ack for 18 187 bytes at 0
nohup.out 100% 187 7.6KB/s 00:00    
debug3: Sent message SSH2_FXP_CLOSE I:18
debug3: SSH2_FXP_STATUS 0

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 30, 2020, 11:00am UTC](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436/20 "2020-06-30T11:00:12Z")

</div>

Interesting, so the sftp command line client does use absolute paths everywhere - that is what the SSH\_FXP\_REALPATH code does.

I think that is probably a good enough reason for rclone to do the same. Can you have a go with this (assuming it builds properly!)

[v1.52.2-147-g7bc35801-fix-sftp-wsftp-beta](https://beta.rclone.org/branch/v1.52.2-147-g7bc35801-fix-sftp-wsftp-beta/) on branch [fix-sftp-wsftp](https://github.com/rclone/rclone/tree/fix-sftp-wsftp) (uploaded in 15-30 mins)

[Next page](https://forum.rclone.org/t/sftp-ssh-fx-failure-directory-not-found/17436.md?page=2)
