Files keep disappearing using cache

Hi folks,

I have a pretty annoying problem with the cache mount wrapping a simple gdrive remote (unencrypted).

I’m running rclone 1.44 in Ubuntu 16.04:

rclone v1.44

  • os/arch: linux/amd64
  • go version: go1.11.1

Here’s my systemd command:

/usr/bin/rclone mount cache: /mnt/cache --dir-cache-time=160h --cache-info-age=168h --allow-other --allow-non-empty --cache-chunk-size=10M --cache-workers=8 --attr-timeout=1s --syslog --umask 002 --rc --cache-tmp-upload-path /upload --cache-tmp-wait-time 2h --cache-db-path /temp/rclone --log-level INFO --cache-chunk-total-size 100G --cache-chunk-path /temp/cache-backend
ExecStop=/bin/fusermount -uz /mnt/cache

I also have dockerized sonarr/radarr with folders bound to the cache mount so all writes happen on it. The issue is that a few minutes after sonarr moves some files to the mount and plex picks them up a few items simply become unavailable. If I “ls” the cache mount directory or the media file itself it doesn’t exist yet if I do the same against the temporary upload folder it’s there. If I run “kill -SIGHUP $(pidof rclone)” and ls the cache mount directory again, the folder exists and the files are in there but this shouldn’t be a necessary step.

I recently changed the temp wait time from 30m to 2h since I was getting a relatively significant amount of 403’s and wanted to bring them down a notch (I’m using my own client and secret). I don’t remember this happening before doing that but I also updated rclone to 1.44 recently so I don’t know which one actually caused it.

Am I doing something wrong?

Help is greatly appreciated.

EDIT: Well, I think I might have fixed it by simply lowering the temp wait time to 5m. For whatever reason, I’m not seeing any 403’s now so likely the ones I was seeing were unrelated to that. I’d like to use the staging/local area instead of having to constantly upload but it looks like there are issues with that and setting a shorter wait time seems to do the trick as a workaround.

This is how it looks like on Plex

I’ve edited my initial post to reflect that lowering the upload tmp wait time the issue seems to have subsided. I thought the point of the local “staging” area was to sort of work like a unionfs/mergerfs mount where plex sees it even if it’s not uploaded but maybe I misunderstand how it’s supposed to work?

I have this issue too, thanks for reporting your solution, I’ll try it out.

Just to add that I tried updating to the latest beta before reducing the upload wait time and that didn’t work either.

I’m not following on what the actual issue is.

With the cache backend, you still have a single mount point:

/gmedia as an example

If you write something to /gmedia, it should write it underneath to the cache-tmp-area and stay there until the time wait is reached and it uploads it.

I’ve tested on:

rclone version
rclone v1.44
- os/arch: linux/amd64
- go version: go1.11.1

and I can see the files properly populate on my cache mount and my non cache mount as expected.

Can you explain what is copied where and the work flow?

Hey @Animosity022, thanks for commenting.

It’s a pretty simple setup:

  1. Gdrive unencrypted remote
  2. Cache wrapping that remote
  3. Cache mounted on /mnt/cache
  4. cache-tmp-upload-path set to /upload
  5. cache-tmp-wait-time set to several hours (tested 2 and 6h)
  6. Sonarr/Radarr write processed filed to /mnt/cache directly
  7. File is initially present on /mnt/cache and /upload, plex picks it up
  8. An unspecified amount of time later, files disappear from the plex library (seemingly randomly, some do and some don’t).
  9. File can no longer be seen on /mnt/cache but can still be seen on /upload
  10. Seems that cache-tmp-wait-time elapses, file is uploaded which expires cache and plex picks it up again.

So it seems only low values in cache-tmp-wait-time work properly, i was hoping to keep a larger value on this (maybe a week) to keep files staged locally so new TV shows/movies could be served when most popular without needing to access gdrive and then archive them but maybe this isn’t how this is supposed to work?

Thanks

Are you able to capture any logs when that happens?

I’ve never seen that before and can’t reproduce it.

You should be able to use the cache-tmp-wait for a longer period as I’m not sure why that would be a problem.

INFO logs didn’t really show anything of importance. What log level should I go with if/when I reproduce it?

DEBUG would be the best, but that’ll be very verbose and if you can save that and share the log when something disappears, that would be helpful.

Sorry to revive an old thread, can post a new one if needed.

Just ran into this issue on Ubuntu 16.04 upgrading from 1.42 to 1.48 so whatever this is that got introduced presumably at 1.44 has triggered for my environment as well, which is identical to @hacktek 's except I am using crypt. This was working fine in 1.42.

DEBUG logs are very quickly becoming impossible to parse, but I can attempt to extract later tonight. Is there a workaround here other than rolling back to 1.42 or reducing the cache-tmp-wait-time to a small value?

Rclone command: rclone mount --allow-non-empty --allow-other --cache-db-purge --cache-tmp-upload-path="/home/plex/local" --cache-tmp-wait-time=300m crypt: /home/plex/blah --log-level=DEBUG --log-file="/home/plex/logs/rclone_mount.log" &

Could be related to this:

If you have a new item, you can post a fresh topic with logs/versions/etc.