Permission issues (I think) during import

Post any problems / bugs / issues that are Mylar-related in here.
Post Reply
rich110
Posts: 5
Joined: Fri Aug 21, 2015 9:51 am

Permission issues (I think) during import

Post by rich110 »

Hi,

First off I'd like to say a big thanks for Mylar. I've been experimenting with it for a while now and its really great. However, what I believe are permission problems are driving me INSANE.

I am running whatever is the latest development build of Mylar on a Freenas server. I have about 130 different comic series , organised into separate folder (named "Series (Date)". Files are names "Series VolDate Issues (Year)". Everytime I try to run an import of my collection, about 1/4 of the series import fine, but the remainder don't. The problem seems to occur in realtion to the "comic.jpg" file. The error I get is given in the example below (for "Rat Queens" series):

Code: Select all

2015-08-21 19:42:15	WARNING	[Warning] ComicID: 67680 is incomplete - Removing from DB. You should try to re-add the series.
2015-08-21 19:42:08	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 462, in addComictoDB
shutil.copy(coverfile, comiclocal)
File "/usr/pbi/mylar-amd64/lib/python2.7/shutil.py", line 120, in copy
copymode(src, dst)
File "/usr/pbi/mylar-amd64/lib/python2.7/shutil.py", line 91, in copymode
os.chmod(dst, mode)
OSError: [Errno 1] Operation not permitted: '/mylar_1/comics/Rat Queens (2013)/cover.jpg'
2015-08-21 19:42:08	INFO	Successfully retrieved cover for Rat Queens
2015-08-21 19:42:08	INFO	Image header check: jpeg
2015-08-21 19:42:07	INFO	Directory (/mylar_1/comics/Rat Queens (2013)) already exists! Continuing...
2015-08-21 19:42:07	INFO	Sucessfully retrieved details for Rat Queens
2015-08-21 19:42:07	INFO	Now adding/updating: Rat Queens
2015-08-21 19:42:05	INFO	Attempting to add directly by ComicVineID: 67680
2015-08-21 19:42:00	INFO	comicname is :Rat Queens
The weird thing is, even when I delete the existing "comic.jpg" file and rerun the import, the "[Errno 1] Operation not Permitted" error pops up - even though the file does get written!!

So far I've tried the following:
- Changing the user:group of my comics folder to media:wheel
- Changed my comics folder to 777 permissions
- Added the user "media" and group "wheel" to the mylar setting ("Comic Location" section)
- Deleted all existing "comic.jpg" and "cvinfo" files from my series folders and tried re-importing

All these things still result in the above errors - but not for all series. I've cheched the user perimissions of my comic folder in freenas and it is indeed "media:wheel".

Any help would be awesome.

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

Re: Permission issues (I think) during import

Post by evilhero »

This has happened numerous times before, and in almost every instance it turns out to be a problem with the 3rd party app (the freenas plugin). When the users have switched to a direct git installation (or source), the permissions issues went away (just search on here and you'll find a few separate posts in regards to this). It doesn't have problems writing to the directory, it's when Mylar attempts to change the owner:group / permissions to whatever it is that you've provided that things blow-up, which is due to the given user not being able to execute the change because it doesn't have the proper authority to do so. As long as your numeric permissions are proper (probably 0777 would be the best option), and you're running the most recent development branch of mylar, it should be able to change everything just fine.

Now why it's happening, the only reason I've been able to come up with is that the user running Mylar doesn't have the proper permissions to write to the given comic directory and it has something to do with the group management aspect. Meaning the user running Mylar is probably part of the wheel group which for some reason isn't having the user itself given access. Even making the user running Mylar, be 'user' - it still fails and it points to the same type of problem. The FreeNAS plugin has it's own group management, which Mylar has no control/access to, so when you take the plugin out of the equation and install Mylar using git / source, things line up and access will be granted properly. I'm not saying this is a problem with the plugin - I just have absolutely zero knowledge on the freenas plugin or how the perms are all granted on those systems when used through the plug-in. So unfortunately, I'm speaking from a "it works when you don't use the plug-in" perspective as that's the most I can offer in these types of situations most times.

If you don't need it, you can always remove the option to write those files (the cvinfo option, and cover.jpg option) from within the configuration - albeit it sounds like it will have problems when moving files into said directories as well if post-processing will happen in the current scenario.
rich110
Posts: 5
Joined: Fri Aug 21, 2015 9:51 am

Re: Permission issues (I think) during import

Post by rich110 »

hi evilhero,
thanks for the reply. I think you were right on the money about the freenas plugin not properly handling the user:group setting within mylar. In the end, I uninstalled the plugin, deleted the jail, reinstalled (without setting a user:group within mylar) and it all works great. I've set permission the 0777, but I'm behind a firewall.
thanks again, Rich
Post Reply