Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListJSON failed to load config for crypt remote #7833

Closed
egatenby opened this issue May 10, 2024 · 3 comments
Closed

ListJSON failed to load config for crypt remote #7833

egatenby opened this issue May 10, 2024 · 3 comments
Labels
Milestone

Comments

@egatenby
Copy link

egatenby commented May 10, 2024

The associated forum post URL from https://forum.rclone.org

https://forum.rclone.org/t/listjson-failed-to-load-config-for-crypt-remote/45915/1

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. For example, passing --crypt-strict-names or --crypt-password or --crypt-password2. 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

What is your rclone version (output from rclone version)

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

and latest beta

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

Which OS you are using and how many bits (e.g. Windows 7, 64 bit)

Microsoft Windows 11 Pro 23H2 (64 bit)

Which cloud storage system are you using? (e.g. Google Drive)

crypt: wrapping a local:

The command you were trying to run (e.g. rclone copy /tmp remote:tmp)

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

My configuration:

[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 (e.g. output from rclone -vv copy /tmp remote:tmp)

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

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.
ncw added a commit that referenced this issue May 11, 2024
Before this change an `rclone lsjson --encrypted` command where
additional `--crypt-` parameters were supplied on the command line:

    rclone lsjson --crypt-description XXX --encrypted secret:

Produced an error like this:

    Failed to lsjson: ListJSON failed to load config for crypt remote: config name contains invalid characters...

This was due to an incorrect lookup of the crypt config to create the
encrypted mapping.

Fixes #7833
@ncw
Copy link
Member

ncw commented May 11, 2024

Thanks for reporting this.

This should be easy to fix - please give this a try

v1.67.0-beta.7930.175b8364e.fix-7833-lsjson-crypt on branch fix-7833-lsjson-crypt (uploaded in 15-30 mins)

@ncw ncw added the bug label May 11, 2024
@ncw ncw added this to the v1.67 milestone May 11, 2024
@egatenby
Copy link
Author

v1.67.0-beta.7930.175b8364e.fix-7833-lsjson-crypt worked. thank you!

@ncw ncw closed this as completed in 0735f44 May 13, 2024
@ncw
Copy link
Member

ncw commented May 13, 2024

Thank you for testing.

I've merged this to master now which means it will be in the latest beta in 15-30 minutes and released in v1.67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants