clinton-hall / nzbToMedia

Provides NZB and Torrent postprocessing To CouchPotatoServer, SickBeard/SickRage, HeadPhones, Mylar and Gamez
GNU General Public License v3.0
670 stars 176 forks source link

Exit(1) Exception AttributeError: "'NoneType' object has no attribute 'path'" in > ignored #1745

Closed KohmeiK closed 5 months ago

KohmeiK commented 4 years ago

Describe the bug I only get errors once in a while but when I do, its always one of these. Any idea what could be causing these?

Technical Specs

Running on Unraid Python version 2.7 Download Client SABnbzd Intended Media Management CouchPotoato

/downloads/nzbToMedia/eol.py:147: LifetimeWarning: Python 2.7 is no longer supported.
warnings.warn(msg, LifetimeWarning)
[19:54:55] [INFO]::MAIN: Loading config from [/downloads/nzbToMedia/autoProcessMedia.cfg]
[19:54:55] [INFO]::MAIN: Python v2.7 reached end of life 121 days ago.
[19:54:55] [WARNING]::MAIN: Please upgrade to a more recent Python version.
[19:54:55] [INFO]::MAIN: Checking database structure...
[19:54:55] [DEBUG]::MAIN: Checking Initial Schema database upgrade
[19:54:55] [DEBUG]::MAIN: InitialSchema upgrade not required
[19:54:55] [INFO]::MAIN: Checking if source needs an update
[19:54:55] [DEBUG]::MAIN: cur_commit = f5e4ec0981ab2f6fd97b14b24aa363a393396073 % (newest_commit)= f5e4ec0981ab2f6fd97b14b24aa363a393396073, num_commits_behind = 0
[19:54:55] [INFO]::MAIN: No update needed
[19:54:55] [INFO]::MAIN: nzbToMedia Version:f5e4ec0981ab2f6fd97b14b24aa363a393396073 Branch:master (Linux 4.14.16-unRAID)
[19:54:55] [WARNING]::MAIN: Failed to locate ffmpeg. Transcoding disabled!
[19:54:55] [WARNING]::MAIN: Install ffmpeg with x264 support to enable this feature  ...
[19:54:55] [WARNING]::MAIN: Failed to locate ffprobe. Video corruption detection disabled!
[19:54:55] [WARNING]::MAIN: Install ffmpeg with x264 support to enable this feature  ...
[19:54:55] [INFO]::MAIN: #########################################################
[19:54:55] [INFO]::MAIN: ## ..::[nzbToMedia.pyc]::.. ##
[19:54:55] [INFO]::MAIN: #########################################################
[19:54:55] [DEBUG]::MAIN: Options passed into nzbToMedia: ['/downloads/nzbToMedia/nzbToCouchPotato.py', '/downloads/sabnzbd/movie/Marriage.Story.2019.HDR.2160p.WEBRip.x265-iNTENSO-xpost.cp(tt7653254)', 'Marriage.Story.2019.HDR.2160p.WEBRip.x265-iNTENSO-xpost.cp(tt7653254).nzb', 'Marriage.Story.2019.HDR.2160p.WEBRip.x265-iNTENSO-xpost.cp(tt7653254)', '', 'movie', 'alt.binaries.newznzb.mike', '0', '']
[19:54:55] [INFO]::MAIN: Script triggered from SABnzbd Version 2.3.9.
[19:54:55] [DEBUG]::MAIN: Adding NZB download info for directory /downloads/sabnzbd/movie/Marriage.Story.2019.HDR.2160p.WEBRip.x265-iNTENSO-xpost.cp(tt7653254) to database
[19:54:55] [INFO]::MAIN: Auto-detected SECTION:CouchPotato
[19:54:55] [DEBUG]::MAIN: Checking for archives to extract in directory: /downloads/sabnzbd/movie/Marriage.Story.2019.HDR.2160p.WEBRip.x265-iNTENSO-xpost.cp(tt7653254)
[19:54:55] [INFO]::MAIN: Calling CouchPotato:movie to post-process:Marriage.Story.2019.HDR.2160p.WEBRip.x265-iNTENSO-xpost.cp(tt7653254)
[19:54:55] [INFO]::MAIN: Attemping imdbID lookup for Marriage.Story.2019.HDR.2160p.WEBRip.x265-iNTENSO-xpost.cp(tt7653254)
[19:54:55] [INFO]::MAIN: Searching folder and file names for imdbID ...
[19:54:55] [INFO]::MAIN: Found imdbID [tt7653254]
[19:54:55] [DEBUG]::SERVER: Attempting to connect to server at http://192.168.3.111:5050/api/272ed701dfed42e0913efd1f97fb182b/
[19:54:55] [DEBUG]::SERVER: Server responded at http://192.168.3.111:5050/api/272ed701dfed42e0913efd1f97fb182b/
[19:54:55] [DEBUG]::MAIN: Opening URL: http://192.168.3.111:5050/api/272ed701dfed42e0913efd1f97fb182b/media.get with PARAMS: {u'id': 'tt7653254'}
[19:54:55] [DEBUG]::COUCHPOTATO: Opening URL: http://192.168.3.111:5050/api/272ed701dfed42e0913efd1f97fb182b/renamer.scan with PARAMS: {u'downloader': u'Sabnzbd', u'download_id': u'SABnzbd_nzo_1_ka13', u'media_folder': '/downloads/sabnzbd/movie/Marriage.Story.2019.HDR.2160p.WEBRip.x265-iNTENSO-xpost.cp(tt7653254)'}
[19:54:55] [POSTPROCESS]::COUCHPOTATO: Starting renamer scan for Marriage.Story.2019.HDR.2160p.WEBRip.x265-iNTENSO-xpost.cp(tt7653254)
Changing to directory: /downloads/nzbToMedia

-- Cleaning bytecode --
WARNING: Automatic cleanup could not be executed.
If errors occur, manual cleanup may be required.
REASON : Error: [Errno 2] No such file or directory

Directory is not a git repository

Force cleaning folder: libs
Skipping required subfolders [u'common', u'custom', u'py2', u'win']

Force cleaning folder: core
Skipping required subfolders [u'auto_process', u'extractor', u'plugins', u'utils']
Returning to directory:  /usr/bin

-- Cleanup finished --

Traceback (most recent call last):
File "/downloads/nzbToMedia/nzbToCouchPotato.py", line 272, in <module>
result = nzbToMedia.main(sys.argv, section)
File "/downloads/nzbToMedia/nzbToMedia.py", line 968, in main
failure_link=os.environ['SAB_FAILURE_URL'])
File "/downloads/nzbToMedia/nzbToMedia.py", line 851, in process
result = movies.process(section_name, input_directory, input_name, status, client_agent, download_id, input_category, failure_link)
File "/downloads/nzbToMedia/core/auto_process/movies.py", line 226, in process
r = requests.get(url, params=params, verify=False, timeout=(30, 1800))
File "/downloads/nzbToMedia/libs/common/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/downloads/nzbToMedia/libs/common/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/downloads/nzbToMedia/libs/common/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/downloads/nzbToMedia/libs/common/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/downloads/nzbToMedia/libs/common/requests/adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='192.168.3.111', port=5050): Read timed out. (read timeout=1800)
Exception AttributeError: "'NoneType' object has no attribute 'path'" in <bound method PosixProcess.__del__ of <core.utils.processes.PosixProcess object at 0x146f2cfa2650>> ignored

ERROR 2:

/downloads/nzbToMedia/eol.py:147: LifetimeWarning: Python 2.7 is no longer supported.
warnings.warn(msg, LifetimeWarning)
[20:36:18] [INFO]::MAIN: Loading config from [/downloads/nzbToMedia/autoProcessMedia.cfg]
[20:36:18] [INFO]::MAIN: Python v2.7 reached end of life 121 days ago.
[20:36:18] [WARNING]::MAIN: Please upgrade to a more recent Python version.
[20:36:18] [INFO]::MAIN: Checking database structure...
[20:36:18] [DEBUG]::MAIN: Checking Initial Schema database upgrade
[20:36:18] [DEBUG]::MAIN: InitialSchema upgrade not required
[20:36:18] [INFO]::MAIN: Checking if source needs an update
[20:36:19] [DEBUG]::MAIN: cur_commit = f5e4ec0981ab2f6fd97b14b24aa363a393396073 % (newest_commit)= f5e4ec0981ab2f6fd97b14b24aa363a393396073, num_commits_behind = 0
[20:36:19] [INFO]::MAIN: No update needed
[20:36:19] [INFO]::MAIN: nzbToMedia Version:f5e4ec0981ab2f6fd97b14b24aa363a393396073 Branch:master (Linux 4.14.16-unRAID)
[20:36:19] [WARNING]::MAIN: Failed to locate ffmpeg. Transcoding disabled!
[20:36:19] [WARNING]::MAIN: Install ffmpeg with x264 support to enable this feature  ...
[20:36:19] [WARNING]::MAIN: Failed to locate ffprobe. Video corruption detection disabled!
[20:36:19] [WARNING]::MAIN: Install ffmpeg with x264 support to enable this feature  ...
[20:36:19] [INFO]::MAIN: #########################################################
[20:36:19] [INFO]::MAIN: ## ..::[nzbToMedia.pyc]::.. ##
[20:36:19] [INFO]::MAIN: #########################################################
[20:36:19] [DEBUG]::MAIN: Options passed into nzbToMedia: ['/downloads/nzbToMedia/nzbToCouchPotato.py', '/downloads/sabnzbd/movie/Midway.2019.MULTi.2160p.UHD.BluRay.x265-THREESOME-xpost.cp(tt6924650)', 'Midway.2019.MULTi.2160p.UHD.BluRay.x265-THREESOME-xpost.cp(tt6924650).nzb', 'Midway.2019.MULTi.2160p.UHD.BluRay.x265-THREESOME-xpost.cp(tt6924650)', '', 'movie', 'alt.binaries.wtfnzb.lima', '0', '']
[20:36:19] [INFO]::MAIN: Script triggered from SABnzbd Version 2.3.9.
[20:36:19] [DEBUG]::MAIN: Adding NZB download info for directory /downloads/sabnzbd/movie/Midway.2019.MULTi.2160p.UHD.BluRay.x265-THREESOME-xpost.cp(tt6924650) to database
[20:36:19] [INFO]::MAIN: Auto-detected SECTION:CouchPotato
[20:36:19] [DEBUG]::MAIN: Checking for archives to extract in directory: /downloads/sabnzbd/movie/Midway.2019.MULTi.2160p.UHD.BluRay.x265-THREESOME-xpost.cp(tt6924650)
[20:36:19] [INFO]::MAIN: Calling CouchPotato:movie to post-process:Midway.2019.MULTi.2160p.UHD.BluRay.x265-THREESOME-xpost.cp(tt6924650)
[20:36:19] [INFO]::MAIN: Attemping imdbID lookup for Midway.2019.MULTi.2160p.UHD.BluRay.x265-THREESOME-xpost.cp(tt6924650)
[20:36:19] [INFO]::MAIN: Searching folder and file names for imdbID ...
[20:36:19] [INFO]::MAIN: Found imdbID [tt6924650]
[20:36:19] [DEBUG]::SERVER: Attempting to connect to server at http://192.168.3.111:5050/api/272ed701dfed42e0913efd1f97fb182b/
[20:38:19] [ERROR]::SERVER: Server failed to respond at http://192.168.3.111:5050/api/272ed701dfed42e0913efd1f97fb182b/
[20:38:19] [ERROR]::COUCHPOTATO: Server did not respond. Exiting
[20:38:19] [ERROR]::MAIN: A problem was reported in the /downloads/nzbToMedia/nzbToCouchPotato.py script.
Changing to directory: /downloads/nzbToMedia

-- Cleaning bytecode --
WARNING: Automatic cleanup could not be executed.
If errors occur, manual cleanup may be required.
REASON : Error: [Errno 2] No such file or directory

Directory is not a git repository

Force cleaning folder: libs
Skipping required subfolders [u'common', u'custom', u'py2', u'win']

Force cleaning folder: core
Skipping required subfolders [u'auto_process', u'extractor', u'plugins', u'utils']
Returning to directory:  /usr/bin

-- Cleanup finished --

CouchPotato: Failed to post-process - CouchPotato did not respond.!

CouchPotato is still running, and I can access it through the webGUI with no issue.

clinton-hall commented 4 years ago

Check CouchPotato Logs at those times. It might show some reason why it refused the connection.

Otherwise it might be that your unraid server was experiencing very heavy load and was not able to provide enough resources to CouchPotato to respond to the api (I have seen similar on QNAP, Synology and Asustor NAS). In this case I suggest setting SABnzbd to pause while postprocessing (SABnzbd uses a lot of resources while downloading).