clinton-hall / nzbToMedia

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

No continuation after failed download - Medusa - SABNZBD #1633

Closed Sarcas666 closed 4 years ago

Sarcas666 commented 5 years ago

Describe the bug I noticed that downloads got stuck on 'snatched' in medusa (v0.3.4) after SABNZBD failed to download them.

Technical Specs

  1. Running on MacOS 10.14.5
  2. Python version '2.7.10 (default, Feb 22 2019, 21:55:15) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)]
  3. Download Client SABnbzd v2.3.9 [03c10dc]
  4. Intended Media Management Medusa v.0.3.4

Expected behavior I expect Medusa accepting the failed download message and try the next option.

Log Please provide an extract, or full debug log that indicates the issue.

`Changing to directory: /Applications/nzbToMedia

-- Cleaning bytecode --

No bytecode to clean

-- Cleaning folders: ['libs', 'core'] -- No folders to clean

Returning to directory: /Applications/SABnzbd.app/Contents/Resources

-- Cleanup finished --

[13:24:49] [INFO]::MAIN: Loading config from [/Applications/nzbToMedia/autoProcessMedia.cfg]
[13:24:49] [INFO]::ENVIRONMENT: SAB_SCRIPT: nzbToSickBeard.py
[13:24:49] [INFO]::ENVIRONMENT: SAB_ORIG_NZB_GZ: /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE/__ADMIN__/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb.gz
[13:24:49] [INFO]::ENVIRONMENT: SAB_PAR2_COMMAND: /Applications/SABnzbd.app/Contents/Resources/osx/par2/par2-sl64
[13:24:49] [INFO]::ENVIRONMENT: VERSIONER_PYTHON_PREFER_32_BIT: no
[13:24:49] [INFO]::ENVIRONMENT: SAB_DUPLICATE: 0
[13:24:49] [INFO]::ENVIRONMENT: PYTHONDONTWRITEBYTECODE: 1
[13:24:49] [INFO]::ENVIRONMENT: SAB_PP_STATUS: 3
[13:24:49] [INFO]::ENVIRONMENT: LOGNAME: username
[13:24:49] [INFO]::ENVIRONMENT: USER: username
[13:24:49] [INFO]::ENVIRONMENT: PATH: /usr/bin:/bin:/usr/sbin:/sbin
[13:24:49] [INFO]::ENVIRONMENT: HOME: /Users/username
[13:24:49] [INFO]::ENVIRONMENT: PYTHONUNBUFFERED: 1
[13:24:49] [INFO]::ENVIRONMENT: SAB_BYTES: 5348093089
[13:24:49] [INFO]::ENVIRONMENT: ARGVZERO: /Applications/SABnzbd.app/Contents/MacOS/SABnzbd
[13:24:49] [INFO]::ENVIRONMENT: LANG: en_US.UTF-8
[13:24:49] [INFO]::ENVIRONMENT: SAB_AGE: 66d
[13:24:49] [INFO]::ENVIRONMENT: SHELL: /bin/bash
[13:24:49] [INFO]::ENVIRONMENT: SAB_UNWANTED_EXT: 0
[13:24:49] [INFO]::ENVIRONMENT: SAB_FAIL_MSG: Aborted, cannot be completed - https://sabnzbd.org/not-complete
[13:24:49] [INFO]::ENVIRONMENT: SAB_NZO_ID: SABnzbd_nzo_ZduQ9r
[13:24:49] [INFO]::ENVIRONMENT: SECURITYSESSIONID: 186a9
[13:24:49] [INFO]::ENVIRONMENT: XPC_FLAGS: 0x0
[13:24:49] [INFO]::ENVIRONMENT: SAB_CAT: tv
[13:24:49] [INFO]::ENVIRONMENT: SAB_COMPLETE_DIR: /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE
[13:24:49] [INFO]::ENVIRONMENT: SSL_CERT_FILE: /Applications/SABnzbd.app/Contents/Resources/cacert.pem
[13:24:49] [INFO]::ENVIRONMENT: SAB_PASSWORD:
[13:24:49] [INFO]::ENVIRONMENT: EXECUTABLEPATH: /Applications/SABnzbd.app/Contents/MacOS/SABnzbd
[13:24:49] [INFO]::ENVIRONMENT: SAB_STATUS: Running
[13:24:49] [INFO]::ENVIRONMENT: SAB_7ZIP_COMMAND: /Applications/SABnzbd.app/Contents/Resources/osx/7zip/7za
[13:24:49] [INFO]::ENVIRONMENT: _PY2APP_LAUNCHED_: 1
[13:24:49] [INFO]::ENVIRONMENT: SAB_BYTES_TRIED: 734133110
[13:24:49] [INFO]::ENVIRONMENT: SAB_ZIP_COMMAND: /usr/bin/unzip
[13:24:49] [INFO]::ENVIRONMENT: SAB_AVG_BPS: 280
[13:24:49] [INFO]::ENVIRONMENT: SAB_FILENAME: Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb
[13:24:49] [INFO]::ENVIRONMENT: SAB_GROUP: alt.binaries.etc
[13:24:49] [INFO]::ENVIRONMENT: SAB_DOWNLOAD_TIME: 0
[13:24:49] [INFO]::ENVIRONMENT: XPC_SERVICE_NAME: org.sabnzbd.team.44996
[13:24:49] [INFO]::ENVIRONMENT: SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.lkWcjwiXLG/Listeners
[13:24:49] [INFO]::ENVIRONMENT: SAB_PP: 3
[13:24:49] [INFO]::ENVIRONMENT: Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.qah7SOELeJ/Render
[13:24:49] [INFO]::ENVIRONMENT: SAB_BYTES_DOWNLOADED: 60201
[13:24:49] [INFO]::ENVIRONMENT: SAB_OVERSIZED: 0
[13:24:49] [INFO]::ENVIRONMENT: SAB_PROGRAM_DIR: /Applications/SABnzbd.app/Contents/Resources
[13:24:49] [INFO]::ENVIRONMENT: LC_ALL: en_US.UTF-8
[13:24:49] [INFO]::ENVIRONMENT: SAB_URL: https://nzbfinder.ws/getnzb/cdf79a67b3eabcdbb4ced752c01523c10cbc1c93.nzb&i=76085&r=123
[13:24:49] [INFO]::ENVIRONMENT: SAB_REPAIR: 1
[13:24:49] [INFO]::ENVIRONMENT: SAB_UNPACK: 1
[13:24:49] [INFO]::ENVIRONMENT: TMPDIR: /var/folders/5w/r2d89fbn7j18rf4yv8p928zc0000gq/T/
[13:24:49] [INFO]::ENVIRONMENT: SAB_FAILURE_URL: https://nzbfinder.ws/failed/?guid=cdf79a67b3eabcdbb4ced752c01523c10cbc1c93&userid=123&rsstoken=123
[13:24:49] [INFO]::ENVIRONMENT: SAB_PRIORITY: 0
[13:24:49] [INFO]::ENVIRONMENT: SAB_MULTIPAR_COMMAND:
[13:24:49] [INFO]::ENVIRONMENT: VERSIONER_PYTHON_VERSION: 2.7
[13:24:49] [INFO]::ENVIRONMENT: RESOURCEPATH: /Applications/SABnzbd.app/Contents/Resources
[13:24:49] [INFO]::ENVIRONMENT: SAB_RAR_COMMAND: /Applications/SABnzbd.app/Contents/Resources/osx/unrar/unrar
[13:24:49] [INFO]::ENVIRONMENT: __CF_USER_TEXT_ENCODING: 0x1F7:0x0:0x5
[13:24:49] [INFO]::ENVIRONMENT: SAB_ENCRYPTED: 0
[13:24:49] [INFO]::ENVIRONMENT: SAB_VERSION: 2.3.9
[13:24:49] [INFO]::ENVIRONMENT: SAB_FINAL_NAME: Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE
/Applications/nzbToMedia/eol.py:139: LifetimeWarning: Python 2.7 is no longer supported.
warnings.warn(msg, LifetimeWarning)
[13:24:49] [INFO]::MAIN: Python v2.7 will reach end of life in 172 days.
[13:24:49] [WARNING]::MAIN: Please upgrade to a more recent Python version.
[13:24:49] [INFO]::MAIN: Checking database structure...
[13:24:49] [DEBUG]::MAIN: Checking Initial Schema database upgrade
[13:24:49] [DB]::MAIN: nzbtomedia.db: SELECT 1 FROM sqlite_master WHERE name = ?; with args ('db_version',)
[13:24:49] [DB]::MAIN: nzbtomedia.db: SELECT db_version FROM db_version
[13:24:49] [DEBUG]::MAIN: InitialSchema upgrade not required
[13:24:49] [DEBUG]::MAIN: Checking if we can use git commands: "/usr/bin/git" version
[13:24:49] [DEBUG]::MAIN: Executing "/usr/bin/git" version with your shell in /Applications/nzbToMedia
[13:24:49] [DEBUG]::MAIN: "/usr/bin/git" version : returned successful
[13:24:49] [DEBUG]::MAIN: Using: "/usr/bin/git"
[13:24:49] [DEBUG]::MAIN: Executing "/usr/bin/git" symbolic-ref -q HEAD with your shell in /Applications/nzbToMedia
[13:24:49] [DEBUG]::MAIN: "/usr/bin/git" symbolic-ref -q HEAD : returned successful
[13:24:49] [INFO]::MAIN: Checking if git needs an update
[13:24:49] [DEBUG]::MAIN: Executing "/usr/bin/git" rev-parse HEAD with your shell in /Applications/nzbToMedia
[13:24:49] [DEBUG]::MAIN: "/usr/bin/git" rev-parse HEAD : returned successful
[13:24:49] [DEBUG]::MAIN: Executing "/usr/bin/git" fetch origin with your shell in /Applications/nzbToMedia
[13:24:50] [DEBUG]::MAIN: "/usr/bin/git" fetch origin : returned successful
[13:24:50] [DEBUG]::MAIN: Executing "/usr/bin/git" rev-parse --verify --quiet '@{upstream}' with your shell in /Applications/nzbToMedia
[13:24:50] [DEBUG]::MAIN: "/usr/bin/git" rev-parse --verify --quiet '@{upstream}' : returned successful
[13:24:50] [DEBUG]::MAIN: Executing "/usr/bin/git" rev-list --left-right '@{upstream}'...HEAD with your shell in /Applications/nzbToMedia
[13:24:50] [DEBUG]::MAIN: "/usr/bin/git" rev-list --left-right '@{upstream}'...HEAD : returned successful
[13:24:50] [DEBUG]::MAIN: cur_commit = 95e4c70d9a85b4f1737bd5b272756d7efce2df64 % (newest_commit)= 95e4c70d9a85b4f1737bd5b272756d7efce2df64, num_commits_behind = 0, num_commits_ahead = 0
[13:24:50] [INFO]::MAIN: No update needed
[13:24:50] [INFO]::MAIN: nzbToMedia Version:95e4c70d9a85b4f1737bd5b272756d7efce2df64 Branch:master (Darwin 18.6.0)
[13:24:50] [INFO]::MAIN: #########################################################
[13:24:50] [INFO]::MAIN: ## ..::[nzbToMedia.py]::.. ##
[13:24:50] [INFO]::MAIN: #########################################################
[13:24:50] [DEBUG]::MAIN: Options passed into nzbToMedia: ['/Applications/nzbToMedia/nzbToSickBeard.py', '/Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE', 'Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb', 'Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE', '', 'tv', 'alt.binaries.etc', '3', 'https://nzbfinder.ws/failed/?guid=cdf79a67b3eabcdbb4ced752c01523c10cbc1c93&userid=123&rsstoken=123']
[13:24:50] [INFO]::MAIN: Script triggered from SABnzbd 0.7.17+
[13:24:50] [DEBUG]::MAIN: Searching for nzoid from SAbnzbd ...
[13:24:50] [DEBUG]::MAIN: Found nzoid: SABnzbd_nzo_ZduQ9r
[13:24:50] [DEBUG]::MAIN: Adding NZB download info for directory /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE to database
[13:24:50] [DB]::MAIN: nzbtomedia.db: UPDATE downloads SET status = ?, client_agent = ?, last_update = ?, input_id = ?, input_hash = ?, input_name = ? WHERE input_directory = ? with args [0, u'sabnzbd', 737253, u'SABnzbd_nzo_ZduQ9r', u'SABnzbd_nzo_ZduQ9r', u'Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb', u'/Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE']
[13:24:50] [DB]::MAIN: nzbtomedia.db: INSERT OR IGNORE INTO downloads (status, client_agent, last_update, input_id, input_hash, input_name) VALUES (?, ?, ?, ?, ?, ?) with args [0, u'sabnzbd', 737253, u'SABnzbd_nzo_ZduQ9r', u'SABnzbd_nzo_ZduQ9r', u'Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb']
[13:24:50] [INFO]::MAIN: Auto-detected SECTION:SickBeard
[13:24:50] [DEBUG]::MAIN: Checking for archives to extract in directory: /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE
[13:24:50] [DEBUG]::MAIN: EXTRACTOR: Unknown file type:
[13:24:50] [INFO]::MAIN: Extracting /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE/__ADMIN__/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb.gz to /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE/__ADMIN__
[13:24:50] [DEBUG]::MAIN: Extracting [] /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE/__ADMIN__/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb.gz /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE/__ADMIN__
[13:24:50] [ERROR]::MAIN: EXTRACTOR: Extraction failed for /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE/__ADMIN__/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb.gz. Result was 126
[13:24:50] [INFO]::MAIN: Calling SickBeard:tv to post-process:Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb
[13:24:50] [DEBUG]::SERVER: Attempting to connect to server at http://localhost:8081
[13:24:51] [DEBUG]::SERVER: Server responded at http://localhost:8081
[13:24:52] [INFO]::MAIN: SickBeard:tv fork set to Medusa
[13:24:52] [WARNING]::SICKBEARD: No media files found in directory /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE. Processing this as a failed download
[13:24:52] [INFO]::MAIN: Sending failure notification to indexer site
[13:24:52] [POSTPROCESS]::SICKBEARD: FAILED: The download failed. Sending 'failed' process request to Medusa branch
[13:24:52] [DEBUG]::SICKBEARD: Opening URL: http://localhost:8081/api/76a7b64f02c2efdb7f96868502a94302/?cmd=postprocess with params: {'nzbName': 'Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb', 'quiet': 1, 'failed': 1, 'process_method': 'move', 'proc_dir': '/Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE', 'delete_on': 1}
[13:24:53] [POSTPROCESS]::SICKBEARD: Deleting failed files and folder /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE
[13:24:53] [INFO]::MAIN: Deleting /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE
[13:24:53] [DB]::DB: Updating DB download status of Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb to 1
[13:24:53] [DB]::MAIN: nzbtomedia.db: UPDATE downloads SET status=?, last_update=? WHERE input_name=? with args [1, 737253, u'Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb']
[13:24:53] [INFO]::CLEANDIR: Directory /Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE has been processed and removed ...
[13:24:53] [INFO]::MAIN: The /Applications/nzbToMedia/nzbToSickBeard.py script completed successfully.
SickBeard: Successfully post-processed Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb!`

From the Medusa warnings: 2019-07-13 13:24:52 WARNING TORNADO :: [74c3f12] Not enough information to parse release name into a valid show. Consider adding scene exceptions or improve naming for: tv 2019-07-13 13:24:52 WARNING TORNADO :: [74c3f12] Failed Download Processing failed: None, /Users/user/Downloads/MediaDownloads/tv:

SABnzbd shows with some successful downloads the message "SickBeard: Successfully post-processed name!". Usually it mentions the name, but I just noticed it doesn't always do this.

clinton-hall commented 5 years ago

we pass the info to medusa:Opening URL: http://localhost:8081/api/76a7b64f02c2efdb7f96868502a94302/?cmd=postprocess with params: {'nzbName': 'Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE.nzb', 'quiet': 1, 'failed': 1, 'process_method': 'move', 'proc_dir': '/Users/username/Downloads/MediaDownloads/incompleteSABnzbd/Doom.Patrol.S01E01.INTERNAL.2160p.WEB.H264-DEFLATE', 'delete_on': 1}

So I'm not sure what additional information medusa needs to try and parse a release name. what guidance does Medusa give for the api command postprocess? particularly in relation to failed downloads.

clinton-hall commented 5 years ago

Looking at this again, it is probably that something has changed with the medusa api. I recommend using auto fork detection:

[SickBeard]
    [[tv]]
        fork = auto
Sarcas666 commented 5 years ago

Thanks for the replies. I'll keep an eye on it so see if any new info comes up. I vaguely remember changing the fork to Medusa a long, long time ago because of ... something... I've put it back to auto :)

tchirou commented 5 years ago

Just putting my 2 cents for people looking for the same issue. I had the same problem with the fork on sickchill. I put it on auto and failed download management works again.

Sarcas666 commented 4 years ago

Had no more problems after setting it to auto again.