Mylar 3 on Synology?

Information and Tutorials on features in Mylar and how to use it
edoaber
Posts: 6
Joined: Sun Feb 21, 2021 9:44 am

Re: Mylar 3 on Synology?

Post by edoaber »

Well yes ok... but /volume1 is the NAS root folder... it is owned by root and I wouldn't feel very comfortable by messing with it for so many reasons...
Moreover, every other process I've been running (including Sonarr, Radarr, SABnzbd...) can read and write it with no issues whatsoever...
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Mylar 3 on Synology?

Post by evilhero »

Then ensure the user running mylar has proper permissions to the NAS mount point - add them to the group if necessary.

It's not trying to change anything at that level but access the path beneath it to create it. It's not something I put in to stop users from creating directories, this is being returned from the OS from an internal module that comes with python. Mylar just initiates the call to use the fuction and the error is being returned. The only other thing it could be is that it's testing if the dir exists, but because it doesn't have access, it can't verify the directory exists and tries to create it (the function, not mylar)

I would again make sure you have enforce permissions turned off. Mylar will not be able to enforce any permission changes on external mounts.
edoaber
Posts: 6
Joined: Sun Feb 21, 2021 9:44 am

Re: Mylar 3 on Synology?

Post by edoaber »

Thank you again for the very quick reply!

So: the user running mylar has admin privileges but, to be more sure, I logged on the NAS as said user and tried to create a new folder inside the incriminated one and everything went smoothly... I don't know if that's proof enough, though.

I also double-checked the enforce-permission radio button and it is definitely off.

I really don't know what to do... :?:
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Mylar 3 on Synology?

Post by evilhero »

If you're running Mylar on a device external to the NAS, you would have to try creating the directory from that specific device on the NAS in order to fully test the permissions aspect, since it would use the permissions being enforced by the OS or mount point.

You don't indicate what version of python you're running Mylar with, or the branch / commit - which might be helpful in diagnosing although with docker I'm sure it's farily up-to-date.

Can you verify what the ownership (user:group) is of both the downloads and comics directory ?
edoaber
Posts: 6
Joined: Sun Feb 21, 2021 9:44 am

Re: Mylar 3 on Synology?

Post by edoaber »

No, I'm running Mylar on the NAS itself and I created the directory on the NAS from the NAS.

Python3 is
Python 3.8.2 (tags/Contacts-1.0.0-0232-200617:57e5f51, Jun 29 2020, 09:34:04)
[GCC 4.9.3 20150311 (prerelease)] on linux
Mylar version is this one https://registry.hub.docker.com/r/linuxserver/mylar3/

As for the ownership of the directories:

download is

Code: Select all

drwxrwxr-x  1 sonarr          administrators         70 Feb 21 20:40 downloads
comics is

Code: Select all

drwxrwxrwx+ 1 sonarr  users          292 Feb 21 19:33 comics
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Mylar 3 on Synology?

Post by evilhero »

If you were to move the comics folder to a dir outside of the NAS mounted folder, made the root level owned by root:administrators you probably wouldn't be having any issues with Mylar. You can test it to see even if that's the case.

So I'm pretty sure you need to at least add the mylar user to the group aspect of the NAS root folder, or open up the everyone aspect so that anyone can at least read the contents to see if the directory exists. You wouldn't want to add the mylar user to the root group obviously.

We can't really change the function within python itself, since Mylar tries to create the tree if it doesn't exist using a common python function, so unless you're willing to change the group aspect in the root (not the owner), I'm not sure what else can be done as this seems to honestly be a permissions issue since the mylar user can't even see the volume1.
chasepeeler
Posts: 2
Joined: Thu Apr 29, 2021 6:52 pm

Re: Mylar 3 on Synology?

Post by chasepeeler »

Using cnewham's post as a guide, I was able to upgrade the package version with much fewer steps. This was just an in-place upgrade. I installed the synocommunity python38 package as well, so this assumes you've done that as well.

0) Go to mylar's interface and shut it down.

1) SSH into the server

2) Find where the mylar package is installed. For me it was at /volume1/@appstore/mylar

3) You can back up that entire directory if you want. I just backed up the individual directories where things changed, which I'll point out below. Even that is optional though. Something like sudo cp -r mylar mylar.old will work

4) Go to /volume1/@appstore/mylar/share/ and remove/move the mylar directory:

Code: Select all

cd share
sudo mv mylar mylar.old
5) Clone the new version of mylar into a directory called mylar:

Code: Select all

sudo git clone https://github.com/mylar3/mylar3 mylar
6) Move back to the mylar root (/volume1/@appstore/mylar) and remove/backup the env directory:

Code: Select all

sudo mv env env.old
7) Set up a python virtual environment

Code: Select all

/usr/local/python38/bin/python3 -m venv env
8) Enter your python environment and install mylar's requirements, (assuming you're still at the root of your mylar volume):

Code: Select all

source env/bin/activate
cd share/mylar
sudo pip3 install -r requirements.txt
deactivate
9) Return to the mylar root (/volume1/@appstore/mylar) and backup the var directory if you wish - DO NOT MOVE/REMOVE IT

Code: Select all

sudo cp -r var var.old
10) Open up var/config.ini and search for git_user. Change the value from evilhero to mylar3.

Code: Select all

sudo nano var/config.ini
11) Go to the @appstore directory and verify the permissions are correct for everything

Code: Select all

cd /volume1/@appstore
sudo chown -R sc-mylar:mylar mylar
12) Open up package manager and find the mylar package and click "Run"
Lasborg
Posts: 5
Joined: Tue Aug 23, 2016 5:17 pm

Re: Mylar 3 on Synology?

Post by Lasborg »

used chasepeelers post

But I get an error with Pillow installation when i try to install the requirements. I am not an expert on linux and packages.
here is a link to the complete output in pastebin https://pastebin.com/L5fV6EQk

Code: Select all

Installing collected packages: Pillow
    Running setup.py install for Pillow ... error
    ERROR: Command errored out with exit status 1:
     command: /volume1/@appstore/mylar/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8bi2j4lg/pillow_23f1b2b09b424b0eb34ca996675e34a6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8bi2j4lg/pillow_23f1b2b09b424b0eb34ca996675e34a6/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xlvf1dy4/install-record.txt --single-version-externally-managed --compile --install-headers /volume1/@appstore/mylar/env/include/site/python3.8/Pillow
         cwd: /tmp/pip-install-8bi2j4lg/pillow_23f1b2b09b424b0eb34ca996675e34a6/
chasepeeler
Posts: 2
Joined: Thu Apr 29, 2021 6:52 pm

Re: Mylar 3 on Synology?

Post by chasepeeler »

I see this in the output:

The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

I don't ever recall doing anything to install zlib on my system, and I don't see any packages that would obviously have included it. I quick search for zlib synology found this: "The correct command should be ipkg install zlib, or ipkg install zlib-dev depending on your system." from this thread: https://github.com/python-pillow/Pillow/issues/4525

I'm 99% sure I've never used ipkg before, so I'm pretty sure that's not how zlib got on my system. If I had encountered your error, the above is how I would have tried to solve it, but obviously I take no responsibility if you try and it and fubar your system :-)

edit: Do you have download station installed? That includes unzip functionality so it's possible that zlib was installed with that. Nzbget would be another logical option. No way to know for sure though.
Lasborg
Posts: 5
Joined: Tue Aug 23, 2016 5:17 pm

Re: Mylar 3 on Synology?

Post by Lasborg »

chasepeeler wrote: Thu May 13, 2021 1:15 pm ...
I don't ever recall doing anything to install zlib on my system, and I don't see any packages that would obviously have included it. I quick search for zlib synology found this: "The correct command should be ipkg install zlib, or ipkg install zlib-dev depending on your system." from this thread: https://github.com/python-pillow/Pillow/issues/4525

I'm 99% sure I've never used ipkg before, so I'm pretty sure that's not how zlib got on my system. If I had encountered your error, the above is how I would have tried to solve it, but obviously I take no responsibility if you try and it and fubar your system :-)
...
'

I got ipkg installed on my synology, and installed zlib throug ipkg
I added /opt/bin and /opt/lib to PATH in the profile file.
"
after a restart just to be sure i tried the installation again, and it failed with the same "The headers or library files could not be found for zlib" error.

I have no idea what to do now.
Post Reply