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

Post-processing fails when Mylar runs as a service on Windows #1826

Closed skywayskase closed 3 years ago

skywayskase commented 6 years ago

This morning I decided instead of starting Mylar with a VBS script, I'd much rather it ran as a service (a bit easier to manage that way). Since the update however, whenever I post-process a comic, it gets moved to the cache dir, tagging is applied, and then it can't move out. Here's some info about my environment: I'm running Windows 7 x64, my comic directory stored on a NAS and Mylar points to it using UNC path (eg: \NAS1\Media\Comics\Issues\$Publisher\$Series). I tried this with a post-process script, the completed download handling, and even manual post-processing and all yielded the same results. Here's a copy of the logs:

30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] nzb name: X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] nzb folder: D:\Downloads\To Sort\comics\X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Not using SABnzbd
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Using NZBGET
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] NZB name as passed from NZBGet: X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] NZB name as passed from NZBGet: X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] NZBGET Download folder option enabled. Directory set to : D:\Downloads\To Sort\Comics\X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [NZBNAME]: X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [NZBNAME] nzbname (remove chars): X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [NZBNAME] nzbname (remove extensions, double spaces, convert underscores to spaces): X-Men Gold 010 2017 Digital Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] After conversions, nzbname is : X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Issueid: 616206
30-Dec-2017 12:24:36 - INFO    :: Post-Processing : [PPINFO-POST-PROCESSING-ATTEMPT] {'publisher': None, 'comicname': u'X-Men: Gold', 'issueid': u'616206', 'comiclocation': None, 'sarc': None, 'issuenumber': u'10', 'oneoff': None, 'comicid': u'100603'}
30-Dec-2017 12:24:36 - INFO    :: Post-Processing : [POST-PROCESSING] issuenzb found.
30-Dec-2017 12:24:36 - INFO    :: Post-Processing : [DUPECHECK] Duplicate check for D:\Downloads\To Sort\Comics\X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - INFO    :: Post-Processing : [DUPECHECK] Duplication detection returned no hits. This is not a duplicate of anything that I have scanned in as of yet.
30-Dec-2017 12:24:36 - INFO    :: Post-Processing : [POST-PROCESSING] [1/1] Starting Post-Processing for X-Men: Gold issue: 10
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] issueid: 616206
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] issuenumOG: 10
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Zero Suppression set to : 00x
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : issue detected greater than 10, but less than 100
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : Zero level supplement set to 00x.Issue will be set as : 010
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Pretty Comic Issue is : 010
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Issue Year : 2017
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Publisher: Marvel
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Series: X-Men: Gold
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Year: 2017
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Comic Location: C:\temp\X-Men Gold (2017)
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Comic Version: v2
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Not an annual - removing from filename parameters
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] New format: $Series $Issue ($Year)
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] odir (root): D:\Downloads\To Sort\Comics\X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] ofilename: X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbr
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] odir: D:\Downloads\To Sort\Comics\X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] ofilename: X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbr
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [POST-PROCESSING] Metatagging enabled - proceeding...
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [META-TAGGER] dirName:D:\Downloads\To Sort\Comics\X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : ComicTagger Path location for internal comictagger.py set to : C:\Program Files (x86)\Mylar\comictagger.py
30-Dec-2017 12:24:36 - DEBUG   :: Post-Processing : [META-TAGGER] Filename is : D:\Downloads\To Sort\Comics\X-Men.Gold.010.2017.Digital.Zone-Empire\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbr
30-Dec-2017 12:24:36 - INFO    :: Post-Processing : Filepath: D:\Downloads\To Sort\Comics\X-Men.Gold.010.2017.Digital.Zone-Empire\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbr
30-Dec-2017 12:24:36 - INFO    :: Post-Processing : Filename: X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbr
30-Dec-2017 12:24:36 - INFO    :: Post-Processing : New_Folder: C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp
30-Dec-2017 12:24:36 - INFO    :: Post-Processing : New_Filepath: C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbr
30-Dec-2017 12:24:36 - INFO    :: Post-Processing : Attempting to move: move
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] Paths / Locations:
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] scriptname : Mylar.py
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] downloadpath : D:\Downloads\To Sort\Comics\X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] sabnzbdscriptpath : C:\Program Files (x86)\Mylar
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] comicpath : C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] Running the ComicTagger Add-on for Mylar
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] ComicTagger 1.20.1 [ninjas.walk.alone / SHURIKEN]
 being used - using personal ComicVine API key supplied via mylar.
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] CR Tagging enabled.
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] CBL Tagging enabled.
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] Enabling ComicTagger script: ['C:\\Python27\\python.exe', 'C:\\Program Files (x86)\\Mylar\\comictagger.py'] with options: ['-e', '--delete-rar', u'C:\\Program Files (x86)\\Mylar\\cache\\mylar_fl8zkp\\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbr']
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] Executing command: ['C:\\Python27\\python.exe', 'C:\\Program Files (x86)\\Mylar\\comictagger.py', '-e', '--delete-rar', u'C:\\Program Files (x86)\\Mylar\\cache\\mylar_fl8zkp\\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbr']
30-Dec-2017 12:24:37 - DEBUG   :: Post-Processing : [META-TAGGER] Absolute path to script: C:\Python27\python.exe
30-Dec-2017 12:24:39 - DEBUG   :: Post-Processing : [META-TAGGER][COMIC-TAGGER] : Archive exported successfully to: X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz (Original deleted) 

C:\Python27\lib\site-packages\pkg_resources.py:1045: UserWarning: C:\Windows\system32\config\systemprofile\AppData\Roaming\Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).

  warnings.warn(msg, UserWarning)

30-Dec-2017 12:24:39 - DEBUG   :: Post-Processing : [META-TAGGER]Trying utf-8 conversion.
30-Dec-2017 12:24:39 - DEBUG   :: Post-Processing : [META-TAGGER]Trying latin-1 conversion.
30-Dec-2017 12:24:39 - DEBUG   :: Post-Processing : [META-TAGGER][COMIC-TAGGER][CBR-TO-CBZ] New filename: C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  

C:\Python27\lib\site-packages\pkg_resources.py:1045: UserWarning: C:\Windows\system32\config\systemprofile\AppData\Roaming\Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).

  warnings.warn(msg, UserWarning)
30-Dec-2017 12:24:39 - INFO    :: Post-Processing : [META-TAGGER] ComicRack tagging meta-tagging processing started.
30-Dec-2017 12:24:39 - DEBUG   :: Post-Processing : [META-TAGGER] Enabling ComicTagger script: ['C:\\Python27\\python.exe', 'C:\\Program Files (x86)\\Mylar\\comictagger.py'] with options: ['-s', '-m', 'volume=2', '--cv-api-key', 'REDACTED', '-o', '--id', u'616206', '--type', 'cr', u'C:\\Program Files (x86)\\Mylar\\cache\\mylar_fl8zkp\\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  \r\nC:\\Python27\\lib\\site-packages\\pkg_resources.py:1045: UserWarning: C:\\Windows\\system32\\config\\systemprofile\\AppData\\Roaming\\Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).\r\n  warnings.warn(msg, UserWarning)']
30-Dec-2017 12:24:39 - DEBUG   :: Post-Processing : [META-TAGGER] Executing command: ['C:\\Python27\\python.exe', 'C:\\Program Files (x86)\\Mylar\\comictagger.py', '-s', '-m', 'volume=2', '--cv-api-key', 'REDACTED', '-o', '--id', u'616206', '--type', 'cr', u'C:\\Program Files (x86)\\Mylar\\cache\\mylar_fl8zkp\\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  \r\nC:\\Python27\\lib\\site-packages\\pkg_resources.py:1045: UserWarning: C:\\Windows\\system32\\config\\systemprofile\\AppData\\Roaming\\Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).\r\n  warnings.warn(msg, UserWarning)']
30-Dec-2017 12:24:39 - DEBUG   :: Post-Processing : [META-TAGGER] Absolute path to script: C:\Python27\python.exe
30-Dec-2017 12:24:40 - INFO    :: Post-Processing : [META-TAGGER][COMIC-TAGGER] Successfully wrote ComicRack tagging [C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  

C:\Python27\lib\site-packages\pkg_resources.py:1045: UserWarning: C:\Windows\system32\config\systemprofile\AppData\Roaming\Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).

  warnings.warn(msg, UserWarning)]
30-Dec-2017 12:24:40 - INFO    :: Post-Processing : [META-TAGGER] Comicbooklover tagging meta-tagging processing started.
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [META-TAGGER] Enabling ComicTagger script: ['C:\\Python27\\python.exe', 'C:\\Program Files (x86)\\Mylar\\comictagger.py'] with options: ['-s', '-m', 'volume=2', '--cv-api-key', 'REDACTED', '-o', '--id', u'616206', '--type', 'cbl', u'C:\\Program Files (x86)\\Mylar\\cache\\mylar_fl8zkp\\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  \r\nC:\\Python27\\lib\\site-packages\\pkg_resources.py:1045: UserWarning: C:\\Windows\\system32\\config\\systemprofile\\AppData\\Roaming\\Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).\r\n  warnings.warn(msg, UserWarning)']
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [META-TAGGER] Executing command: ['C:\\Python27\\python.exe', 'C:\\Program Files (x86)\\Mylar\\comictagger.py', '-s', '-m', 'volume=2', '--cv-api-key', 'REDACTED', '-o', '--id', u'616206', '--type', 'cbl', u'C:\\Program Files (x86)\\Mylar\\cache\\mylar_fl8zkp\\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  \r\nC:\\Python27\\lib\\site-packages\\pkg_resources.py:1045: UserWarning: C:\\Windows\\system32\\config\\systemprofile\\AppData\\Roaming\\Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).\r\n  warnings.warn(msg, UserWarning)']
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [META-TAGGER] Absolute path to script: C:\Python27\python.exe
30-Dec-2017 12:24:40 - INFO    :: Post-Processing : [META-TAGGER][COMIC-TAGGER] Successfully wrote Comicbooklover tagging [C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  

C:\Python27\lib\site-packages\pkg_resources.py:1045: UserWarning: C:\Windows\system32\config\systemprofile\AppData\Roaming\Python-Eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).

  warnings.warn(msg, UserWarning)]
30-Dec-2017 12:24:40 - INFO    :: Post-Processing : [POST-PROCESSING] Sucessfully wrote metadata to .cbz (others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).

  warnings.warn(msg, UserWarning)) - Continuing..
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [POST-PROCESSING] Original Filename: others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).

  warnings.warn(msg, UserWarning)
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [POST-PROCESSING] Original Extension: .warn(msg, UserWarning)
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [POST-PROCESSING] New Filename: X-Men Gold 010 (2017)
30-Dec-2017 12:24:40 - INFO    :: Post-Processing : [POST-PROCESSING][DIRECTORY-CHECK] Found comic directory: C:\temp\X-Men Gold (2017)
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [POST-PROCESSING] Source: C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  

C:\Python27\lib\site-packages\pkg_resources.py:1045: UserWarning: C:\Windows\system32\config\systemprofile\AppData\Roaming\Python-Eggs is writable by group\others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).

  warnings.warn(msg, UserWarning)
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [POST-PROCESSING] Destination: C:\temp\X-Men Gold (2017)\X-Men Gold 010 (2017).warn(msg, userwarning)
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [POST-PROCESSING] self.nzb_folder: D:\Downloads\To Sort\Comics\X-Men.Gold.010.2017.Digital.Zone-Empire
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [POST-PROCESSING] odir: C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  

C:\Python27\lib\site-packages\pkg_resources.py:1045: UserWarning: C:\Windows\system32\config\systemprofile\AppData\Roaming\Python-Eggs is writable by group
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [POST-PROCESSING] ofilename:others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).

  warnings.warn(msg, UserWarning)
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [POST-PROCESSING] nfilename:X-Men Gold 010 (2017).warn(msg, UserWarning)
30-Dec-2017 12:24:40 - DEBUG   :: Post-Processing : [POST-PROCESSING] Renaming C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  

C:\Python27\lib\site-packages\pkg_resources.py:1045: UserWarning: C:\Windows\system32\config\systemprofile\AppData\Roaming\Python-Eggs is writable by group\others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).

  warnings.warn(msg, UserWarning) ..to.. C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  

C:\Python27\lib\site-packages\pkg_resources.py:1045: UserWarning: C:\Windows\system32\config\systemprofile\AppData\Roaming\Python-Eggs is writable by group\X-Men Gold 010 (2017).warn(msg, UserWarning)
30-Dec-2017 12:24:40 - WARNING :: Post-Processing : [POST-PROCESSING] Failed to move C:\Program Files (x86)\Mylar\cache\mylar_fl8zkp\X-Men Gold 010 (2017) (Digital) (Zone-Empire).cbz  

C:\Python27\lib\site-packages\pkg_resources.py:1045: UserWarning: C:\Windows\system32\config\systemprofile\AppData\Roaming\Python-Eggs is writable by group\others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).

  warnings.warn(msg, UserWarning) - check directories and manually re-run.
30-Dec-2017 12:24:40 - WARNING :: Post-Processing : [POST-PROCESSING] Post-Processing ABORTED
evilhero commented 6 years ago

It looks like it's appending the warning message to the end of the filename so when it goes to move things it cannot due to the length/content of the warning message.

I would imagine because it's being run as a system service that you need to address the warning message that's being displayed (I'm assuming at this point that when ran from the .vbs script, no such problems occurred). Fixing that error should allow the post-processing to work properly. That being said, the error message (or any error for that matter) should not be appending to the end of the filename, so I'll have to figure that one out as I know it traps against specific errors when metatagging, but that particular error I've never seen before....

One other thing of note, \NAS1\Media\Comics\Issues$Publisher$Series wouldn't be considered a valid path - I'm just thinking that you mean to put the $Publisher\$Series as the folder format, and the Comic Location is set to the \NAS1\Media\Comics\Issues, but again this is just hypothetical at this point, since I don't know the exact folder formats you're utilising.

skywayskase commented 6 years ago

You're correct both in that when starting with the VBS script, PP works fine, and also about the file path: (destination_dir = \\NAS1\Media\Comics and folder_format = Issues\$Publisher\$Series ($Year))

I'll try to figure out what the root cause of the error is and see if I can resolve it myself