evilhero / mylar

An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents
GNU General Public License v3.0
976 stars 172 forks source link

Unable to convert CBR-->CBZ #1970

Closed DrSeussFreak closed 6 years ago

DrSeussFreak commented 6 years ago

I am running the latest release - Version: 5e6b861fadcbd6a43412e0a4e8a7cdee6e8e945c (development) and CBR --> CBZ keeps failing with this error

[META-TAGGER][COMIC-TAGGER][CBR-TO-CBZ] Failed to convert cbr to cbz - check permissions on folder : /opt/Mylar/cache and/or the location where Mylar is trying to tag the files from.

/opt/Mylar/cache is owned by the mylar user and group, which is the user to run Mylar, and the permissions are 777.

Debug log entry is below

8-06-07 12:43:55 DEBUG [MANUAL META-TAGGING] Unable to write metadata successfully - check mylar.log file.
2018-06-07 12:43:54 WARNING [META-TAGGER][COMIC-TAGGER][CBR-TO-CBZ] Failed to convert cbr to cbz - check permissions on folder : /opt/Mylar/cache and/or the location where Mylar is trying to tag the files from.
2018-06-07 12:43:53 DEBUG [META-TAGGER] Absolute path to script: /usr/bin/python
2018-06-07 12:43:53 DEBUG [META-TAGGER] Executing command: ['/usr/bin/python', '/opt/Mylar/comictagger.py', '-e', '--delete-rar', u'/opt/Mylar/cache/mylar_j3eQtM/Crossed Plus One Hundred Mimic - 0000 - 2.cbr']
2018-06-07 12:43:53 DEBUG [META-TAGGER] Enabling ComicTagger script: ['/usr/bin/python', '/opt/Mylar/comictagger.py'] with options: ['-e', '--delete-rar', u'/opt/Mylar/cache/mylar_j3eQtM/Crossed Plus One Hundred Mimic - 0000 - 2.cbr']
2018-06-07 12:43:53 DEBUG [META-TAGGER] CBL Tagging enabled.
2018-06-07 12:43:53 DEBUG [META-TAGGER] CR Tagging enabled.
2018-06-07 12:43:53 DEBUG [META-TAGGER] ComicTagger 1.20.1 [ninjas.walk.alone / SHURIKEN] being used - using personal ComicVine API key supplied via mylar.
2018-06-07 12:43:53 DEBUG [META-TAGGER] Running the ComicTagger Add-on for Mylar
2018-06-07 12:43:53 DEBUG [META-TAGGER] comicpath : /opt/Mylar/cache/mylar_j3eQtM
2018-06-07 12:43:53 DEBUG [META-TAGGER] sabnzbdscriptpath :
2018-06-07 12:43:53 DEBUG [META-TAGGER] downloadpath : /media/comics/Avatar Press/Crossed Plus One Hundred Mimic [2018]
2018-06-07 12:43:53 DEBUG [META-TAGGER] scriptname : Mylar.py
2018-06-07 12:43:53 DEBUG [META-TAGGER] Paths / Locations:
2018-06-07 12:43:52 DEBUG New_Filepath: /opt/Mylar/cache/mylar_j3eQtM/Crossed Plus One Hundred Mimic - 0000 - 2.cbr
2018-06-07 12:43:52 DEBUG New_Folder: /opt/Mylar/cache/mylar_j3eQtM
2018-06-07 12:43:52 DEBUG Filename: Crossed Plus One Hundred Mimic - 0000 - 2.cbr
2018-06-07 12:43:52 DEBUG Filepath: /media/comics/Avatar Press/Crossed Plus One Hundred Mimic [2018]/Crossed Plus One Hundred Mimic - 0000 - 2.cbr
2018-06-07 12:43:52 DEBUG [META-TAGGER] Filename is : /media/comics/Avatar Press/Crossed Plus One Hundred Mimic [2018]/Crossed Plus One Hundred Mimic - 0000 - 2.cbr
2018-06-07 12:43:52 DEBUG ComicTagger Path location for internal comictagger.py set to : /opt/Mylar/comictagger.py
2018-06-07 12:43:52 DEBUG [META-TAGGER] dirName:/media/comics/Avatar Press/Crossed Plus One Hundred Mimic [2018]
2018-06-07 12:43:42 INFO Web logs cleared
DrSeussFreak commented 6 years ago

/media/comics/Avatar/Crossed Plus One Hundred Mimic [2018] has 777 permissions owned by nobody:users and the files underneath are the same.

Renaming works without issue, so it clearly has permissions.

evilhero commented 6 years ago

Does metatagging work with other issues or just this one in particular ? If it's for everything, then the odds are good that it's still a permissions issue of some kind. You'd have to check the /opt/Mylar/cache/ folder that's being used for the particular tagging to see if/what any files exist therein. If it's failing to extract there would be just the .cbr, if it's failing to convert there should be a cbr and a folder full of jpgs (or the .cbz partially). It hasn't gotten to the moving to the final destination part as that happens after the actual tagging occurs, which is after conversion.

How are you running the metatagging option ?

It could still be permissions - since it copies/moves the file from the source location to the destination (/opt/Mylar/cache/) folder for tagging and then attempts to move it out thereafter. Renaming also doesn't move the file from point A to point B, but simply renames the file itself. Permissions don't come into play since the source and destination are the same.

DrSeussFreak commented 6 years ago

It is every issue, I used that as an example. I have run the following numerous times, and it has stuck. chown -R mylar:mylar /opt/Mylar && chmod -R 777 /opt/Mylar I am click on an individual issue, the metatag option there, to do it. This was for a file I manually donwloaded (the name didn't meet with the configured convention, so I did it manually), but for issues Mylar grabbed and moved itself, this also failed. It was able to move the files, no problem, renaming them in the process, but it was unable to convert it.

So it may be a permissions issue, but I am not sure how or what.

evilhero commented 6 years ago

Can you try something with permissions in the source location? Can you change the perms on the file you're metatagging to be mylar:mylar instead of nobody:users and making sure that the perms are set to at least 775 for testing purposes. Then try the metatagging again on that specific issue and see what happens

DrSeussFreak commented 6 years ago

So /media is a CFIS share to my NAS, the users don't map, hence the nobody:user ownership. /SabNZBd is a NFS share to another Ubuntu box, and it is able to copy comics from /SabNZBd to /media, renaming them & setting permissions in the process. If I su - to mylar, I can create a file, and remove it in /media/comics/Avatar/*

evilhero commented 6 years ago

Which box does the mylar application reside on?

If it can't create a file with the proper perms, it will default to your CIFS default perm settings which I'm guessing might not be set for default usage (most people dont set it unless they're having problems)

DrSeussFreak commented 6 years ago

mylar sits on "media-01" (Ubuntu 18.04) sabnzbd sites on "sabnzbd-01" (Ubuntu 18.04) /media is on NAS "nx-01" (Synology)

/etc/fstab is configured as follows

//nx-01/comics /media/comics cifs credentials=/home/dsf/.smbcredentials,uid=nobody,gid=users,iocharset=utf8,noperm,sec=ntlm,vers=1.0 0 0

barbequesauce commented 6 years ago

Tagging in on this given that I run CIFS and evilhero doesnt... it sounds like you're able to create files but not update them. Sounds weird, I know, but CIFS does allow that possibility...

What's the real ACL on \\nx-01\comics (both the share ACL and the filesystem ACL)? What's in your .smbcredentials file (dont post the password)?

DrSeussFreak commented 6 years ago

on NX-01, it is all GUI based, and it is mapped to the dsf user as r/w permissions, there is nothing special there. As for Ubuntu, not sure what you are looking for on media-01, as nothing special is configured, I just added the mylar (and sonarr and radarr) users to the users group.

/home/dsf/.smbcredentials contains

username=dsf password=NotMyRealPW

barbequesauce commented 6 years ago

In CIFS there's a concept of a dropbox - you can write a file once but never modify it again. That's what I was hoping to see in the ACL.

Just for giggles - can you create a text file in /media/comics while sudo'ed to the mylar user, and save it? then try and edit/save the same file and see if it sticks...

DrSeussFreak commented 6 years ago

Just created a file, saved/quit, opened it, changed it, saved/quit - 4 times over, no problems.

I have sonarr and radarr running on the same machine (same setup but with radarr and sonarr accounts), they have no problems changing anything on the /media CIFS share

barbequesauce commented 6 years ago

okay... sounds like it's not a dropbox...

Another thought - on your mylar ubuntu box, you do have unrar & rar installed and in the mylar user's path - right?

DrSeussFreak commented 6 years ago

root@media-01:~# which rar /usr/bin/rar root@media-01:~# which unrar /usr/bin/unrar

Where would I add this to the users path?

DrSeussFreak commented 6 years ago

HAH, ok, so I had just installed both, I had not thought of it, re-ran the post-processing step and it worked perfectly! Nice catch, thanks :)

barbequesauce commented 6 years ago

great to hear!