Connection Strings with remote gdrive does NOT work!

What is the problem you are having with rclone?

Using the Connection Strings keep throwing me error

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

rclone version
rclone v1.59.0-beta.6115.a3d430789
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.4.0-107-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.18.1
- go/linking: static
- go/tags: none

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

Google Drive

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

rclone ls "my-remote-gdrive,root-folder-id=XXXXXXX:" -vv
<7>DEBUG : rclone: Version "v1.59.0-beta.6115.a3d430789" starting with parameters ["rclone" "ls" "my-remote-gdrive,root-folder-id=XXXXXXX:" "-vv"]
<7>DEBUG : rclone: systemd logging support activated
Failed to create file system for "my-remote-gdrive,root-folder-id=XXXXXXX:": config parameters may only contain `0-9`, `A-Z`, `a-z` and `_`

The command without Connection Strings works just fine

rclone ls "my-remote-gdrive:" -vv
<7>DEBUG : rclone: Version "v1.59.0-beta.6115.a3d430789" starting with parameters ["rclone" "ls" "my-remote-gdrive:" "-vv"]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Creating backend with remote "my-remote-gdrive:"
<7>DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
<7>DEBUG : Google drive root '': 'root_folder_id = XXXXXXX' - save this in the config to speed up startup
    65272 file_1.ext
    65272 file_2.ext

The rclone config contents with secrets removed.

rclone config dump
{
    "my-remote-gdrive": {
        "scope": "drive",
        "team_drive": "",
        "token": "{\"access_token\":\"...\",\"token_type\":\"Bearer\",\"refresh_token\":\"...\",\"expiry\":\"...\"}",
        "type": "drive"
    }
}

You seem to have a ":" at the end of the parameter which isn't valid, but in my testing, even removing that doesn't seem to work for me either.

felix@gemini:~$ rclone lsf GD,root_folder_id='0AGoj85v3xeadUk9PVA'  -vvv
2022/05/06 08:10:05 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2022/05/06 08:10:05 DEBUG : rclone: Version "v1.58.1" starting with parameters ["rclone" "lsf" "GD,root_folder_id=0AGoj85v3xeadUk9PVA" "-vvv"]
2022/05/06 08:10:05 DEBUG : Creating backend with remote "GD,root_folder_id=0AGoj85v3xeadUk9PVA"
2022/05/06 08:10:05 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2022/05/06 08:10:05 DEBUG : fs cache: renaming cache item "GD,root_folder_id=0AGoj85v3xeadUk9PVA" to be canonical "/home/felix/GD,root_folder_id=0AGoj85v3xeadUk9PVA"
2022/05/06 08:10:05 ERROR : : error listing: directory not found
2022/05/06 08:10:05 DEBUG : 2 go routines active
2022/05/06 08:10:05 Failed to lsf with 2 errors: last error was: error in ListJSON: directory not found

Hmm, the docs seem off a bit as that does seem to work for me with the ":"

felix@gemini:~$ rclone ls GD,root_folder_id='0AGoj85v3xeadUk9PVA:' -vv
2022/05/06 08:16:31 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2022/05/06 08:16:31 DEBUG : rclone: Version "v1.58.1" starting with parameters ["rclone" "ls" "GD,root_folder_id=0AGoj85v3xeadUk9PVA:" "-vv"]
2022/05/06 08:16:31 DEBUG : Creating backend with remote "GD,root_folder_id=0AGoj85v3xeadUk9PVA:"
2022/05/06 08:16:31 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2022/05/06 08:16:31 DEBUG : GD: detected overridden config - adding "{2wAxU}" suffix to name
2022/05/06 08:16:31 DEBUG : fs cache: renaming cache item "GD,root_folder_id=0AGoj85v3xeadUk9PVA:" to be canonical "GD{2wAxU}:"
2022/05/06 08:16:32 DEBUG : Test Map: Ignoring unknown document type "application/vnd.google-apps.map"
      236 hosts
        0 test.tar
       -1 TestDoc.docx
      184 testcopy
   306520 RDManager
       -1 test/testsheet.xlsx
2022/05/06 08:16:32 DEBUG : 4 go routines active

Can you please test with the latest stable?

Note the parameter is named root_folder_id not root-folder-id, so I suspect this will work

rclone ls "my-remote-gdrive,root_folder_id=XXXXXXX:" -vv

If the XXX has characters like : in, then you need this, but I don't think that is true of drive IDs

rclone ls "my-remote-gdrive,root_folder_id='XXXXXXX':" -vv

Oh thanks. I auto corrected the "-" in my command and did not notice that either.

1 Like

Oh, my bad typo on a late-night work. It works as expected now. Thanks, Nick.

1 Like

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