morpheus65535 / bazarr

Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you.
https://www.bazarr.media
GNU General Public License v3.0
2.8k stars 218 forks source link

No connection with Radarr #1679

Closed escob4r85 closed 2 years ago

escob4r85 commented 2 years ago

I have Bazarr version 1.0.3 beta 9 running on an windows 10 PC. Since a few days the connection with Radarr is not working anymore. Radarr is running on the same machine with version 4.0.1.5813.

Not sure if its because of an update of Bazarr or Radarr, but i think it is related to a recent update because both are updated recently.

Message Job "Update Movie list from Radarr (trigger: interval[0:05:00], next run at: 2022-01-13 07:57:06 CET)" raised an exception

Exception Traceback (most recent call last):  File "c:\bazarr\bazarr\../libs\apscheduler\executors\base.py", line 125, in run_job   retval = job.func(*job.args, job.kwargs)  File "c:\bazarr\bazarr\get_movies.py", line 39, in update_movies   tagsDict = get_tags()  File "c:\bazarr\bazarr\get_movies.py", line 385, in get_tags   return tagsDict.json()  File "c:\bazarr\bazarr\../libs\requests\models.py", line 897, in json   return complexjson.loads(self.text, kwargs)  File "C:\Bazarr\WinPython\python-3.8.0\lib\json\init.py", line 357, in loads   return _default_decoder.decode(s)  File "C:\Bazarr\WinPython\python-3.8.0\lib\json\decoder.py", line 337, in decode   obj, end = self.raw_decode(s, idx=_w(s, 0).end())  File "C:\Bazarr\WinPython\python-3.8.0\lib\json\decoder.py", line 355, in raw_decode   raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

vysmaty commented 2 years ago

Bazarr: v1.0.3-beta.10 Radarr: 3.2.2.5080 Docker: linuxserver.io

Docker: Console

2022-01-15 20:48:35,631 - root                             (7f5c1556db38) :  INFO (signalr_client:40) - BAZARR trying to connect to Sonarr SignalR feed...

2022-01-15 20:48:35,632 - root                             (7f5c1546ab38) :  INFO (signalr_client:162) - BAZARR trying to connect to Radarr SignalR feed...

2022-01-15 20:48:35,632 - root                             (7f5c23146b48) :  INFO (server:37) - BAZARR is started and waiting for request on http://0.0.0.0:6767

2022-01-15 20:48:35,828 - root                             (7f5c15367b38) :  INFO (signalr_client:186) - BAZARR SignalR client for Radarr is connected and waiting for events.

2022-01-15 20:48:36,242 - root                             (7f5c1556db38) :  INFO (signalr_client:54) - BAZARR SignalR client for Sonarr is connected and waiting for events.

2022-01-15 20:48:54,730 - app                              (7f5c1a0cbb38) :  ERROR (app:1890) - Exception on /api/movies [GET]`

Exception on /api/movies [GET]

Traceback (most recent call last):

  File "/app/bazarr/bin/bazarr/../libs/flask/app.py", line 1949, in full_dispatch_request

    rv = self.dispatch_request()

  File "/app/bazarr/bin/bazarr/../libs/flask/app.py", line 1935, in dispatch_request

    return self.view_functions[rule.endpoint](**req.view_args)

  File "/app/bazarr/bin/bazarr/../libs/flask_restful/__init__.py", line 467, in wrapper

    resp = resource(*args, **kwargs)

  File "/app/bazarr/bin/bazarr/../libs/flask/views.py", line 89, in view

    return self.dispatch_request(*args, **kwargs)

  File "/app/bazarr/bin/bazarr/../libs/flask_restful/__init__.py", line 582, in dispatch_request

    resp = meth(*args, **kwargs)

  File "/app/bazarr/bin/bazarr/api/utils.py", line 30, in wrapper

    return actual_method(*args, **kwargs)

  File "/app/bazarr/bin/bazarr/api/movies/movies.py", line 32, in get

    postprocessMovie(item)

  File "/app/bazarr/bin/bazarr/api/utils.py", line 202, in postprocessMovie

    item[\'subtitles\'] = sorted(item[\'subtitles\'], key=itemgetter(\'name\', \'forced\'))

TypeError: \'<\' not supported between instances of \'NoneType\' and \'str\
morpheus65535 commented 2 years ago

Try to restart Radarr and make sure to not have any reverse proxy or anything else between Bazarr and Sonarr/Radarr.

escob4r85 commented 2 years ago

I tried a restart multiple times. The connection with Sonarr works. Radarr it does not work. I also renewed the api key of radarr and that did not help. I have LunaSea as an app connected to Radarr and that works via the API so it seems to be something with bazarr I think.

morpheus65535 commented 2 years ago

@escob4r85 In 1.0.3-beta.9, this isn't the content of line 385:

 File "c:\bazarr\bazarr\get_movies.py", line 385, in get_tags
  return tagsDict.json()

Any way, this means that Radarr is returning unparsable JSON from the tags API endpoint.

I've added a failsafe to skip tags if Radarr return improper JSON but it wont fix your issue. I also added exception logging if Radarr return an HTTPError.

morpheus65535 commented 2 years ago

Bazarr: v1.0.3-beta.10 Radarr: 3.2.2.5080 Docker: linuxserver.io

Docker: Console

2022-01-15 20:48:35,631 - root                             (7f5c1556db38) :  INFO (signalr_client:40) - BAZARR trying to connect to Sonarr SignalR feed...

2022-01-15 20:48:35,632 - root                             (7f5c1546ab38) :  INFO (signalr_client:162) - BAZARR trying to connect to Radarr SignalR feed...

2022-01-15 20:48:35,632 - root                             (7f5c23146b48) :  INFO (server:37) - BAZARR is started and waiting for request on http://0.0.0.0:6767

2022-01-15 20:48:35,828 - root                             (7f5c15367b38) :  INFO (signalr_client:186) - BAZARR SignalR client for Radarr is connected and waiting for events.

2022-01-15 20:48:36,242 - root                             (7f5c1556db38) :  INFO (signalr_client:54) - BAZARR SignalR client for Sonarr is connected and waiting for events.

2022-01-15 20:48:54,730 - app                              (7f5c1a0cbb38) :  ERROR (app:1890) - Exception on /api/movies [GET]`

Exception on /api/movies [GET]

Traceback (most recent call last):

  File "/app/bazarr/bin/bazarr/../libs/flask/app.py", line 1949, in full_dispatch_request

    rv = self.dispatch_request()

  File "/app/bazarr/bin/bazarr/../libs/flask/app.py", line 1935, in dispatch_request

    return self.view_functions[rule.endpoint](**req.view_args)

  File "/app/bazarr/bin/bazarr/../libs/flask_restful/__init__.py", line 467, in wrapper

    resp = resource(*args, **kwargs)

  File "/app/bazarr/bin/bazarr/../libs/flask/views.py", line 89, in view

    return self.dispatch_request(*args, **kwargs)

  File "/app/bazarr/bin/bazarr/../libs/flask_restful/__init__.py", line 582, in dispatch_request

    resp = meth(*args, **kwargs)

  File "/app/bazarr/bin/bazarr/api/utils.py", line 30, in wrapper

    return actual_method(*args, **kwargs)

  File "/app/bazarr/bin/bazarr/api/movies/movies.py", line 32, in get

    postprocessMovie(item)

  File "/app/bazarr/bin/bazarr/api/utils.py", line 202, in postprocessMovie

    item[\'subtitles\'] = sorted(item[\'subtitles\'], key=itemgetter(\'name\', \'forced\'))

TypeError: \'<\' not supported between instances of \'NoneType\' and \'str\

I made a small fix for this one too. Next time open your own issue.

escob4r85 commented 2 years ago

@escob4r85 In 1.0.3-beta.9, this isn't the content of line 385:

 File "c:\bazarr\bazarr\get_movies.py", line 385, in get_tags
  return tagsDict.json()

Any way, this means that Radarr is returning unparsable JSON from the tags API endpoint.

I've added a failsafe to skip tags if Radarr return improper JSON but it wont fix your issue. I also added exception logging if Radarr return an HTTPError.

@escob4r85 In 1.0.3-beta.9, this isn't the content of line 385:

 File "c:\bazarr\bazarr\get_movies.py", line 385, in get_tags
  return tagsDict.json()

Any way, this means that Radarr is returning unparsable JSON from the tags API endpoint.

I've added a failsafe to skip tags if Radarr return improper JSON but it wont fix your issue. I also added exception logging if Radarr return an HTTPError.

@morpheus65535 I noticed the issue with beta9 and in the meanwhile bazarr has been updates to beta10. Could that explain why the content does not match the line?

escob4r85 commented 2 years ago

@morpheus65535, Beta11 is now running and this what shown in the log.

Traceback (most recent call last):  File "c:\\bazarr\\bazarr\\../libs\\apscheduler\\executors\\base.py", line 125, in run_job   retval = job.func(*job.args, **job.kwargs)  File "c:\\bazarr\\bazarr\\get_movies.py", line 39, in update_movies   tagsDict = get_tags()  File "c:\\bazarr\\bazarr\\get_movies.py", line 385, in get_tags   return tagsDict.json()  File "c:\\bazarr\\bazarr\\../libs\\requests\\models.py", line 897, in json   return complexjson.loads(self.text, **kwargs)  File "C:\\Bazarr\\WinPython\\python-3.8.0\\lib\\json\\__init__.py", line 357, in loads   return _default_decoder.decode(s)  File "C:\\Bazarr\\WinPython\\python-3.8.0\\lib\\json\\decoder.py", line 337, in decode   obj, end = self.raw_decode(s, idx=_w(s, 0).end())  File "C:\\Bazarr\\WinPython\\python-3.8.0\\lib\\json\\decoder.py", line 355, in raw_decode   raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

and this error shows up when doing a Test in settings (i replaced my API key with ** in the last line, just show you know)

Exception on /test_url/http/127.***.***.***:7878/api/system/status?apikey=********5f [GET]

Traceback (most recent call last):  File "c:\\bazarr\\bazarr\\../libs\\flask\\app.py", line 2446, in wsgi_app   response = self.full_dispatch_request()  File "c:\\bazarr\\bazarr\\../libs\\flask\\app.py", line 1951, in full_dispatch_request   rv = self.handle_user_exception(e)  File "c:\\bazarr\\bazarr\\../libs\\flask_restful\\__init__.py", line 269, in error_router   return original_handler(e)  File "c:\\bazarr\\bazarr\\../libs\\flask\\app.py", line 1820, in handle_user_exception   reraise(exc_type, exc_value, tb)  File "c:\\bazarr\\bazarr\\../libs\\flask\\_compat.py", line 39, in reraise   raise value  File "c:\\bazarr\\bazarr\\../libs\\flask\\app.py", line 1949, in full_dispatch_request   rv = self.dispatch_request()  File "c:\\bazarr\\bazarr\\../libs\\flask\\app.py", line 1935, in dispatch_request   return self.view_functions[rule.endpoint](**req.view_args)  File "c:\\bazarr\\bazarr\\main.py", line 84, in wrap   return f(*args, **kwargs)  File "c:\\bazarr\\bazarr\\main.py", line 482, in test_url   return dict(status=False, error=result.raise_for_status())  File "c:\\bazarr\\bazarr\\../libs\\requests\\models.py", line 940, in raise_for_status   raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://127.0.0.1:7878/api/system/status?apikey=**

escob4r85 commented 2 years ago

What i also notice. The test URL that bazarr is trying to reach does not contain v3 api url. When i try to access it via Chrome it gives an ERR_CONNECTION_REFUSED. But when i add v3 after api/ in the url it works.

ERR_CONNECTION_REFUSED http://127.0.0.1:7878/api/system/status?apikey=**

URL where it return app info http://127.0.0.1:7878/api/v3/system/status?apikey=**

morpheus65535 commented 2 years ago

@morpheus65535 I noticed the issue with beta9 and in the meanwhile bazarr has been updates to beta10. Could that explain why the content does not match the line?

No, I've been back to 1.0.2 and it doesn match either.

morpheus65535 commented 2 years ago

Verify under what account the Bazarr service run in services.msc. Take a backup of your %programdata%/Bazarr directory that contain your configuration (just in case) and uninstall Bazarr. Download the latest installer and once installed, make sure to change the service account to what it was previously. Restart the service and you test again the connection to Radarr.

escob4r85 commented 2 years ago

@morpheus65535 this solved the problem. Thank you. Its running on the master branch. Whats your advice in this? Stay on master or go for develop?

morpheus65535 commented 2 years ago

I would like if you could switch to dev and confirm if it's still working. I suspect you had "corrupted" source files but just to be sure, you could switch and see.

escob4r85 commented 2 years ago

master gives an Oke if i use the test button. But when i run the task to sync movies it stills hows an exception. This is on the master branch. I am now going to try develop.

Traceback (most recent call last):

  File "c:\bazarr\bazarr\../libs\apscheduler\executors\base.py", line 125, in run_job

    retval = job.func(*job.args, **job.kwargs)

  File "c:\bazarr\bazarr\get_movies.py", line 81, in update_movies

    movies_to_update.append(movieParser(movie, action=\'update\',

  File "c:\bazarr\bazarr\get_movies.py", line 433, in movieParser

    audioCodec = RadarrFormatAudioCodec(audioFormat, audioCodecID, audioProfile,

  File "c:\bazarr\bazarr\get_movies.py", line 292, in RadarrFormatAudioCodec

    if audioFormat.strip() == "mp3": return "MP3"

AttributeError: \'NoneType\' object has no attribute \'strip\

escob4r85 commented 2 years ago

Updated to v1.0.3-beta.11 and now it seems to be running oke. Movies are synced succesfully. Thank you for helping out!

morpheus65535 commented 2 years ago

master gives an Oke if i use the test button. But when i run the task to sync movies it stills hows an exception. This is on the master branch. I am now going to try develop.

Traceback (most recent call last):

  File "c:\bazarr\bazarr../libs\apscheduler\executors\base.py", line 125, in run_job

    retval = job.func(*job.args, **job.kwargs)

  File "c:\bazarr\bazarr\get_movies.py", line 81, in update_movies

    movies_to_update.append(movieParser(movie, action='update',

  File "c:\bazarr\bazarr\get_movies.py", line 433, in movieParser

    audioCodec = RadarrFormatAudioCodec(audioFormat, audioCodecID, audioProfile,

  File "c:\bazarr\bazarr\get_movies.py", line 292, in RadarrFormatAudioCodec

    if audioFormat.strip() == "mp3": return "MP3"

AttributeError: 'NoneType' object has no attribute 'strip\

Yes the fix for this issue haven't been merged to master yet.

morpheus65535 commented 2 years ago

Updated to v1.0.3-beta.11 and now it seems to be running oke. Movies are synced succesfully. Thank you for helping out!

Godd! Keep me informed if you face this issue again.