How to cleanup older, deleted filed in gcache?


#1

I’ve mounted gcache with this command in Ubuntu

rclone mount -vvv --allow-other --allow-non-empty gcache: mount_folder_for_gdrive

and it works perfectly! I’ve pointed Plex at the two libraries inside, and everything is set. I just have one little problem: if I delete a file from gdrive on the browser and then refresh the library, the files goes away from Plex - great! But the next time the library refreshes, the episode I’ve deleted “comes back” because there must be some kind of cache left behind in gcache and Plex picks it up as an episode! Thing is, it isn’t and it’s driving me crazy!

I’ve tried using rclone cleanup (rclone cleanup gcache:) but I get an error saying “ERROR : /home5/doloresh4ze/.cache/rclone/cache-backend/gcache.db: Error opening storage cache. Is there another rclone running on the same remote? failed to open a cache connection to “/home5/doloresh4ze/.cache/rclone/cache-backend/gcache.db”: timeout
2018/10/17 09:01:26 Failed to create file system for “gcache:”: failed to start cache db: failed to open a cache connection to “/home5/doloresh4ze/.cache/rclone/cache-backend/gcache.db”: timeout”

What’s going on? Thanks!


#2

What version of rclone are you using? v1.44 should have cache cleanup implemented for deleted files.

You can only have one rclone command running for each cache remote. The database file used by cache will be locked by the first running command, so no other command can modify it at the same time.


#3

Just checked, I’m using v1.42 apparently!


#4

@B4dM4n Hi I had them update rclone, will the changes be automatic or do I need to remount?!

I’m pointing sonarr/radarr/lidarr/plex at gcache, is my mount command OK or is there a better one?! Thanks!


#5

If you updated the binary, you’d need to remount.


#6

@Animosity022 did that in the end, but I’m having the same problem nonetheless unfortunately- it’s driving me crazy, I don’t know what I’m doing wrong!


#7

How did you update it?

If you type: rclone version

It should give:

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

#8

@Animosity022 the guys at Ultraseedbox had to update it for me - I do get that output though! I’ve also unmounted my previous mount, manually deleted the cache database in .cache/rclone/* and then mounted it back up! Here’s what I’m saying Rclone deleted files issue!


#9

So what’s the current problem you are having now? I’m not sure what that is.


#10

@Animosity022 The files are deleted from Google Drive and they don’t appear in the gcache folder on my seedbox… but they still appear in both sonarr/radarr and Plex! Sonarr and Radarr treat them as existing files, so does Plex - but when I click on the file in Plex I (obviously) get a network error because the file is not there! I’ve refreshed the libraries countless times, optimised the database and cleaned the bundles… but nothing! Plex still treats the deleted episodes as existing files!


#11

What’s the output of a directory that you are having a problem with if you type:

ls -al

in that directory? Can you see the file on the mount?

What’s the path in Sonarr/Radarr? Can you share that screenshot?


#12

@Animosity022

This is the output from ls -al

total 4121669
-rw-r–r-- 1 doloresh4ze doloresh4ze 2779725901 Oct 17 01:10 The Good Place - S03E01- Everything Is Bonzer! [2018-09-27] [WEBDL-1080p h264 EAC3].mkv
-rw-r–r-- 1 doloresh4ze doloresh4ze 1440862418 Oct 17 01:15 The Good Place - S03E02 - The Brainy Bunch [2018-10-04] [WEBDL-1080p x264 EAC3].mkv

which is correct, and what I can visually see on the mount - in the Season 03 folder there are just those two mkv files.

You mean the root folder path in Sonarr? It’s /home/myusername/gcache/Media/TV/

and the example of a single file would be /home/myusername/gcache/Media/TV/Show_Name/Season_00/Episode01.mkv

The thing is the setup works perfectly for everything else! Problems arise only when I deleted a files from gdrive and I start seeing double files, ghost files (as in the third episode in my screenshot, it should not be there because the files was deleted)!


#13

If you aren’t seeing the file in the output of the ls command and it isn’t showing on the mount, you need to share a screenshot of what the file looks like in Sonarr as to what path it is pointing to.

It would look something like:

and are you using the recycle bin in Sonarr or Radarr?


#14

@Animosity022

Sonarr is pointing to my older files, the ones that I’ve deleted!

this one should just be S03E02 - The Brainy Bunch

while this should not appear because it’s deleted from gdrive!

This is my recycling bin screenshot


#15

So what’s the output of:

ls -al “/home5/doloresh4ze/gcache/Media/TV/The Good Place (2016)/Seaon 03/”


#16

@Animosity022

total 4121669
-rw-r–r-- 1 doloresh4ze doloresh4ze 2779725901 Oct 17 01:10 The Good Place - S03E01- Everything Is Bonzer! [2018-09-27] [WEBDL-1080p h264 EAC3].mkv
-rw-r–r-- 1 doloresh4ze doloresh4ze 1440862418 Oct 17 01:15 The Good Place - S03E02 - The Brainy Bunch [2018-10-04] [WEBDL-1080p x264 EAC3].mkv

the same as before! :triumph: this is why it’s driving me crazy haha


#17

And in Sonarr, you’ve refreshed the series from disk and it does not go away?


#18

Exactly! Over and over again! It once went away, only to come back an hour later when sonarr performed its daily series-update job

It also appears in Plex (which points at the exact same folders as sonarr)!


#19

Yeah, but unfortunately, you aren’t having a rclone issue as you don’t see the file on the mount when you did the ls command. I’m not sure why Sonarr/Plex aren’t noticing the file is missing.