FreeNAS - changed cache path overwritten

Post any problems / bugs / issues that are Mylar-related in here.
Post Reply
uncle_jim
Posts: 3
Joined: Sun May 27, 2018 12:24 pm

FreeNAS - changed cache path overwritten

Post by uncle_jim » Sun May 27, 2018 12:37 pm

Hi there.

I have FreeNAS configured to run each plugin in separate jails. Of course this means that the default Mylar cache path is invisible to SABnzbd. I successfully edited the config.ini to change the cache path to a folder in the storage mount, which worked successfully and was correctly sending .nzbs across. This stayed active across reboots.

However, just now after completing a group of downloads, it spontaneously (without restarting) reverted back to an old version of the config.ini and now uses the default cache. I don't know what triggered it, but around the same time it occurred the log shows an error:
ERROR Uncaught exception: Traceback (most recent call last):
File "/usr/pbi/mylar-amd64/share/mylar/mylar/mylar/logger.py", line 159, in new_run
old_run(*args, **kwargs)
File "/usr/pbi/mylar-amd64/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/pbi/mylar-amd64/share/mylar/mylar/mylar/importer.py", line 507, in addComictoDB
issuedata = updateissuedata(comicid, comic['ComicName'], issued, comicIssues, calledfrom, SeriesYear=SeriesYear, latestissueinfo=latestissueinfo)
File "/usr/pbi/mylar-amd64/share/mylar/mylar/mylar/importer.py", line 1217, in updateissuedata
decisval = int(decis)
ValueError: invalid literal for int() with base 10: 'MU'
I was adding titles to the library, and this occurred in between two where the thumbnails switched from going to one cache folder to the other.

Any thoughts of a possible solution? I've considered changing the default to a symlink to the cache on the mounted storage directory but I'm generally allergic to messing with symlinks.

Thanks for any help!

User avatar
evilhero
Site Admin
Posts: 2192
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: FreeNAS - changed cache path overwritten

Post by evilhero » Sun May 27, 2018 8:41 pm

It sounds like because of the error that occurred that the FreeNAS plugin reverted back to things for some reason and that caused some config problems.

However, I'm not sure why you would have to change the default cache location based on SAB itself. The reason being is that when an item gets downloaded to the cache by Mylar (ie. an nzb since you're using SAB) it doesn't physically link that file when it sends things to SAB. It creates a 'downloadNZB' API command using Mylar (which uses the internal Mylar API, so you don't have to worry about enabling anything), and then requests the file via the Mylar web interface directly using this command that it sends to SAB to request via their addurl option. So it's not actually SAB that's accessing the .nzb file, but Mylar is sending it to SAB to download via the addurl command of SAB.

What might be occurring is that because they're both in separate jails, you might have to enable the 'Are Mylar and SABnzbd on Different Machines?' option within the Mylar configuration and point the download location a single location that's accessible by both (but that would affect post-processing more than anything).

The other option is what your Mylar host is set to within the Mylar configuration. If it's set to localhost, I think that if SAB is in a jail environment it would only resolve localhost to be the jail that SAB is in, not Mylar since it's separate. You would have to specify your IP for the Mylar jail in the Mylar configuration for the Mylar host for it to resolve properly in that case. Or you could even use the return_host value in the config.ini, if you want to keep Mylar set to localhost but have all your sab requests to Mylar resolve to the Mylar jail itself).

Hope that makes sense - if not shout me back and I can try to work things thru with you...

PS. It also looks like you're running a pretty old version of Mylar based on where that error line is (which might be just off, but usually it's a sign that it's a bit behind in the commits).

uncle_jim
Posts: 3
Joined: Sun May 27, 2018 12:24 pm

Re: FreeNAS - changed cache path overwritten

Post by uncle_jim » Mon May 28, 2018 7:04 am

Hi, thanks for the response.

I'm working through most of what you have suggested, and will see what works.

I came to the cache path conclusion based on this example from the SAB log:
2018-05-27 16:11:26,143::INFO::[apikey=<APIKEY>] API-call addlocalfile: file "/usr/pbi/mylar-amd64/share/mylar/mylar/cache/Phoenix.Resurrection.-.The.Return.of.Jean.Grey.01.of.05.2018.digital.Minutemen-Slayer.nzb" not found
2018-05-27 16:22:53,021::INFO::[misc:943] Creating directories: /mnt/Media/Downloads/sabnzbd/incomplete/Phoenix.Resurrection.-.The.Return.of.Jean.Grey.01.of.05.2018.digital.Minutemen-Slayer
2018-05-27 16:22:53,078::INFO::[nzbstuff:515] File Phoenix Resurrection - The Return of Jean Grey 01 (of 05) (2018) (digital) (Minutemen-Slayer).cbr - SABnzbd_nzf_5JC255 added to queue
2018-05-27 16:22:53,078::INFO::[__init__:613] Backing up /mnt/Media/Downloads/sabnzbd/incomplete/Phoenix.Resurrection.-.The.Return.of.Jean.Grey.01.of.05.2018.digital.Minutemen-Slayer/__ADMIN__/Phoenix.Resurrection.-.The.Return.of.Jean.Grey.01.of.05.2018.digital.Minutemen-Slayer.nzb.gz
2018-05-27 16:22:53,098::INFO::[nzbqueue:277] Saving queue
These were consecutive in the log - the first before I edited the ini file, and the rest after.

I also updated the Mylar host to the jail IP and restarted, which yielded the same log entry in SAB.

There also isn't the 'Are Mylar and SABnzbd on Different Machines?' option in this version (have compared to a parallel install on a Windows machine I'm phasing out) I'm using the current FreeNAS plugin version, so I don't know version number or how old it might be. It looks like the repo hasn't been updated in at least a year.

I'm thinking it may just be simplest to nuke the entire jail from orbit and manually install the package.

User avatar
evilhero
Site Admin
Posts: 2192
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: FreeNAS - changed cache path overwritten

Post by evilhero » Mon May 28, 2018 6:31 pm

Yeah the big clue is the API-call addlocalfile in your SAB logs - Mylar hasn't used the AddLocalFile option for a very very long time.

I think before you even try to fix the cache/download/any other problem you need to make sure that you're somehow on the most up-to-date branch of either the Master or Development branch. It honestly sounds like you're well over a year behind on commits, and well - a crapload of stuff has changed since then, so things on that old of a version just won't work.

I'm pretty confident that once you're on a recent branch, the vast majority of these problems will be non-existent, and or just a simple configuration change in the config.ini.

uncle_jim
Posts: 3
Joined: Sun May 27, 2018 12:24 pm

Re: FreeNAS - changed cache path overwritten

Post by uncle_jim » Fri Jun 01, 2018 2:44 am

Thanks for the assistance. I'm in the process of a server migration and am moving to a Linux based setup. Will ensure that it's using a recent release.

Post Reply