Switching from Plexdrive to Rclone Cache - broken Mount

Not a total Noob but definitely enough knowledge to be dangerous … to my self.

I have kinda been going in circles and don’t know what to do at this point. Any help would be appreciated

Rclone version 1.40-045-g0358e9e7(then a diamond symbol)

So I switched from using Plexdrive to Rclone cache. I have this working on another VPS and its great. But for what ever reasons its not working out on this machine.

Previous setup
Google Drive Crypt > Plexdrive > decrypt of Plexdrive and then a mount of the decrypted remote (this worked well for a long time - a Plex server then points to the final mount)

Current setup
Google Drive Crypt > Rclone Cache > decrypt of R. Cache and then a mount of the decrypt remote

I have Mounts for all that are started automatically using systemd service

OK. So I changed the config of the decrypt remote to point to the Rclone Cache remote mount and now my systemd service that is supposed to create a mount of the decrypted remote will not start reliably.
It creates the folder /mnt/media but there is nothing in it. Sometimes if I wait 5 or 10 minutes then /mnt/media gets populated and everything works until a reboot where it doesn’t reload properly once again.

Sorry I’m not sure if any of that was clear. Im not sure how to generate logs but I can provide further information regarding the Rclone remotes and the systemd Mounts

[GdriveCache]
type = cache
remote = google:encrypted
plex_url = http://127.0.0.1:32400
plex_username = redacted
plex_password = *** ENCRYPTED ***
chunk_size = 5M
info_age = 6h
chunk_total_size = 10G

Decrypt of Cache remote
[local-crypt]
type = crypt
remote = /mnt/GdriveCache
filename_encryption = standard
password = *** ENCRYPTED ***
password2 = *** ENCRYPTED ***
directory_name_encryption = true

systemd service Mounts

Mount for GdriveCache

[Unit]
Description=Mount and cache Google drive encrypted to /mnt/GdriveCache
After=syslog.target local-fs.target network.target
[Service]
Type=simple
User=root
ExecStartPre=-/bin/mkdir /mnt/GdriveCache
ExecStart=/usr/bin/rclone mount
–config /home/eliteuser/.config/rclone/rclone.conf
–allow-other
–dir-cache-time=1m
–buffer-size=64M
–cache-info-age 8h
–cache-writes
–cache-workers=5
–cache-chunk-size=5M
GdriveCache: /mnt/GdriveCache
ExecStop=/bin/fusermount -u -z /mnt/GdriveCache
ExecStop=/bin/rmdir /mnt/GdriveCache
Restart=always
[Install]
WantedBy=multi-user.target

Mount for local-crypt

[Unit]
Description=Mount local-crypt to /mnt/media
After=syslog.target local-fs.target network.target plexdrive.service
[Service]
Type=simple
User=root
ExecStartPre=-/bin/mkdir /mnt/media
ExecStart=/usr/bin/rclone mount
–config /home/eliteuser/.config/rclone/rclone.conf
–allow-other
–allow-non-empty
local-crypt: /mnt/media
ExecStop=/bin/fusermount -u -z /mnt/media
ExecStop=/bin/rmdir /mnt/media
Restart=always
[Install]
WantedBy=multi-user.target

Note
When I use
sudo rclone lsd remote:
to check for directories of the remotes then I can see the expected internal directories. Not decrypted for GdriveCache: and decrypted for local-crypt:

One other thing to note is that I can’t get rclone to update to the beta channel that I have on another server even though I am running the following command

curl https://rclone.org/install.sh | sudo bash -s beta

When I occasionally do have access to the folder /mnt/media through Plex I am only getting one worker. I think this is due to the rclone version.

Sorry about the confusing post. Hopefully there is enough information there to help diagnose the problems.

Thanks

Your rclone config looks off.

[GD]
type = drive
client_id = clientid
client_secret = clientsecret
token = {"access_token":"token","token_type":"Bearer","refresh_token":"refreshtokenhere","expiry":"2018-04-06T12:46:47.772191727-04:00"}

[gcache]
type = cache
remote = GD:media
chunk_total_size = 32G
plex_url = http://192.168.1.30:32400
plex_username = username
plex_password = password
plex_token = token

[gmedia]
type = crypt
remote = gcache:
filename_encryption = standard
password = password
password2 = password
directory_name_encryption = true

and my systemd:

[Unit]
Description=RClone Service
AssertPathIsDirectory=/home/felix
After=plexdrive.target network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount gmedia: /gmedia \
   --allow-other \
   --dir-cache-time=160h \
   --cache-chunk-size=10M \
   --cache-info-age=168h \
   --cache-workers=5 \
   --cache-tmp-upload-path /data/rclone_upload \
   --cache-tmp-wait-time 60m \
   --buffer-size 0M \
   --attr-timeout=1s \
   --syslog \
   --umask 002 \
   --rc \
   --log-level INFO
ExecStop=/usr/bin/sudo /usr/bin/fusermount -uz /gmedia
Restart=on-abort
User=felix
Group=felix

[Install]
WantedBy=default.target

Hi Animosity022 thanks for the quick response what specific parts of the rclone config are off?

I see that you have a token section relating to Plex in the Rclone Cache settings. I was never given the option to set that up. Is that something that needs to be done by editing the config file?

My Google Drive remote

[google]
type = drive
client_id = clientid
client_secret = clientsecret
service_account_file=
token = removed

Your crypt section should point back to the cache you configured and you mount the crypt.

Sorry, missed the other question. No I just entered my plex config via “rclone config” in the ‘cache’ section.

OK thanks, so just to be clear the existing;

Decrypt of Cache remote
[local-crypt]
type = crypt
remote = /mnt/GdriveCache
filename_encryption = standard
password = *** ENCRYPTED ***
password2 = *** ENCRYPTED ***
directory_name_encryption = true

should look like

Decrypt of Cache remote
[local-crypt]
type = crypt
remote = GdriveCache:
filename_encryption = standard
password = *** ENCRYPTED ***
password2 = *** ENCRYPTED ***
directory_name_encryption = true

and then mount the remote local-crypt:
with systemd (i’ll change the flags too)

[Unit]
Description=Mount RClone service
After=syslog.target local-fs.target network.target network-online.target
[Service]
Type=simple
User=root
ExecStartPre=-/bin/mkdir /mnt/media
ExecStart=/usr/bin/rclone mount
–config /home/eliteuser/.config/rclone/rclone.conf
–allow-other
–dir-cache-time=1m
–buffer-size=64M
–cache-info-age 8h
–cache-writes
–cache-workers=5
–cache-chunk-size=5M
local-crypt: /mnt/media
ExecStop=/bin/fusermount -u -z /mnt/media
ExecStop=/bin/rmdir /mnt/media
Restart=always
[Install]
WantedBy=multi-user.target

From what remus was saying, the buffer-size to 0 makes it nicer as the cache is already keeping stuff in memory and it is just unneeded overhead.

Yeah been trialling 0MB buffer and nothing seems amiss so far.

Thats working so much better. Mounted correctly on reboot and i’m able to play and fast forward.

Thank you!

I still only seem to be getting a single worker. When I look at iftop I see one connection to googlcoud servers. Should I start a new thread?

Or is that because of the lack of Plex Token in my cache remote setup?

Did you end up configuring the plex integration? If so, you should see something like:

Apr  6 13:32:45 gemini rclone[31106]: tnvepu36qiohcun8v84ddhsam0/ant9sd7rtrcm2pbsgr30i0hekfcmnak7a55d2g4mbmrsf0u14g2g/kr1f4btkd4f9apnjruqnt1a45nqcc9rol1mfjdrritllbk7egvbrq
ipv2akfi1l16lem49tklfi2e: confirmed reading by external reader

When you start to play a file. If you have debug on, you’d be able to see multiple workers going on as well in the rclone logs:

Apr  2 08:39:23 gemini rclone[11122]: worker-6 <p6o0jrkhoto752rvpps5ddf6cmtbfufu9a9k89bk7d57lg5qbeljsh10d6c0a0p61fvcq45c1a4li>: downloaded chunk 618659840
Apr  2 08:39:23 gemini rclone[11122]: worker-3 <p6o0jrkhoto752rvpps5ddf6cmtbfufu9a9k89bk7d57lg5qbeljsh10d6c0a0p61fvcq45c1a4li>: downloaded chunk 608174080
Apr  2 08:39:23 gemini rclone[11122]: worker-4 <p6o0jrkhoto752rvpps5ddf6cmtbfufu9a9k89bk7d57lg5qbeljsh10d6c0a0p61fvcq45c1a4li>: downloaded chunk 587202560
Apr  2 08:39:23 gemini rclone[11122]: worker-1 <p6o0jrkhoto752rvpps5ddf6cmtbfufu9a9k89bk7d57lg5qbeljsh10d6c0a0p61fvcq45c1a4li>: downloaded chunk 639631360
Apr  2 08:39:23 gemini rclone[11122]: worker-5 <p6o0jrkhoto752rvpps5ddf6cmtbfufu9a9k89bk7d57lg5qbeljsh10d6c0a0p61fvcq45c1a4li>: downloaded chunk 660602880
Apr  2 08:39:23 gemini rclone[11122]: worker-7 <p6o0jrkhoto752rvpps5ddf6cmtbfufu9a9k89bk7d57lg5qbeljsh10d6c0a0p61fvcq45c1a4li>: downloaded chunk 650117120
Apr  2 08:39:23 gemini rclone[11122]: worker-2 <p6o0jrkhoto752rvpps5ddf6cmtbfufu9a9k89bk7d57lg5qbeljsh10d6c0a0p61fvcq45c1a4li>: downloaded chunk 597688320
Apr  2 08:39:24 gemini rclone[11122]: worker-3 <p6o0jrkhoto752rvpps5ddf6cmtbfufu9a9k89bk7d57lg5qbeljsh10d6c0a0p61fvcq45c1a4li>: downloaded chunk 681574400

I just went into Rclone config and it doesn’t give me the option of entering a Plex token.

Is this something that is missing on Rclone version 1.40-045-g0358e9e7 ?

Also I have no idea how to see the Rclone logs. How do I go about that?

If you run rclone config and you edit the cache, you’ll see an option to enter your plex information.

Mine looks like:

[felix@gemini ~]$ rclone config
Current remotes:

Name                 Type
====                 ====
GD                   drive
gcache               cache
gmedia               crypt

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> e
Choose a number from below, or type in an existing value
 1 > GD
 2 > gcache
 3 > gmedia
remote> 2
--------------------
[gcache]
type = cache
remote = GD:media
chunk_total_size = 32G
plex_url = http://192.168.1.30:32400
plex_username = emailhere
plex_password = *** ENCRYPTED ***
plex_token = sometoken
--------------------
Edit remote
Value "remote" = "GD:media"
Edit? (y/n)>
y) Yes
n) No
y/n> n
Value "plex_url" = "http://192.168.1.30:32400"
Edit? (y/n)>
y) Yes
n) No

For now, I’d use either your localhost for the URL or the IP. There are some issues with HTTPS so just use the HTTP link and your server setting should be:

image

In the server settings so it can connect.

OK copy that.

I re-edited the Cache config and I definitely do not get the option to enter a Plex token.

I do however get options for

type = cache
remote = google:encrypted
plex_url = http://127.0.0.1:32400
plex_username = emailaddress
plex_password = ENCRYPTED
chunk_size = 5M
info_age = 6h
chunk_total_size = 10G

Once you play something, the token will populate as it doesn’t appear until you get connected. That’s normal.

I’ve tried reconfiguring the cache remote with the local IP address, no ipaddress and 127.0.0.1:32400

Playing a show on Plex doesn’t get a token to show up in Rclone and I’m still only seeing one connection to googledrive in iftop. It appears to be staying in the single worker state.

I also don’t seem to get beta Rclone updates when I run the update script. Is this related?

How do I check logs for Rclone to see whats happening?

There is an order of operations issue now.

You have to have Plex up before rclone is started. I had opened an issue on GitHub already for that.

You can either start it with something like -vvv and add --log-file or use -log-level DEBUG if you don’t like the -vvv.

You can restart plex/start it after rclone, it just shows as an error on mount but the nature of the websockets implementation it’ll keep checking for a live connection at a regular basis.
At least it does for me, eventually finds plex after a few mins.

I’ve waited up to 24 hours to see if it’ll reconnect and never does.