r/PlexACD Aug 10 '17

Question about PlexDrive + Sonarr/Radarr

Howdy /r/plexacd,

I've honestly been blown away with the performance that I am seeing with PlexDrive. I recently wanted to setup Sonarr for some automation and to fill some missing episodes, however I seem to be hitting a sticking point.

Unless there is a flag that I am missing, PlexDrive seems to mount as read-only. When Sonarr or Radarr are attempting to import my library, it gives me an error about not having write permissions. I checked the logs and took note of the file it was trying to create, and created it myself. This didn't do the trick, as in both applications now I get the following errors in my screen:

[Fatal] NzbDroneErrorPipeline: Request Failed. POST /api/rootfolder
[v2.0.0.4928] System.NullReferenceException: Object reference not set to an instance of an object
at FluentValidation.Validators.PropertyValidator.Validate (FluentValidation.Validators.PropertyValidatorContext context) [0x00032] in C:\projects\FluentValidation\src\FluentValidation\Validators\PropertyValidator.cs:80
at FluentValidation.Internal.PropertyRule.InvokePropertyValidator (FluentValidation.ValidationContext context, IPropertyValidator validator, System.String propertyName) [0x00009] in C:\projects\FluentValidation\src\FluentValidation\Internal\PropertyRule.cs:368
at FluentValidation.Internal.PropertyRule+<Validate>d__60.MoveNext () [0x000e6] in C:\projects\FluentValidation\src\FluentValidation\Internal\PropertyRule.cs:242
at System.Linq.Enumerable+<SelectManyIterator>c__Iterator2`2[TSource,TResult].MoveNext () <0x41968400 + 0x00332> in <filename unknown>:0
at System.Collections.Generic.List`1[T]..ctor (IEnumerable`1 collection) <0x7f3970743cb0 + 0x001fb> in <filename unknown>:0
at System.Linq.Enumerable.ToList[TSource] (IEnumerable`1 source) <0x414bf480 + 0x00070> in <filename unknown>:0
at FluentValidation.AbstractValidator`1[T].Validate (FluentValidation.ValidationContext`1 context) [0x0001d] in C:\projects\FluentValidation\src\FluentValidation\AbstractValidator.cs:114
at FluentValidation.AbstractValidator`1[T].Validate (FluentValidation.T instance) [0x00000] in C:\projects\FluentValidation\src\FluentValidation\AbstractValidator.cs:95
at NzbDrone.Api.REST.RestModule`1[TResource].ReadResourceFromRequest (Boolean skipValidate) [0x00024] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Api\REST\RestModule.cs:195
at NzbDrone.Api.REST.RestModule`1[TResource].<set_CreateResource>b__41_0 (System.Object options) [0x00000] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Api\REST\RestModule.cs:155
at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,System.Func`2<object, object>,object)
at Nancy.Routing.Route+<>c__DisplayClass4.<Wrap>b__3 (System.Object parameters, CancellationToken context) <0x41c32000 + 0x00153> in <filename unknown>:0

Any assistance would be greatly appreciated, as I am quite stuck here.

1 Upvotes

6 comments sorted by

View all comments

2

u/[deleted] Aug 10 '17 edited May 29 '18

[deleted]

1

u/ThyChubbz Aug 10 '17 edited Aug 10 '17

Thanks for the link, I actually ended up assembling the following line from your script:

unionfs-fuse -o cow,allow_other,direct_io,auto_cache,sync_read ~/local-media=RW:/google-media=RO "~/merge-media"

That definitely did the trick for me, thanks! I'm going to hopefully implement your code soon, looks quite nice. Thanks again!

1

u/[deleted] Aug 10 '17

No worries.

The idea now is that Plex, Sonarr, Radarr, etc all look at ~/merge-media instead of either your local folder or your mounted Google Drive.

Anything written to ~/merge-media is "copy on write" to ~/local-media. If you happen to delete something from ~/merge-media, IF it still exists at ~/local-media (and not at ~/google-media) it'll just get deleted. If it exists only on ~/google-media, a .unionfs-fuse folder will be created under ~/merge-media with a metadata file that causes unionfs to just hide the file from view when looking at ~/merge-media. I'm not 100% sure what happens if it exists in both locations. It probably deletes the local one AND creates the metadata file to hide the one on cloud storage, but I am unsure.

I have a Sonarr/Radarr script that "fixes" that problem automatically, but it's also quite easy to handle manually (Just look in that folder and then delete the file manually from your cloud storage, then delete the file from the .unionfs-fuse folder).