evilhero / mylar

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

Issue with post-processing : ComicRN: /usr/bin/env: ‘python’: No such file or directory #1947

Closed ChapeLu closed 6 years ago

ChapeLu commented 6 years ago

Hi,

I'm running Mylar on Unraid in a docker and up to now post-processing worked perfectly, I was getting logs about my autoProcessComics.py being out of date so decided to update my files and since then I can't get it to work. Unfortunately I've done it the same time as new development update so not sure if it's the update or me updating the script files that caused the issue. I'm getting this in NZBGET log every time I download the file:

Tue May 08 2018 21:13:41 INFO Collection Infinity.Countdown.001.2018.Digital.Zone-Empire added to queue Tue May 08 2018 21:13:41 INFO Reordering files for Infinity.Countdown.001.2018.Digital.Zone-Empire Tue May 08 2018 21:13:56 INFO Successfully downloaded Infinity.Countdown.001.2018.Digital.Zone-Empire/Infinity Countdown 001 (2018) (Digital) (Zone-Empire).cbr Tue May 08 2018 21:13:56 INFO Collection Infinity.Countdown.001.2018.Digital.Zone-Empire completely downloaded Tue May 08 2018 21:13:56 INFO Queueing Infinity.Countdown.001.2018.Digital.Zone-Empire for post-processing Tue May 08 2018 21:13:57 INFO Checking renamed files for Infinity.Countdown.001.2018.Digital.Zone-Empire Tue May 08 2018 21:13:57 INFO No renamed files found for Infinity.Countdown.001.2018.Digital.Zone-Empire Tue May 08 2018 21:13:57 INFO Nothing to par-check for Infinity.Countdown.001.2018.Digital.Zone-Empire Tue May 08 2018 21:13:57 INFO Nothing to unpack for Infinity.Countdown.001.2018.Digital.Zone-Empire Tue May 08 2018 21:13:57 INFO Cleaning up Infinity.Countdown.001.2018.Digital.Zone-Empire Tue May 08 2018 21:13:57 INFO Nothing to cleanup for Infinity.Countdown.001.2018.Digital.Zone-Empire Tue May 08 2018 21:13:57 INFO Moving completed files for Infinity.Countdown.001.2018.Digital.Zone-Empire Tue May 08 2018 21:13:57 INFO Moving file Infinity Countdown 001 (2018) (Digital) (Zone-Empire).cbr to /downloads/comics/Infinity.Countdown.001.2018.Digital.Zone-Empire Tue May 08 2018 21:13:57 INFO Move for Infinity.Countdown.001.2018.Digital.Zone-Empire successful Tue May 08 2018 21:13:57 INFO Executing post-process-script ComicRN.py for Infinity.Countdown.001.2018.Digital.Zone-Empire Tue May 08 2018 21:13:57 INFO ComicRN: /usr/bin/env: ‘python’: No such file or directory Tue May 08 2018 21:13:57 ERROR Post-process-script ComicRN.py for Infinity.Countdown.001.2018.Digital.Zone-Empire failed (terminated with unknown status) Tue May 08 2018 21:13:58 INFO Collection Infinity.Countdown.001.2018.Digital.Zone-Empire added to history

EDIT: I found this in Mylar LOG:

2018-05-09 09:26:08 ERROR Uncaught exception: Traceback (most recent call last):File "/opt/mylar/mylar/logger.py", line 335, in new_runold_run(*args, *kwargs)File "/usr/lib/python2.7/threading.py", line 754, in runself.__target(self.args, **self.kwargs)File "/opt/mylar/mylar/webserve.py", line 1427, in queueissuefoundcom, prov = search.search_init(ComicName, ComicIssue, ComicYear, SeriesYear, Publisher, issues['IssueDate'], storedate, IssueID, AlternateSearch, UseAFuzzy, ComicVersion, mode=mode, ComicID=ComicID, manualsearch=manualsearch, filesafe=ComicName_Filesafe, allow_packs=AllowPacks, torrentid_32p=TorrentID_32p)File "/opt/mylar/mylar/search.py", line 334, in search_initfindit = NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDate, StoreDate, searchprov, send_prov_count, IssDateFix, IssueID, UseFuzzy, newznab_host, ComicVersion=ComicVersion, SARC=SARC, IssueArcID=IssueArcID, RSS="no", ComicID=ComicID, issuetitle=issuetitle, unaltered_ComicName=unaltered_ComicName, allow_packs=allow_packs, oneoff=oneoff, cmloopit=cmloopit, manual=manual, torznab_host=torznab_host, torrentid_32p=torrentid_32p)File "/opt/mylar/mylar/search.py", line 1783, in NZB_SEARCHsearchresult = searcher(nzbprov, nzbname, mylar.COMICINFO, links, IssueID, ComicID, tmpprov, newznab=newznab_host, torznab=torznab_host)File "/opt/mylar/mylar/search.py", line 2674, in searcherlogger.warn('Unable to send nzb file to NZBGet. There was a parameter error as there are no values present: %s' % nzbget_params)NameError: global name 'nzbget_params' is not defined
2018-05-09 09:26:08 WARNING uh-oh: not well-formed (invalid token): line 2, column 0
2018-05-09 09:26:07 DEBUG sending now to http://**************/xmlrpc
2018-05-09 09:26:07 DEBUG Successfully changed permissions [0777 / 0660]
2018-05-09 09:26:07 DEBUG Cache Directory successfully found at : /opt/mylar/cache/. Ensuring proper permissions.
2018-05-09 09:26:07 INFO filen: InfinityCountdown0012018DigitalZone-Empire.nzb -- nzbname: Infinity.Countdown.001.2018.Digital.Zone-Empire are not identical. Storing extra value as : InfinityCountdown0012018DigitalZone-Empire
2018-05-09 09:26:07 DEBUG [FILENAME] end nzbname: InfinityCountdown0012018DigitalZone-Empire.nzb
2018-05-09 09:26:07 DEBUG [FILENAME] nzbname (\s): InfinityCountdown0012018DigitalZone-Empire.nzb
2018-05-09 09:26:07 DEBUG [FILENAME] filename (remove chars): InfinityCountdown0012018DigitalZone-Empire.cbr.nzb
2018-05-09 09:26:07 DEBUG filename within nzb: Infinity Countdown 001 (2018) (Digital) (Zone-Empire).cbr.nzb
2018-05-09 09:26:07 DEBUG Status code returned: 200
2018-05-09 09:26:07 DEBUG [PAYLOAD-NONE]Download URL: hxYOUDONTNEEDTOKNOWTHISx [VerifySSL:False]
2018-05-09 09:26:07 DEBUG [FAILED_DOWNLOAD_CHECKER] This is not in the failed downloads list. Will continue with the download.
2018-05-09 09:26:07 INFO [FAILED_DOWNLOAD_CHECKER] Successfully marked this download as Good for downloadable content
2018-05-09 09:26:07 INFO prov : experimental[191483544]
2018-05-09 09:26:07 INFO oneoff: False
2018-05-09 09:26:07 INFO IssueID: 662090
2018-05-09 09:26:07 INFO nzbid: 191483544
2018-05-09 09:26:07 DEBUG link given by: experimental
2018-05-09 09:26:07 INFO Found Infinity Countdown (2018) issue: 1 using experimental
2018-05-09 09:26:07 DEBUG issues match!
2018-05-09 09:26:07 DEBUG nzbname used for post-processing:Infinity.Countdown.001.2018.Digital.Zone-Empire
2018-05-09 09:26:07 DEBUG [SEARCHER] end nzbname: Infinity.Countdown.001.2018.Digital.Zone-Empire
2018-05-09 09:26:07 DEBUG [SEARCHER] nzbname (\s): Infinity Countdown 001 2018 Digital Zone-Empire
2018-05-09 09:26:07 DEBUG [SEARCHER] nzbname (remove chars): Infinity Countdown 001 2018 Digital Zone-Empire .cbr

EDIT 2: Another file just in case (no error in Mylar in this case):

NZBGET:

Wed May 09 2018 09:38:34 INFO Collection Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm added to queue Wed May 09 2018 09:38:34 INFO Reordering files for Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm Wed May 09 2018 09:38:44 INFO Successfully downloaded Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm/Marvel's Avengers - Infinity War Prelude 01 (of 02) (2018) (digital) (Minutemen-Bookworm).cbr Wed May 09 2018 09:38:44 INFO Collection Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm completely downloaded Wed May 09 2018 09:38:44 INFO Queueing Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm for post-processing Wed May 09 2018 09:38:52 INFO Checking renamed files for Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm Wed May 09 2018 09:38:52 INFO No renamed files found for Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm Wed May 09 2018 09:38:52 INFO Nothing to par-check for Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm Wed May 09 2018 09:38:52 INFO Nothing to unpack for Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm Wed May 09 2018 09:38:52 INFO Cleaning up Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm Wed May 09 2018 09:38:52 INFO Nothing to cleanup for Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm Wed May 09 2018 09:38:53 INFO Moving completed files for Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm Wed May 09 2018 09:38:53 INFO Moving file Marvel's Avengers - Infinity War Prelude 01 (of 02) (2018) (digital) (Minutemen-Bookworm).cbr to /downloads/comics/Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm Wed May 09 2018 09:38:53 INFO Move for Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm successful Wed May 09 2018 09:38:53 INFO Executing post-process-script ComicRN.py for Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm Wed May 09 2018 09:38:53 INFO ComicRN: /usr/bin/env: ‘python’: No such file or directory Wed May 09 2018 09:38:53 ERROR Post-process-script ComicRN.py for Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm failed (terminated with unknown status) Wed May 09 2018 09:38:53 INFO Collection Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm added to history

MYLAR:

2018-05-09 09:38:34 INFO [UPDATER] Updated the status (Snatched) complete for Marvel's Avengers: Infinity War Prelude Issue: 1
2018-05-09 09:38:34 DEBUG [UPDATER] Provider is newznab
2018-05-09 09:38:34 INFO [UPDATER] Updating status to snatched
2018-05-09 09:38:34 DEBUG [UPDATER] issueid: 655508
2018-05-09 09:38:34 DEBUG [UPDATER] comicid: 108108
2018-05-09 09:38:34 INFO passing to updater.
2018-05-09 09:38:34 DEBUG findit = found!
2018-05-09 09:38:34 INFO setting the alternate nzbname for this download grabbed by NZBs.in (newznab) in the nzblog to : MarvelsAvengers-InfinityWarPrelude01of022018digitalMinutemen-Bookworm
2018-05-09 09:38:34 INFO setting the nzbid for this download grabbed by NZBs.in (newznab) in the nzblog to : df59d00da96322c3afa7bd1d190b10be
2018-05-09 09:38:34 DEBUG Found matching comic...preparing to send to Updater with IssueID: 655508 and nzbname: Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm[MarvelsAvengers-InfinityWarPrelude01of022018digitalMinutemen-Bookworm]
2018-05-09 09:38:34 INFO Successfully sent nzb to NZBGet!
2018-05-09 09:38:34 DEBUG sending now to http://***********/xmlrpc
2018-05-09 09:38:34 DEBUG Successfully changed permissions [0777 / 0660]
2018-05-09 09:38:34 DEBUG Cache Directory successfully found at : /opt/mylar/cache/. Ensuring proper permissions.
2018-05-09 09:38:34 INFO filen: MarvelsAvengers-InfinityWarPrelude01of022018digitalMinutemen-Bookworm -- nzbname: Marvels.Avengers.-.Infinity.War.Prelude.01.of.02.2018.digital.Minutemen-Bookworm are not identical. Storing extra value as : MarvelsAvengers-InfinityWarPrelude01of022018digitalMinutemen-Bookworm
2018-05-09 09:38:34 DEBUG [FILENAME] end nzbname: MarvelsAvengers-InfinityWarPrelude01of022018digitalMinutemen-Bookworm
2018-05-09 09:38:34 DEBUG [FILENAME] nzbname (\s): MarvelsAvengers-InfinityWarPrelude01of022018digitalMinutemen-Bookworm
2018-05-09 09:38:34 DEBUG [FILENAME] filename (remove chars): MarvelsAvengers-InfinityWarPrelude01of022018digitalMinutemen-Bookworm
2018-05-09 09:38:34 DEBUG Status code returned: 200

Any help would be appreciated.

evilhero commented 6 years ago

At the top of the ComicRN script there's what is called a 'shebang', which is just the # sign followed by an exclamation point. It indicates where on the local system the executable to python can be located so that the script can be run.

In your case, your python executable isn't located in the your environment path so it fails (probably cause of unRAID) , so you can either remove the line entirely and see if it can load it based on your system, or specify the path to your python in place of what's there.

ChapeLu commented 6 years ago

Right, I don't remember doing anything to the previous version of ComicRN and it was working fine, foolishly I forgot to do the backup of my old file. I vaguely remember doing something to get scripts to work but that was some years ago. I have two seperate dockers in Unraid, Mylar and NZBGet, just to clarify, script calls for python in Nzbget docker right? I want to pint point the right docker to deal with.

Thanks

evilhero commented 6 years ago

Yep, the ComicRN script is called by the downloader - so the downloader has to be able to access the python executable in order to call the script.

ChapeLu commented 6 years ago

Ok now I remember changing #!/usr/bin/env python to #!/usr/bin/env python2 long time ago, that's where my Python is, typing into terminal /usr/bin/env python2 gives me:

[root@2c33f49c50dd /]# /usr/bin/env python2 Python 2.7.13 (default, Feb 11 2017, 12:22:40) [GCC 6.3.1 20170109] on linux2 Type "help", "copyright", "credits" or "license" for more information.

I did that now but get different warning:

Wed May 09 2018 15:40:20 INFO Collection Infinity.Countdown.001.2018.Digital.Zone-Empire added to queue Wed May 09 2018 15:40:20 INFO Reordering files for Infinity.Countdown.001.2018.Digital.Zone-Empire Wed May 09 2018 15:40:30 INFO Successfully downloaded Infinity.Countdown.001.2018.Digital.Zone-Empire/Infinity Countdown 001 (2018) (Digital) (Zone-Empire).cbr Wed May 09 2018 15:40:30 INFO Collection Infinity.Countdown.001.2018.Digital.Zone-Empire completely downloaded Wed May 09 2018 15:40:30 INFO Queueing Infinity.Countdown.001.2018.Digital.Zone-Empire for post-processing Wed May 09 2018 15:40:30 INFO Checking renamed files for Infinity.Countdown.001.2018.Digital.Zone-Empire Wed May 09 2018 15:40:30 INFO No renamed files found for Infinity.Countdown.001.2018.Digital.Zone-Empire Wed May 09 2018 15:40:31 INFO Nothing to par-check for Infinity.Countdown.001.2018.Digital.Zone-Empire Wed May 09 2018 15:40:31 INFO Nothing to unpack for Infinity.Countdown.001.2018.Digital.Zone-Empire Wed May 09 2018 15:40:31 INFO Cleaning up Infinity.Countdown.001.2018.Digital.Zone-Empire Wed May 09 2018 15:40:31 INFO Nothing to cleanup for Infinity.Countdown.001.2018.Digital.Zone-Empire Wed May 09 2018 15:40:31 INFO Moving completed files for Infinity.Countdown.001.2018.Digital.Zone-Empire Wed May 09 2018 15:40:31 INFO Moving file Infinity Countdown 001 (2018) (Digital) (Zone-Empire).cbr to /downloads/comics/Infinity.Countdown.001.2018.Digital.Zone-Empire Wed May 09 2018 15:40:31 INFO Move for Infinity.Countdown.001.2018.Digital.Zone-Empire successful Wed May 09 2018 15:40:31 INFO Executing post-process-script ComicRN.py for Infinity.Countdown.001.2018.Digital.Zone-Empire Wed May 09 2018 15:40:31 INFO ComicRN: Requests module not found on system. I'll revert so this will work, but you probably should install Wed May 09 2018 15:40:31 INFO ComicRN: requests to bypass this in the future (ie. pip install requests) Wed May 09 2018 15:40:31 INFO ComicRN: Loading config from /downloads/!Nzbget/scripts/autoProcessComics.cfg Wed May 09 2018 15:40:31 INFO ComicRN: Traceback (most recent call last): Wed May 09 2018 15:40:31 INFO ComicRN: File "/downloads/!Nzbget/scripts/ComicRN.py", line 49, in Wed May 09 2018 15:40:31 INFO ComicRN: result = autoProcessComics.processIssue(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], failed=failit, comicrn_version=comicrn_version) Wed May 09 2018 15:40:31 INFO ComicRN: File "/downloads/!Nzbget/scripts/autoProcessComics.py", line 40, in processIssue Wed May 09 2018 15:40:31 INFO ComicRN: apikey = config.get("Mylar", "apikey") Wed May 09 2018 15:40:31 INFO ComicRN: File "/usr/lib/python2.7/ConfigParser.py", line 618, in get Wed May 09 2018 15:40:31 INFO ComicRN: raise NoOptionError(option, section) Wed May 09 2018 15:40:31 INFO ComicRN: ConfigParser.NoOptionError: No option 'apikey' in section: 'Mylar' Wed May 09 2018 15:40:31 ERROR Post-process-script ComicRN.py for Infinity.Countdown.001.2018.Digital.Zone-Empire failed (terminated with unknown status) Wed May 09 2018 15:40:32 INFO Collection Infinity.Countdown.001.2018.Digital.Zone-Empire added to history

I'm sorry for trouble, I have no idea about linux etc.

evilhero commented 6 years ago

The autoProcessComics.cfg needs to be updated. The script changed in the last month (thus the version change warning in Mylar), whereby you no longer need to enter in a user/pass from the autoProcessComics.cfg file. All that's required now is the apikey for Mylar.

ChapeLu commented 6 years ago

It works!!! Sort of, files are downloaded and moved but I still get errors:

Wed May 09 2018 16:09:36 INFO ComicRN: Requests module not found on system. I'll revert so this will work, but you probably should install Wed May 09 2018 16:09:36 INFO ComicRN: requests to bypass this in the future (ie. pip install requests) Wed May 09 2018 16:09:36 INFO ComicRN: Loading config from /downloads/!Nzbget/scripts/autoProcessComics.cfg Wed May 09 2018 16:09:36 INFO ComicRN: Opening URL: http://192.168.0.66:8090/api?apikey=(myapi)&apc_version=2.03&comicrn_version=1.01&nzb_name=Infinity.Countdown.003.2018.Digital.Zone-Empire&cmd=forceProcess&nzb_folder=%2Fdownloads%2Fcomics%2FInfinity.Countdown.003.2018.Digital.Zone-Empire&failed=0 Wed May 09 2018 16:09:36 INFO ComicRN: nzb name: Infinity.Countdown.003.2018.Digital.Zone-Empire Wed May 09 2018 16:09:36 INFO ComicRN: nzb folder: /downloads/comics/Infinity.Countdown.003.2018.Digital.Zone-Empire Wed May 09 2018 16:09:36 INFO ComicRN: nzbname: Infinity.Countdown.003.2018.Digital.Zone-Empire Wed May 09 2018 16:09:36 INFO ComicRN: Issue Year: 2018 Wed May 09 2018 16:09:36 INFO ComicRN: Publisher: Marvel Wed May 09 2018 16:09:36 INFO ComicRN: Series: Infinity Countdown Wed May 09 2018 16:09:36 INFO ComicRN: Year: 2018 Wed May 09 2018 16:09:36 INFO ComicRN: Comic Location: /comics/Marvel/Infinity Countdown (2018) Wed May 09 2018 16:09:36 INFO ComicRN: Comic Version: None Wed May 09 2018 16:09:36 INFO ComicRN: No version # found for series - tag will not be available for renaming. Wed May 09 2018 16:09:36 INFO ComicRN: Original Filename: Infinity Countdown 003 (2018) (Digital) (Zone-Empire).cbr [.cbr] Wed May 09 2018 16:09:36 INFO ComicRN: New Filename: Infinity Countdown V2018 003 (2018) Wed May 09 2018 16:09:36 INFO ComicRN: Source:/downloads/comics/Infinity.Countdown.003.2018.Digital.Zone-Empire/Infinity Countdown 003 (2018) (Digital) (Zone-Empire).cbr Wed May 09 2018 16:09:36 INFO ComicRN: Destination:/comics/Marvel/Infinity Countdown (2018)/Infinity Countdown V2018 003 (2018).cbr Wed May 09 2018 16:09:36 INFO ComicRN: [move] /downloads/comics/Infinity.Countdown.003.2018.Digital.Zone-Empire/Infinity Countdown 003 (2018) (Digital) (Zone-Empire).cbr - to - /comics/Marvel/Infinity Countdown (2018)/Infinity Countdown V2018 003 (2018).cbr Wed May 09 2018 16:09:36 INFO ComicRN: Removed temporary directory : /downloads/comics/Infinity.Countdown.003.2018.Digital.Zone-Empire Wed May 09 2018 16:09:36 INFO ComicRN: Post Processing SUCCESSFUL! Wed May 09 2018 16:09:36 INFO ComicRN: Traceback (most recent call last): Wed May 09 2018 16:09:36 INFO ComicRN: File "/downloads/!Nzbget/scripts/ComicRN.py", line 49, in Wed May 09 2018 16:09:36 INFO ComicRN: result = autoProcessComics.processIssue(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], failed=failit, comicrn_version=comicrn_version) Wed May 09 2018 16:09:36 INFO ComicRN: File "/downloads/!Nzbget/scripts/autoProcessComics.py", line 102, in processIssue Wed May 09 2018 16:09:36 INFO ComicRN: if any("Post Processing SUCCESSFUL" in s for s in result.split('\n')): Wed May 09 2018 16:09:36 INFO ComicRN: AttributeError: 'list' object has no attribute 'split' Wed May 09 2018 16:09:36 ERROR Post-process-script ComicRN.py for Infinity.Countdown.003.2018.Digital.Zone-Empire failed (terminated with unknown status) Wed May 09 2018 16:09:36 INFO Collection Infinity.Countdown.003.2018.Digital.Zone-Empire added to history

evilhero commented 6 years ago

Make sure you install requests for python - the ComicRN uses that to access Mylar's API which is what's causing the initial error. You don't have to, but it's generally more reliable to use it and it's a very well known module.

Also make sure you're using the latest autoProcessComics - newest version just went into development to address the last error in your log (was a stupid conversion problem). Newest autoProcessComics.py is now 2.04.

ChapeLu commented 6 years ago

Ok will look into requests and will update to 2.04 later on, have to leave for work now. Thanks a lot, great help as always!!!