Need help fixing my Gdrive rclone Mount

What is the problem you are having with rclone?

broke my rclone gdrive mount. Accidentally deleted my rclone.conf when trying to migrate to portainer and wasn't thinking on my bind mounts I directed it to where my rclone.conf was and deleted it on accident. I tried copy/pasting my conf from my macbook pro rclone conf b/c with googles new security you can't authenticate with 2.0 auth anymore. I have tested it on 1.60.1 trying to create a new project with new credentials as well I still run into the 400 error when trying to get the auth token.

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

1.60.1

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)

systemctl start rclone
rclone mount gdrive: /mnt/gdrive -vv

[Unit]  
Description=Google Drive (rclone)  
AssertPathIsDirectory=/mnt/gdrive  
After=plexdrive.service  

[Service]  
Type=notify  
ExecStart=/usr/local/bin/rclone mount \  
        --config=/root/.config/rclone/rclone.conf \  
        --allow-other \  
        --cache-tmp-upload-path=/tmp/rclone/upload \  
        --cache-chunk-path=/tmp/rclone/chunks \   
        --cache-workers=8 \  
        --cache-writes \  
        --cache-dir=/tmp/rclone/vfs \  
        --cache-db-path=/tmp/rclone/db \  
        --no-modtime \  
        --drive-use-trash \  
        --stats=0 \  

The rclone config contents with secrets removed.

[gdrive]
type = drive
client_id = 
client_secret = 
scope = drive
token =
team_drive =

A log from the command with the -vv flag

root@raspberrypi:/home/homebridge# rclone -vv config
2022/11/22 11:36:39 DEBUG : rclone: Version "v1.60.1" starting with parameters ["rclone" "-vv" "config"]
2022/11/22 11:36:39 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
Current remotes:

Name                 Type
====                 ====
gdrive               drive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> 

root@raspberrypi:/mnt/gdrive# rclone mount gdrive: /mnt/gdrive -vv
2022/11/22 11:42:46 DEBUG : rclone: Version "v1.60.1" starting with parameters ["rclone" "mount" "gdrive:" "/mnt/gdrive" "-vv"]
2022/11/22 11:42:46 DEBUG : Creating backend with remote "gdrive:"
2022/11/22 11:42:46 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2022/11/22 11:42:47 DEBUG : Google drive root '': 'root_folder_id = 0AB8_V9ccqTE2Uk9PVA' - save this in the config to speed up startup
2022/11/22 11:42:47 DEBUG : Google drive root '': Mounting on "/mnt/gdrive"
2022/11/22 11:42:47 DEBUG : : Root: 
2022/11/22 11:42:47 DEBUG : : >Root: node=/, err=<nil>
2022/11/22 11:42:48 DEBUG : /: Attr: 
2022/11/22 11:42:48 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2022/11/22 11:42:58 DEBUG : /: Attr: 
2022/11/22 11:42:58 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
^C2022/11/22 11:42:59 INFO  : Signal received: interrupt
2022/11/22 11:42:59 ERROR : /mnt/gdrive: Unmounted rclone mount
2022/11/22 11:42:59 INFO  : Exiting...
root@raspberrypi:/mnt/gdrive# 

Guide that I followed couple years ago Mounting Google Drive on Raspberry Pi - 2019 Version | by Artur Klauser | Medium | Medium

root@raspberrypi:/mnt# rclone config file
Configuration file is stored at:
/root/.config/rclone/rclone.conf

hello and welcome to the forum,

recently, google changed the ouath process, so rclone had to change with it.

if you run rclone lsd gdrive: -vv might see something like,
need to run rclone config reconnect gdrive: -vv

and based on your config, these flags do nothing, for the deprecated cache remote, which is not needed for plex.

--cache-tmp-upload-path=/tmp/rclone/upload \  
--cache-chunk-path=/tmp/rclone/chunks \   
--cache-workers=8 \  
--cache-writes \  
--cache-db-path=/tmp/rclone/db \

now it is recommend to use --vfs-cache-mode

Cache (DEPRECATED)

so what do I need to change in my config to get this to work again? I am confused.

run rclone config reconnect gdrive: -vv
and test with rclone lsd gdrive:

so when I run that and try to get a new auth token I am still get blocked.

image

root@raspberrypi:/mnt/gdrive# rclone config reconnect gdrive: -vv
2022/11/22 12:14:10 DEBUG : rclone: Version "v1.60.1" starting with parameters ["rclone" "config" "reconnect" "gdrive:" "-vv"]
2022/11/22 12:14:10 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2022/11/22 12:14:10 DEBUG : gdrive: config in: state="", result=""
2022/11/22 12:14:10 DEBUG : gdrive: config out: out=&{State:*oauth,teamdrive,, Option: OAuth: Error: Result:}, err=
2022/11/22 12:14:10 DEBUG : gdrive: config in: state="*oauth,teamdrive,,", result=""
2022/11/22 12:14:10 DEBUG : gdrive: config out: out=&{State:*oauth-confirm,teamdrive,, Option:true OAuth: Error: Result:}, err=
2022/11/22 12:14:10 DEBUG : gdrive: config: reading config parameter "config_refresh_token"
Already have a token - refresh?
y) Yes (default)
n) No
y/n> y

2022/11/22 12:14:15 DEBUG : gdrive: config in: state="*oauth-confirm,teamdrive,,", result="true"
2022/11/22 12:14:15 DEBUG : gdrive: config out: out=&{State:*oauth-islocal,teamdrive,, Option:true OAuth: Error: Result:}, err=
2022/11/22 12:14:15 DEBUG : gdrive: config: reading config parameter "config_is_local"
Use auto config?

  • Say Y if not sure
  • Say N if you are working on a remote or headless machine

y) Yes (default)
n) No
y/n> y

2022/11/22 12:14:17 DEBUG : gdrive: config in: state="*oauth-islocal,teamdrive,,", result="true"
2022/11/22 12:14:17 DEBUG : gdrive: config out: out=&{State:*oauth-do,teamdrive,, Option: OAuth: Error: Result:}, err=
2022/11/22 12:14:17 DEBUG : gdrive: config in: state="*oauth-do,teamdrive,,", result=""
2022/11/22 12:14:17 NOTICE: Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config.
2022/11/22 12:14:17 DEBUG : Starting auth server on 127.0.0.1:53682
2022/11/22 12:14:17 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state= -REDACTEd-
2022/11/22 12:14:17 NOTICE: Log in and authorize rclone for access
2022/11/22 12:14:17 NOTICE: Waiting for code...
2022/11/22 12:14:33 DEBUG : Redirecting browser to: Anmelden – Google Konten -REDACTED-

take a look at this post from yesterday, this was solved at
https://forum.rclone.org/t/how-to-move-rclone-to-a-new-pc-the-remote-drive-isnt-changing/34244/18?u=asdffdsa

and do not try rclone mount until rclone lsd works.

image

so folders show up with the lsd command thats my root directory on my gdrive.

good, now try your mount command
rclone mount gdrive: /mnt/gdrive -vv

root@raspberrypi:/home/homebridge/.config/rclone# rclone mount gdrive: /mnt/gdrive -vv
2022/11/22 14:18:10 DEBUG : rclone: Version "v1.60.1" starting with parameters ["rclone" "mount" "gdrive:" "/mnt/gdrive" "-vv"]
2022/11/22 14:18:10 DEBUG : Creating backend with remote "gdrive:"
2022/11/22 14:18:10 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2022/11/22 14:18:11 DEBUG : Google drive root '': 'root_folder_id = 0AB8_V9ccqTE2Uk9PVA' - save this in the config to speed up startup
2022/11/22 14:18:11 DEBUG : Google drive root '': Mounting on "/mnt/gdrive"
2022/11/22 14:18:11 DEBUG : : Root: 
2022/11/22 14:18:11 DEBUG : : >Root: node=/, err=<nil>
2022/11/22 14:18:20 DEBUG : /: Attr: 
2022/11/22 14:18:20 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2022/11/22 14:18:30 DEBUG : /: Attr: 
2022/11/22 14:18:30 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2022/11/22 14:18:41 DEBUG : /: Attr: 
2022/11/22 14:18:41 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
2022/11/22 14:18:51 DEBUG : /: Attr: 
2022/11/22 14:18:51 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
^C2022/11/22 14:18:55 INFO  : Signal received: interrupt
2022/11/22 14:18:55 ERROR : /mnt/gdrive: Unmounted rclone mount
2022/11/22 14:18:55 INFO  : Exiting...
root@raspberrypi:/home/homebridge/.config/rclone#

ok, looks good, is there a problem now?

Yea the drive still won't mount.

well, looks like the mount worked, no errors and that you manually killed the mount using ^C

first get the mount working on the command line, no point in trying systemd, ok?

rclone.service - Google Drive (rclone)
     Loaded: loaded (/etc/systemd/system/rclone.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Tue 2022-11-22 18:47:28 CST; 5s ago
    Process: 25015 ExecStart=/usr/local/bin/rclone mount --config=/root/.config/rclone/rclone.conf --allow-other --vfs-cache-mode --cache-dir=/tmp/rclone/vfs --no-modtime --drive-use-trash >
   Main PID: 25015 (code=exited, status=1/FAILURE)
        CPU: 216ms

Nov 22 18:47:28 raspberrypi rclone[25015]:       --vfs-write-wait duration                Time to wait for in-sequence write before giving error (default 1s)
Nov 22 18:47:28 raspberrypi rclone[25015]:       --volname string                         Set the volume name (supported on Windows and OSX only)
Nov 22 18:47:28 raspberrypi rclone[25015]:       --write-back-cache                       Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is use>
Nov 22 18:47:28 raspberrypi rclone[25015]: Use "rclone [command] --help" for more information about a command.
Nov 22 18:47:28 raspberrypi rclone[25015]: Use "rclone help flags" for to see the global flags.
Nov 22 18:47:28 raspberrypi rclone[25015]: Use "rclone help backends" for a list of supported services.
Nov 22 18:47:28 raspberrypi rclone[25015]: 2022/11/22 18:47:28 Fatal error: invalid argument "--cache-dir=/tmp/rclone/vfs" for "--vfs-cache-mode" flag: unknown cache mode level "--cache-dir>
Nov 22 18:47:28 raspberrypi systemd[1]: rclone.service: Main process exited, code=exited, status=1/FAILURE
Nov 22 18:47:28 raspberrypi systemd[1]: rclone.service: Failed with result 'exit-code'.
Nov 22 18:47:28 raspberrypi systemd[1]: Failed to start Google Drive (rclone).
/etc/systemd/system/rclone.service
[Unit]
Description=Google Drive (rclone)
AssertPathIsDirectory=/mnt/gdrive
After=plexdrive.service

[Service]
Type=notify
ExecStart=/usr/local/bin/rclone mount \
        --config=/root/.config/rclone/rclone.conf \
        --allow-other \
        --vfs-cache-mode \
        --cache-dir=/tmp/rclone/vfs \
        --no-modtime \
        --drive-use-trash \
        --stats=0 \
        --checkers=16 \
        --bwlimit=40M \
        --dir-cache-time=60m \
        --cache-info-age=60m Gdrive:/ /mnt/gdrive
ExecStop=/bin/fusermount -u /mnt/gdrive
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

try --vfs-cache-mode=full

and remove these, as they do nothing
--checkers=16
--cache-info-age=60m

root@raspberrypi:/mnt/gdrive# systemctl status rclone.service
● rclone.service - Google Drive (rclone)
     Loaded: loaded (/etc/systemd/system/rclone.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Tue 2022-11-22 19:01:16 CST; 3s ago
    Process: 31898 ExecStart=/usr/local/bin/rclone mount --config=/root/.config/rclone/rclone.conf --allow-other --vfs-cache-mode=full --cache-dir=/tmp/rclone/vfs --no-modtime --drive-use-t>
   Main PID: 31898 (code=exited, status=1/FAILURE)
        CPU: 180ms

Nov 22 19:01:16 raspberrypi rclone[31898]:       --vfs-write-wait duration                Time to wait for in-sequence write before giving error (default 1s)
Nov 22 19:01:16 raspberrypi rclone[31898]:       --volname string                         Set the volume name (supported on Windows and OSX only)
Nov 22 19:01:16 raspberrypi rclone[31898]:       --write-back-cache                       Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is use>
Nov 22 19:01:16 raspberrypi rclone[31898]: Use "rclone [command] --help" for more information about a command.
Nov 22 19:01:16 raspberrypi rclone[31898]: Use "rclone help flags" for to see the global flags.
Nov 22 19:01:16 raspberrypi rclone[31898]: Use "rclone help backends" for a list of supported services.
Nov 22 19:01:16 raspberrypi rclone[31898]: 2022/11/22 19:01:16 Fatal error: unknown flag: --Gdrive:/
Nov 22 19:01:16 raspberrypi systemd[1]: rclone.service: Main process exited, code=exited, status=1/FAILURE
Nov 22 19:01:16 raspberrypi systemd[1]: rclone.service: Failed with result 'exit-code'.
Nov 22 19:01:16 raspberrypi systemd[1]: Failed to start Google Drive (rclone).
lines 1-17/17 (END)

/etc/systemd/system/rclone.service
[Unit]
Description=Google Drive (rclone)
AssertPathIsDirectory=/mnt/gdrive
After=plexdrive.service

[Service]
Type=notify
ExecStart=/usr/local/bin/rclone mount \
        --config=/root/.config/rclone/rclone.conf \
        --allow-other \
        --vfs-cache-mode=full \
        --cache-dir=/tmp/rclone/vfs \
        --no-modtime \
        --drive-use-trash \
        --stats=0 \
        --bwlimit=40M \
        --dir-cache-time=60m \
        --Gdrive:/ /mnt/gdrive
ExecStop=/bin/fusermount -u /mnt/gdrive
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

I removed --Gdrive:/ /mnt/gdrive and got this.

root@raspberrypi:/mnt/gdrive# systemctl status rclone.service
● rclone.service - Google Drive (rclone)
     Loaded: loaded (/etc/systemd/system/rclone.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-11-22 19:07:26 CST; 43s ago
   Main PID: 2234 (rclone)
     Status: "[19:07] vfs cache: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)"
      Tasks: 10 (limit: 3720)
        CPU: 294ms
     CGroup: /system.slice/rclone.service
             └─2234 /usr/local/bin/rclone mount --config=/root/.config/rclone/rclone.conf --allow-other --vfs-cache-mode=full --cache-dir=/tmp/rclone/vfs --no-modtime --drive-use-trash --st>

Nov 22 19:07:25 raspberrypi systemd[1]: Starting Google Drive (rclone)...
Nov 22 19:07:26 raspberrypi systemd[1]: Started Google Drive (rclone).
Nov 22 19:07:35 raspberrypi rclone[2234]: ERROR : Local file system at /ExecStop=/bin/fusermount: Statfs failed: directory not found

sorry, confused,
before the name of the remote was gdrive and now you are using Gdrive
so which is correct???

fwiw, get rclone mount to work on the command like, not using systemd.
only then, after rclone mount is working on the command line, then try systemd, ok?