Termux-rclone/SFTP: Cannot list/sync symbolic link directory even with --copy-links

when I am trying to list my symbolic link directory in SFTP server (w/ -L) , I got error - "permission denied".
the following is my test env + rclone ls errors.

** [tree] **
u0_a1146@localhost ~ [1]> tree
_rclonetest
├── _symbolic_link-> ../bin
└── log.txt

rclone ls MY_SFTP:_rclonetest --log-level DEBUG --copy-links

2022/06/30 04:31:52 DEBUG : rclone: Version "1.58.1-termux" starting with parameters ["rclone" "ls" "MY_SFTP:_rclonetest" "--log-level" "DEBUG" "--copy-links"]
2022/06/30 04:31:52 DEBUG : Creating backend with remote "MY_SFTP:_rclonetest"
2022/06/30 04:31:52 DEBUG : Using config file from "/data/data/com.termux/files/home/.config/rclone/rclone.conf"
2022/06/30 04:31:53 DEBUG : my_sftp/_rclonetest: New connection [2001:2d8:e637:fa90:5886:41be:dc6f:e3aa]:42408->[64:ff9b::7a22:7284]:77 to "SSH-2.0-OpenSSH_8.2"
2022/06/30 04:31:53 DEBUG : my_sftp/_rclonetest: Using absolute root directory "/_rclonetest"
4943 log.txt
2022/06/30 04:31:53 DEBUG : my_sftp/_rclonetest: Connection OK after error: permission denied
2022/06/30 04:31:53 ERROR : _symboic_link: error listing: error listing "_symboic_link": ** permission denied **
2022/06/30 04:31:53 DEBUG : 11 go routines active
2022/06/30 04:31:53 Failed to ls with 2 errors: last error was: error listing "_symboic_link": ** permission denied **

As you see, there is ** permission denied ** error. I tried "rclone copy/ls MY_SFTP:bin" to eliminate any permission issue with environment and it shows no error like below.

[rclone ls direct link]

rclone ls MY_SFTP:bin --log-level DEBUG --copy-links
2022/06/30 04:37:58 DEBUG : rclone: Version "1.58.1-termux" starting with parameters ["rclone" "ls" "MY_SFTP:bin" "--log-level" "DEBUG" "--copy-links"]
2022/06/30 04:37:58 DEBUG : Creating backend with remote "MY_SFTP:bin"
2022/06/30 04:37:58 DEBUG : Using config file from "/data/data/com.termux/files/home/.config/rclone/rclone.conf"
2022/06/30 04:37:59 DEBUG : my_sftp/bin: New connection [2001:2d8:e637:fa90:5886:41be:dc6f:e3aa]:42464->[64:ff9b::7a22:7284]:77 to "SSH-2.0-OpenSSH_8.2"
2022/06/30 04:37:59 DEBUG : my_sftp/bin: Using absolute root directory "/bin"
18890 Changes
29754 README.md
4049673 peco
191394952 sist2
2022/06/30 04:38:00 DEBUG : 11 go routines active

[rclone copy to symbolic link]

u0_a1146@localhost ~/_NASSYNC [1]> rclone copy dupFiles.txt MY_SFTP:_rclonetest/_symblic_link --log-level DEBUG --copy-links
2022/06/30 04:35:29 DEBUG : rclone: Version "1.58.1-termux" starting with parameters ["rclone" "copy" "dupFiles.txt" "MY_SFTP:_rclonetest/_symblic_link" "--log-level" "DEBUG" "--copy-links"]
2022/06/30 04:35:29 DEBUG : Creating backend with remote "dupFiles.txt"
2022/06/30 04:35:29 DEBUG : local: detected overridden config - adding "{12rtk}" suffix to name
2022/06/30 04:35:29 DEBUG : Using config file from "/data/data/com.termux/files/home/.config/rclone/rclone.conf"
2022/06/30 04:35:29 DEBUG : fs cache: adding new entry for parent of "dupFiles.txt", "local{12rtk}:/data/data/com.termux/files/home/_NASSYNC"
2022/06/30 04:35:29 DEBUG : Creating backend with remote "MY_SFTP:_rclonetest/_symblic_link"
2022/06/30 04:35:30 DEBUG : my_sftp/_rclonetest/_symblic_link: New connection [2001:2d8:e637:fa90:5886:41be:dc6f:e3aa]:42446->[64:ff9b::7a22:7284]:77 to "SSH-2.0-OpenSSH_8.2"
2022/06/30 04:35:30 DEBUG : my_sftp/_rclonetest/_symblic_link: Using absolute root directory "/_rclonetest/_symblic_link"
2022/06/30 04:35:30 DEBUG : dupFiles.txt: Need to transfer - File not found at Destination
2022/06/30 04:35:31 INFO : dupFiles.txt: Copied (new)
2022/06/30 04:35:31 INFO :
Transferred: 1.960 MiB / 1.960 MiB, 100%, 0 B/s, ETA -
Transferred: 1 / 1, 100%
Elapsed time: 1.9s

Is there anybody help to clarify why rclone ls --copy-links seems not work as expected in my case?

thanks!!!

My OS is both Linux (no Windows involved

ah....my local is termux...so rclone is also termux version. only termux version have a problem!?

....

First, note that --copy-links only works with the local backend.

With sftp, it should be the default unless --sftp-skip-links is used.

I'm not sure why you are getting a permission denied error - its something to do with the configuration of the sftp server.

What happens if you have a symlink which is in the directory tree rather than out of it - does that work?

$ tree .
.
├── a
└── b -> a

Thanks Nick~
I have some problem with my FTP server now so I will try it after 10 hours later.
BTW, I dont think it is related to some sftp configuration since I tried 'rclone ls bin" w/o symbolic link
and "rclone copy _symbolink_link" and there were no permission problems..

├── bin
└──_rclonetest
        ├── _symbolic_link-> ../bin
        └── log.txt
Anyway, I will try your suggestion.

thanks!!!

Hi Nick,

Here is the result of your suggestion. but still rclone ls b have permission issue.
FYI, i copied "file-a" into _rclonetest/a to read easily.

Don't you think it is a bug with rclone-termux version?

u0_a1146@localhost ~ [1]> rclone ls -L MY_SFTP:_rclonetest/ --log-level DEBUG
2022/07/01 07:21:03 DEBUG : rclone: Version "1.58.1-termux" starting with parameters ["rclone" "ls" "-L" "MY_SFTP:_rclonetest/" "--log-level" "DEBUG"]
2022/07/01 07:21:03 DEBUG : Creating backend with remote "MY_SFTP:_rclonetest/"
2022/07/01 07:21:03 DEBUG : Using config file from "/data/data/com.termux/files/home/.config/rclone/rclone.conf"
2022/07/01 07:21:04 DEBUG : sftp://my_sftp/_rclonetest/: New connection [2001:2d8:e637:fa90:5886:41be:dc6f:e3aa]:54382->[64:ff9b::7a22:7284]:22 to "SSH-2.0-OpenSSH_8.2"
2022/07/01 07:21:04 DEBUG : sftp://my_sftp/_rclonetest/: Using absolute root directory "/_rclonetest"
4943 log.txt
2022/07/01 07:21:04 DEBUG : sftp://my_sftp/_rclonetest/: Connection OK after error: permission denied
2022/07/01 07:21:04 ERROR : b: error listing: error listing "b": permission denied
2022/07/01 07:21:04 DEBUG : sftp://my_sftp/_rclonetest/: New connection [2001:2d8:e637:fa90:5886:41be:dc6f:e3aa]:54384->[64:ff9b::7a22:7284]:22 to "SSH-2.0-OpenSSH_8.2"
2022/07/01 07:21:04 DEBUG : sftp://my_sftp/_rclonetest/: New connection [2001:2d8:e637:fa90:5886:41be:dc6f:e3aa]:54386->[64:ff9b::7a22:7284]:22 to "SSH-2.0-OpenSSH_8.2"
2022/07/01 07:21:05 DEBUG : sftp://my_sftp/_rclonetest/: Connection OK after error: permission denied
2022/07/01 07:21:05 ERROR : _symboic_link: error listing: error listing "_symboic_link": permission denied
4943 a/file-a
2022/07/01 07:21:05 DEBUG : 29 go routines active
2022/07/01 07:21:05 Failed to ls with 3 errors: last error was: error listing "_symboic_link": permission denied

thanks!!!

Rclone doesn't appear to be allowed to read the contents (destination) of the symlink.

Most likely this is something to do with the server, but it could be rclone doing something odd.

You could try running with -vv --dump bodies that might give you a clue.

Alright Nick~

let me try my purpose w/o symbolic link & thanks for your brilliant application.

thanks for your support!!!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.