Can't parse mountOpt when running rclone rc mount/mount

What is the problem you are having with rclone?

I am getting an error when rclone tries to parse the mountOpt json when running rclone rc mount/mount. I am following the format as specified in the docs exactly. Example:

.\rclone.exe rc mount/mount fs=“profile:vol/:” mountPoint=C:\\mount mountOpt='{"NetworkMode": true}'

The docs example here shows the command should be:

rclone rc mount/mount fs=TestDrive: mountPoint=/mnt/tmp vfsOpt='{"CacheMode": 2}' mountOpt='{"AllowOther": true}'

The command works correctly if I don't include the mountOpt argument at all.
Judging by the output from the command below, it seems like it's unable to parse the JSON string "{NetworkMode: true}", NetworkMode probably needs to wrapped in "'s but that would break the JSON it is residing in.

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

rclone v1.64.0

  • os/version: Microsoft Windows Server 2022 Datacenter 21H2 (64 bit)
  • os/kernel: 10.0.20348.1129 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.21.1
  • go/linking: static
  • go/tags: cmount

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

Amazon S3

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

.\rclone.exe rc mount/mount fs=“profile:vol/:” mountPoint=C:\\mount mountOpt='{"NetworkMode": true}'

The rclone config contents with secrets removed.

Not relevant, I know this is working

A log from the command with the -vv flag

2023/10/10 17:06:26 Failed to rc: failed to read rc response: 400 Bad Request: {
        "error": "key \"mountOpt\": invalid character 'N' looking for beginning of object key string",
        "input": {
                "fs": "profile:vol/:",
                "mountOpt": "{NetworkMode: true}",
                "mountPoint": "C:\\\\mount"
        },
        "path": "mount/mount",
        "status": 400

This command line only works on Linux, as Windows command does not understand 'single quotes' in the command line. You can escape the double quotes by doubling them up, so something like

rclone rc mount/mount fs=TestDrive: mountPoint=/mnt/tmp "vfsOpt={""CacheMode"": 2}" "mountOpt={""AllowOther"": true}"

Powershell has a different set of rules and I think the original quoting might work there.

I have tried the double quote method too, I don't think it's a powershell syntax issue as the command is running, it seems like an error within rclone.

The other error I have seen when adjusting the syntax is:

Failed to rc: no '=' found in parameter "true}"

Ahh I've solved it. The Windows syntax should be:

.\rclone.exe rc mount/mount fs=“profile:name/” mountPoint=C:\\mount 'mountOpt={\"NetworkMode\": true}'
1 Like

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