Repository navigation
Open
Milestone
Description
What is the problem you are having with rclone?
Rclone requires ‛ before / even with --local-encoding None, but not with other full width characters like ?.
What is your rclone version (output from rclone version)
rclone v1.55.1
- os/type: linux
- os/arch: amd64
- go/version: go1.16.3
- go/linking: static
- go/tags: none
Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
Ubuntu 20 64 bit
Which cloud storage system are you using? (e.g. Google Drive)
local, google drive
The command you were trying to run (e.g. rclone copy /tmp remote:tmp)
rclone copy --local-encoding None 'a/b' gdrive:
A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)
uu@hh /tmp/tmp.nIO15081l8 % rclone copy --local-encoding None -vv 'a/b' gdrive:
2021/05/02 14:39:58 DEBUG : Using config file from "/home/uu/.config/rclone/rclone.conf"
2021/05/02 14:39:58 DEBUG : rclone: Version "v1.55.1" starting with parameters ["rclone" "copy" "--local-encoding" "None" "-vv" "a/b" "gdrive:"]
2021/05/02 14:39:58 DEBUG : Creating backend with remote "a/b"
2021/05/02 14:39:58 DEBUG : local: detected overridden config - adding "{sb0+v}" suffix to name
2021/05/02 14:39:58 DEBUG : fs cache: renaming cache item "a/b" to be canonical "local{sb0+v}:/tmp/tmp.nIO15081l8/a/b"
2021/05/02 14:39:58 DEBUG : Creating backend with remote "gdrive:"
2021/05/02 14:39:58 ERROR : : error reading source directory: directory not found
2021/05/02 14:39:58 DEBUG : Google drive root '': Waiting for checks to finish
2021/05/02 14:39:58 DEBUG : Google drive root '': Waiting for transfers to finish
2021/05/02 14:39:58 ERROR : Attempt 1/3 failed with 1 errors and: directory not found
2021/05/02 14:39:59 ERROR : : error reading source directory: directory not found
2021/05/02 14:39:59 DEBUG : Google drive root '': Waiting for checks to finish
2021/05/02 14:39:59 DEBUG : Google drive root '': Waiting for transfers to finish
2021/05/02 14:39:59 ERROR : Attempt 2/3 failed with 1 errors and: directory not found
2021/05/02 14:39:59 ERROR : : error reading source directory: directory not found
2021/05/02 14:39:59 DEBUG : Google drive root '': Waiting for checks to finish
2021/05/02 14:39:59 DEBUG : Google drive root '': Waiting for transfers to finish
2021/05/02 14:39:59 ERROR : Attempt 3/3 failed with 1 errors and: directory not found
2021/05/02 14:39:59 INFO :
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.6s
2021/05/02 14:39:59 DEBUG : 5 go routines active
2021/05/02 14:39:59 Failed to copy: directory not found
Works normally after adding ‛.
uu@hh /tmp/tmp.nIO15081l8 % rclone copy --local-encoding None -vv 'a‛/b' gdrive:
2021/05/02 14:40:13 DEBUG : Using config file from "/home/uu/.config/rclone/rclone.conf"
2021/05/02 14:40:13 DEBUG : rclone: Version "v1.55.1" starting with parameters ["rclone" "copy" "--local-encoding" "None" "-vv" "a‛/b" "gdrive:"]
2021/05/02 14:40:13 DEBUG : Creating backend with remote "a‛/b"
2021/05/02 14:40:13 DEBUG : local: detected overridden config - adding "{sb0+v}" suffix to name
2021/05/02 14:40:13 DEBUG : fs cache: adding new entry for parent of "a‛/b", "local{sb0+v}:/tmp/tmp.nIO15081l8"
2021/05/02 14:40:13 DEBUG : Creating backend with remote "gdrive:"
2021/05/02 14:40:13 DEBUG : a‛/b: Need to transfer - File not found at Destination
2021/05/02 14:40:14 DEBUG : a‛/b: MD5 = d41d8cd98f00b204e9800998ecf8427e OK
2021/05/02 14:40:14 INFO : a‛/b: Copied (new)
2021/05/02 14:40:14 INFO :
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Transferred: 1 / 1, 100%
Elapsed time: 1.3s
2021/05/02 14:40:14 DEBUG : 5 go routines active
With other full width character it works as expected without ‛.
uu@hh /tmp/tmp.nIO15081l8 % rclone copy --local-encoding None -vv 'a?b' gdrive:
2021/05/02 14:45:00 DEBUG : Using config file from "/home/uu/.config/rclone/rclone.conf"
2021/05/02 14:45:00 DEBUG : rclone: Version "v1.55.1" starting with parameters ["rclone" "copy" "--local-encoding" "None" "-vv" "a?b" "gdrive:"]
2021/05/02 14:45:00 DEBUG : Creating backend with remote "a?b"
2021/05/02 14:45:00 DEBUG : local: detected overridden config - adding "{sb0+v}" suffix to name
2021/05/02 14:45:00 DEBUG : fs cache: adding new entry for parent of "a?b", "local{sb0+v}:/tmp/tmp.nIO15081l8"
2021/05/02 14:45:00 DEBUG : Creating backend with remote "gdrive:"
2021/05/02 14:45:00 DEBUG : a?b: Need to transfer - File not found at Destination
2021/05/02 14:45:01 DEBUG : a?b: MD5 = d41d8cd98f00b204e9800998ecf8427e OK
2021/05/02 14:45:01 INFO : a?b: Copied (new)
2021/05/02 14:45:01 INFO :
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Transferred: 1 / 1, 100%
Elapsed time: 1.1s
2021/05/02 14:45:01 DEBUG : 4 go routines active
When listing it seems opposite of what should happen.
uu@hh /tmp/tmp.nIO15081l8 % rclone lsf --local-encoding None .
a‛/b
a?b
uu@hh /tmp/tmp.nIO15081l8 % rclone lsf .
a/b
a?b
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Reacted by ximellon
Activity
ncw commentedon May 3, 2021
This is to do with the fact that drive file names can have
/in, so rclone translates to and from/.Are you trying to upload a file with a
/in to google drive? If so you want to use--drive-encoding Slashrather than turning off the encoding locally.ncw commentedon May 4, 2021
This works for me
Do you have other config in the config file - eg a
localsection?Can you do this please on your test file directory
ncw commentedon May 14, 2021
That is because
/is translated by the google drive backend whereas?isn't.ncw commentedon May 16, 2021
That is a good explanation.
Would you like to propose an update to the docs?
ximellon commentedon Jan 9, 2022
First of all
This is obviously not true. As you can view from the code, all other full-width characters, except Slash, are also controlled by their half-width counterpart separately.
And I also think @ncw 's solution isn't good.
--local-encoding Noneis to tellrclonenot to do the conversion. But--drive-encoding Slashis to tellrclonedo another conversion to fix (reverse) the previous conversion. The result is the same. But the thoughts behind are quite different.I guess I figure it out where the problem is: you do the conversion in 2 passes.
The problem happens after phase 1. As I observed,
rclonetends to take the result of phase 1 + decoding (based on your configuration) to match with your command arguments. So you cannot purely specify/(full-width Slash) with--local-encoding Nonesince it has already got escaped as‛/and won't be converted back to/based on theNoneconfiguration.@cuevavirus also mentioned that he cannot do
copycommand with--drive-encoding Question. The problem is probably not on the Google Drive side. but the local conversion. Since he did it on Windows,?(full-width Question) will be encoding to?(half-width Question) by default. which causesrclonecouldn't find the target if he specified the argument with?(full-width Question).A simple test based on the latest
rclone:To fix this weird issue without changing a lot. Here's my idea:
/(separator for path?) with characters different from full-width Slash so that you won't need to do filename escaping at phase 1.I could understand you must put a lot of effort to do these conversions to keep filename consistent. But for me, I think an extra file to record what has been changed to the filenames is good enough and much simpler, easier to implement. Finally, if you could show some message (at the beginning or ending) to tell users that their filename could somewhat be changed, it would be fantastic!
Thank you.
NB. I still might be wrong with this issue. And there could be a better solution for it.
P.S. I'm from Asia region. So basically we use full-width characters more often. And that's why my English isn't good. Feel free to discuss with me if you couldn't understand what I'm talking about. I'll do my best to explain my thought. =)
ximellon commentedon Jan 10, 2022
True. But not the right way since the whole process takes two conversion, which is not our (at least my) willing then.
This is not true. I've tested it. As I expected, with default gdrive encoding setup (
InvlidUtf8only) and--local-encoding Slash(on Windows), by specifying/(full-width Slash), you'll finally got/(half-width Slash) in your filename on gdrive side, which is inconsistent with your command argument. And this is the reason why I thought you should fix it. It's so weird and counterintuitive.I think I might be wrong with the two-pass conversion. There's no 2nd pass but the receive end decoding. And it causes some weird situation when you using full-width characters in your filename since you simply normalize their counterpart half-width one to full-width, you must do some other conversion for it or you won't be able to tell them apart.
Conclusion:
‛/explicitly since it should be the right way (no conversion) to get things done.‛/is the only (or else?) exception for implicit conversion even when you set encoding toNoneon both side.