McCloudS / subgen

Autogenerate subtitles using OpenAI Whisper Model via Jellyfin, Plex, Emby, Tautulli, or Bazarr
MIT License
581 stars 49 forks source link

HTTP 500. Exception on /webhook [POST] #11

Closed Wh1t3Rose closed 1 year ago

Wh1t3Rose commented 1 year ago

When playing a media file I get an HTTP 500 Error in Subgen Logs.

Here is the log:

10.0.0.2 - - [04/Jul/2023 17:32:27] "POST /webhook HTTP/1.1" 500 -
Tautulli webhook received!
fullpath: /data/tv/Accused (US)/Season 1/Accused (US) - S01E01 - Scott's Story.mkv
filepath: /data/tv/Accused (US)/Season 1
file name with no extension: Accused (US) - S01E01 - Scott's Story
event: played
/data/tv/Accused (US)/Season 1/Accused (US) - S01E01 - Scott's Story.mkv: No such file or directory
[2023-07-04 17:32:33,942] ERROR in app: Exception on /webhook [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/subgen.py", line 65, in receive_webhook
    if skipifinternalsublang in str(subprocess.check_output("ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 \"{}\"".format(fullpath), shell=True)):
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 "/data/tv/Accused (US)/Season 1/Accused (US) - S01E01 - Scott's Story.mkv"' returned non-zero exit status 1.
10.0.0.2 - - [04/Jul/2023 17:32:33] "POST /webhook HTTP/1.1" 500 -

Tautulli Webhook:

JSON HEADERS { "source":"Tautulli" }

DATA: { "event": "played", "file": "{file}", "filename": "{filename}", "mediatype": "{media_type}" }

McCloudS commented 1 year ago

Without being able to replicate your setup... I would guess that your subgen container doesn't have the same paths/volumes mapped as your Plex server, so it can't find the files.

I never added checks to make sure the files exist before running, ought to add that when I have time...

Wh1t3Rose commented 1 year ago

See that was also my thought. But they are correct. You may remember me. I had opened a couple issues in the past and you were so helpful. I've changed nothing since then in the docker config but haven't had the container running in months.

Just spun it up today and that is what I get.

I decided to start fresh and used your container on dockerhub. Here are the logs from that.


WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:8090
 * Running on http://10.0.0.2:8090
Press CTRL+C to quit
Tautulli webhook received!
fullpath: /data/tv/Yellowstone (2018)/Season 1/Yellowstone (2018) - S01E01 - Daybreak.mkv
filepath: /data/tv/Yellowstone (2018)/Season 1
file name with no extension: Yellowstone (2018) - S01E01 - Daybreak
event: added
/data/tv/Yellowstone (2018)/Season 1/Yellowstone (2018) - S01E01 - Daybreak.mkv: No such file or directory
[2023-07-04 14:14:54,510] ERROR in app: Exception on /webhook [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/subgen.py", line 65, in receive_webhook
    if skipifinternalsublang in str(subprocess.check_output("ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 \"{}\"".format(fullpath), shell=True)):
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 "/data/tv/Yellowstone (2018)/Season 1/Yellowstone (2018) - S01E01 - Daybreak.mkv"' returned non-zero exit status 1.
10.0.0.2 - - [04/Jul/2023 14:14:54] "POST /webhook HTTP/1.1" 500 -

The paths are identical to what I have set in Radarr Sonarr, and Plex....

McCloudS commented 1 year ago

See that was also my thought. But they are correct. You may remember me. I had opened a couple issues in the past and you were so helpful. I've changed nothing since then in the docker config but haven't had the container running in months.

Just spun it up today and that is what I get.

I decided to start fresh and used your container on dockerhub. Here are the logs from that.


WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:8090
 * Running on http://10.0.0.2:8090
Press CTRL+C to quit
Tautulli webhook received!
fullpath: /data/tv/Yellowstone (2018)/Season 1/Yellowstone (2018) - S01E01 - Daybreak.mkv
filepath: /data/tv/Yellowstone (2018)/Season 1
file name with no extension: Yellowstone (2018) - S01E01 - Daybreak
event: added
/data/tv/Yellowstone (2018)/Season 1/Yellowstone (2018) - S01E01 - Daybreak.mkv: No such file or directory
[2023-07-04 14:14:54,510] ERROR in app: Exception on /webhook [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/subgen.py", line 65, in receive_webhook
    if skipifinternalsublang in str(subprocess.check_output("ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 \"{}\"".format(fullpath), shell=True)):
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 "/data/tv/Yellowstone (2018)/Season 1/Yellowstone (2018) - S01E01 - Daybreak.mkv"' returned non-zero exit status 1.
10.0.0.2 - - [04/Jul/2023 14:14:54] "POST /webhook HTTP/1.1" 500 -

The paths are identical to what I have set in Radarr Sonarr, and Plex....

Could be a permissions issue then... "/data/tv/Accused (US)/Season 1/Accused (US) - S01E01 - Scott's Story.mkv: No such file or directory"

Can you see the file in subgen using a shell and navigate manually?

Wh1t3Rose commented 1 year ago

Okay I am so embarrassed. The paths actually weren't completely identical to Plex. I am babysitting contractors today while doing this so I've got my mind everywhere right now haha.

I have it working again now. Thank you for the quick reply!!