ListJSON failed to load config for crypt remote

What is the problem you are having with rclone?

When overriding any of the crypt: remote configuration on the command line, lsjson will fail to work if --encrypted is passed. In my use-case, I am wanting to specify the password and password2 on the command line (obscured), after retrieving from Credential Manager, instead of insecurely storing them in the config file.

This error apparently happens because the --crypt* command line options cause "detected overridden config - adding "{-7R5S}" suffix to name". Later validations on this temporary config name cause this error:

ListJSON failed to load config for crypt remote: config name contains invalid characters - may only contain numbers, letters, _, -, ., +, @ and space, while not start with - or space, and not end with space

Removing the obscured passwords from command-line and adding them back into the config file does stop this issue.

Run the command 'rclone version' and share the full output of the command.

rclone v1.66.0
- os/version: Microsoft Windows 11 Pro 23H2 (64 bit)
- os/kernel: 10.0.22631.3447 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.22.1
- go/linking: static
- go/tags: cmount

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

crypt: wrapping a local:

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

.\rclone --config local.conf --crypt-password=x --crypt-password2=y -vv lsjson "Local_Crypted_V:scratch" --encrypted

The rclone config contents with secrets removed.

[Local_Drive]
type = local

[Local_Crypted_V]
type = crypt
remote = Local_Drive:V:/rc/crypted
filename_encoding = base32768
password=x
password2=y

A log from the command with the -vv flag

2024/05/07 23:19:25 DEBUG : rclone: Version "v1.66.0" starting with parameters ["C:\\backups\\rclone.exe" "--config" "local.conf" "--crypt-password=x" "--crypt-password2=y" "-vv" "lsjson" "Local_Crypted_V:scratch" "--encrypted"]
2024/05/07 23:19:25 DEBUG : Creating backend with remote "Local_Crypted_V:scratch"
2024/05/07 23:19:25 DEBUG : Using config file from "C:\\backups\\local.conf"
2024/05/07 23:19:25 DEBUG : Local_Crypted_V: detected overridden config - adding "{-7R5S}" suffix to name
2024/05/07 23:19:26 DEBUG : Creating backend with remote "Local_Drive:V:/rc/crypted/倡㓵熽䥠籋ጰ赝♽㪿"
2024/05/07 23:19:26 DEBUG : fs cache: renaming cache item "Local_Drive:V:/rc/crypted/倡㓵熽䥠籋ጰ赝♽㪿" to be canonical "Local_Drive://?/V:/rc/crypted/倡㓵熽䥠籋ጰ赝♽㪿"
2024/05/07 23:19:26 DEBUG : fs cache: switching user supplied name "Local_Drive:V:/rc/crypted/倡㓵熽䥠籋ጰ赝♽㪿" for canonical name "Local_Drive://?/V:/rc/crypted/倡㓵熽䥠籋ጰ赝♽㪿"
2024/05/07 23:19:26 DEBUG : fs cache: renaming cache item "Local_Crypted_V:scratch" to be canonical "Local_Crypted_V{-7R5S}:scratch"
[
2024/05/07 23:19:26 DEBUG : 2 go routines active
2024/05/07 23:19:26 Failed to lsjson: ListJSON failed to load config for crypt remote: config name contains invalid characters - may only contain numbers, letters, `_`, `-`, `.`, `+`, `@` and space, while not start with `-` or space, and not end with space

I just wanted to note that v1.67.0-beta.7927.b2f6aac75 also exhibits the same issue with the same config/commands above.

rclone v1.67.0-beta.7927.b2f6aac75
- os/version: Microsoft Windows 11 Pro 23H2 (64 bit)
- os/kernel: 10.0.22631.3447 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.22.2
- go/linking: static
- go/tags: cmount

welcome to the forum,

just wanted to be sure you knew about Configuration Encryption

Thank you. I was aware of it but avoided it because I wanted to have a clear text config for ease of recovery. On reading other docs, I came across "rclone config redacted", which I now use to dump the redacted config to my logfile. As such, I've enabled config encryption and pass the config password through the environment, and this problem went away for me.

Though, the bug still exists. Passing any --crypt parameter, such as --crypt-strict-names, causes the same problem.

You marked this as solved but if I am understanding this correctly, there is still a bug here where the algorithm for the override name (presumably a hash of some kind) will make an invalid remote name.

I think this should be a bug report still on github but maybe someone who knows this better could chime in.

I think this is a bug. I also think it will be quite easy to fix.

Can you make an issue on GitHub please?

Thanks

Thank you -- opened an issue: ListJSON failed to load config for crypt remote · Issue #7833 · rclone/rclone · GitHub