Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Exception generated: cannot use a string pattern on a bytes-like object' when sending Plex notifications #6395

Closed
akang6 opened this issue Mar 21, 2019 · 2 comments
Labels

Comments

@akang6
Copy link
Contributor

akang6 commented Mar 21, 2019

Describe the bug
I use Sabnzbd and nzbToMedia to post process new episodes. I noticed that I was getting notifications that post processing failed and nzbToMedia was saying the post processing failed but when I checked I saw that it did complete. After some digging through the logs, I saw that there was an error at the end of post processing when Plex was being notified. Testing my Plex notifications in the settings seems to work fine, just during the post processing.

To Reproduce
Steps to reproduce the behavior:

  1. Turn on Plex notifications
  2. Post process a new episode
  3. See error in log

Expected behavior
Plex to be notified and post processing to be completed cleanly

Medusa (please complete the following information):

  • OS: Ubuntu 16.04.6 LTS
  • Branch: master
  • Commit: b34f1df

Logs:

nzbToMedia logs:

[23:57:43] [INFO]::MAIN: Checking database structure...
[23:57:43] [INFO]::MAIN: Checking if git needs an update
[23:57:45] [INFO]::MAIN: No update needed
[23:57:45] [INFO]::MAIN: nzbToMedia Version:0db7c3e10c01cee85814a31fd3c5232b1d7d144e Branch:master (Linux 4.4.0-142-generic)
[23:57:45] [INFO]::MAIN: #########################################################
[23:57:45] [INFO]::MAIN: ## ..::[nzbToMedia.py]::.. ##
[23:57:45] [INFO]::MAIN: #########################################################
[23:57:45] [INFO]::MAIN: Script triggered from SABnzbd 0.7.17+
[23:57:46] [INFO]::MAIN: Auto-detected SECTION:SickBeard
[23:57:46] [INFO]::MAIN: Calling SickBeard:tv to post-process:Kims.Convenience.S03E11.720p.HEVC.x265-MeGusta-Obfuscated.nzb
[23:57:46] [INFO]::MAIN: Attempting to auto-detect tv fork
[23:57:54] [INFO]::MAIN: SickBeard:tv fork auto-detection found custom params {'force': None, 'is_priority': None, 'failed': None, 'process_method': None, 'proc_dir': None, 'type': None, 'delete_on': None}
[23:57:54] [INFO]::MAIN: SickBeard:tv fork set to custom
[23:57:54] [INFO]::MAIN: FLATTEN: Flattening directory: /home/andy/staging/complete/tv/Kims.Convenience.S03E11.720p.HEVC.x265-MeGusta-Obfuscated
[23:57:54] [POSTPROCESS]::SICKBEARD: SUCCESS: The download succeeded, sending a post-process request
[23:58:13] [ERROR]::MAIN: A problem was reported in the /home/andy/.scripts/nzbToMedia/nzbToSickBeard.py script.
bs/common/transmissionrpc/utils.pyc

Medusa logs:

2019-03-20 23:58:13 INFO     Thread_0 :: [b34f1df] Sending slack message: Download Finished: Kim's Convenience - 3x11 - Appanticitis - 720p HDTV
2019-03-20 23:58:13 INFO     Thread_0 :: [b34f1df] Sending slack message  to url: https://hooks.slack.com/services/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
2019-03-20 23:58:13 DEBUG    Thread_0 :: [b34f1df] GET URL: http://plex.basestar.online:32400/library/sections [Status: 200]
2019-03-20 23:58:13 DEBUG    Thread_0 :: [b34f1df] User-Agent: Medusa/0.3.1 (Linux; 4.4.0-142-generic; a1c9af30-4b6f-11e9-9335-000c293cf389)
2019-03-20 23:58:13 DEBUG    Thread_0 :: [b34f1df] PLEX: Updating all hosts with TV sections: 2
2019-03-20 23:58:13 DEBUG    Thread_0 :: [b34f1df] GET URL: http://plex.basestar.online:32400/library/sections/2/refresh [Status: 200]
2019-03-20 23:58:13 DEBUG    Thread_0 :: [b34f1df] User-Agent: Medusa/0.3.1 (Linux; 4.4.0-142-generic; a1c9af30-4b6f-11e9-9335-000c293cf389)
2019-03-20 23:58:13 ERROR    Thread_0 :: [b34f1df] Exception generated: cannot use a string pattern on a bytes-like object
Traceback (most recent call last):
  File "/opt/Medusa/medusa/server/web/core/base.py", line 262, in async_call
    result = function(**kwargs)
  File "/opt/Medusa/medusa/server/web/home/post_process.py", line 55, in processEpisode
    ignore_subs=argToBool(ignore_subs)
  File "/opt/Medusa/medusa/process_tv.py", line 145, in process
    ignore_subs=ignore_subs)
  File "/opt/Medusa/medusa/process_tv.py", line 335, in process_files
    self.process_media(path, self.video_files, force, is_priority, ignore_subs)
  File "/opt/Medusa/medusa/process_tv.py", line 556, in process_media
    self.result = processor.process()
  File "/opt/Medusa/medusa/post_processor.py", line 1305, in process
    self._run_extra_scripts(ep_obj)
  File "/opt/Medusa/medusa/post_processor.py", line 972, in _run_extra_scripts
    script_cmd = [piece for piece in re.split(r'(\'.*?\'|".*?"| )', cur_script_name) if piece.strip()]
  File "/usr/lib/python3.6/re.py", line 212, in split
    return _compile(pattern, flags).split(string, maxsplit)
TypeError: cannot use a string pattern on a bytes-like object
@triage-new-issues triage-new-issues bot added the triage Untriaged issue label Mar 21, 2019
@medariox medariox added the Bug label Mar 21, 2019
@triage-new-issues triage-new-issues bot removed the triage Untriaged issue label Mar 21, 2019
@jtwill
Copy link

jtwill commented Mar 26, 2019

I have also been getting this identical exception for every show downloaded and sent to post-processing. Same modules in the traceback, same line numbers for the error.

@medariox
Copy link
Contributor

It's because of the extra scripts you are using. Disable extra scripts or use Python 2.7 if you don't want to wait for the next release. Fixed with 6834891

medariox added a commit that referenced this issue Mar 30, 2019
* Fix running extra scripts in Python 3. Fixes #6395

* flake8

* Update CHANGELOG.md
Thilas pushed a commit to Thilas/Medusa that referenced this issue Jun 5, 2019
…6428)

* Fix running extra scripts in Python 3. Fixes pymedusa#6395

* flake8

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants