Bazarr won't sync with Sonarr.
I run both in dockers on a WD PR4100, had no issues before and have tried to recreate both Sonarr and Bazarr.
Sonarr is working fine with other apps, like Ombi and Bazarr still works with Radarr.
None of the similar issues helps me.
Bazarr Version:
0.8.4.2
Sonarr Version
3.0.3.707
LOG:
Details
Message
BAZARR Error trying to get episodes from Sonarr. Timeout Error.
Exception
Traceback (most recent call last):
File "/app/bazarr/bazarr/../libs/urllib3/connectionpool.py", line 387, in _make_request
six.raise_from(e, None)
File "", line 2, in raise_from
File "/app/bazarr/bazarr/../libs/urllib3/connectionpool.py", line 383, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.8/http/client.py", line 1322, in getresponse
response.begin()
File "/usr/lib/python3.8/http/client.py", line 303, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.8/http/client.py", line 264, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/bazarr/bazarr/../libs/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/app/bazarr/bazarr/../libs/urllib3/connectionpool.py", line 640, in urlopen
retries = retries.increment(method, url, error=e, _pool=self,
File "/app/bazarr/bazarr/../libs/urllib3/util/retry.py", line 368, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/app/bazarr/bazarr/../libs/urllib3/packages/six.py", line 686, in reraise
raise value
File "/app/bazarr/bazarr/../libs/urllib3/connectionpool.py", line 600, in urlopen
httplib_response = self._make_request(conn, method, url,
File "/app/bazarr/bazarr/../libs/urllib3/connectionpool.py", line 389, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/app/bazarr/bazarr/../libs/urllib3/connectionpool.py", line 307, in _raise_timeout
raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host=192.168.1.102, port=8989): Read timed out. (read timeout=60)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/bazarr/bazarr/get_episodes.py", line 46, in sync_episodes
r = requests.get(url_sonarr_api_episode, timeout=60, verify=False)
File "/app/bazarr/bazarr/../libs/requests/api.py", line 75, in get
return request(get, url, params=params, *kwargs)
File "/app/bazarr/bazarr/../libs/requests/api.py", line 60, in request
return session.request(method=method, url=url, *kwargs)
File "/app/bazarr/bazarr/../libs/requests/sessions.py", line 533, in request
resp = self.send(prep, *send_kwargs)
File "/app/bazarr/bazarr/../libs/requests/sessions.py", line 646, in send
r = adapter.send(request, *kwargs)
File "/app/bazarr/bazarr/../libs/requests/adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host=192.168.1.102, port=8989): Read timed out. (read timeout=60)
Firewall issue? Try to use localhost or 127.0.0.1 maybe?
I'm using the local IP address and there's no firewall.
It's passing the Sonarr settings validation test.
And it looks like the sync is successful some of the time. I can see it has imported some of the episodes that were missing yesterday.
To me it looks like it's starts to sync the episodes, but very slowly. So at some point in the sync it gives an timeout error.

This is really a networking or operating system issue because Bazarr rely on Python that si relying on Operating System networking. Are you using bridge or host networking?
Bridge
In fact, this error means that Bazarr have been able to open a socket with Sonarr but Sonarr didn't send any data back after 60 seconds... Either your hardware is way too slow to support those piece of software or there's a bug in Sonarr that prevent it from answering. I would bet on the former.
Coud be related to this: https://forums.sonarr.tv/t/api-series-timeout-for-specific-tv-show/20886/8
Can you get the whole debug log and try to access those timed out url and see if they answer with your browser? You can provide the complete debug log and I can extract it for you.
Here is the debug log file.
bazarr.log
Ok so it's episodes endpoint of Sonarr API that is causing issue. To be honest, I have no idea what's is the issue. Did you take a look at Sonarr log to see if there's something wrong on their side at the same moment?
I'm not really sure what to look after.
Can you see anything?
I can't see anything on their side about dropping API call or something like this.
If they don't get the call at all, it's probably because the call is intercepted somewhere don't the path. Check your firewall and security software.
Ok, thank you for trying.
There is really no security software on my NAS.
It's just frustrating because everything worked just fine for about a month and the Radarr (Setup the same way as Sonarr) - Bazarr connection works just fine.
You can try with a previous image of Bazarr to confirm it's unrelated but other than that, I'm clueless.
Sonarr's API is notoriously slow when under any sort of load, especially if the application is busy doing a scan or similar. Your options are to either wait until Sonarr isn't doing anything, or modify Bazarr's code to increase the hardcoded 30/60s timeout.
When you have 30k+ episodes in Sonarr, it starts to chug a bit, especially on a slower backend (eg. Google Drive).
If you can't seem to get Sonarr's load down and you're okay with it taking a billion years to scan, you can modify the timeout:
find /app/bazarr/ -type f -name "*.py" | xargs sed -E -i 's/timeout=[0-9]{1,3}/timeout=600/g'
Note I have no idea how badly this may affect performance, and I daresay it won't be supported by morpheus ;)
Thanks for the suggestions. I'm pretty new to Linux and Docker. I only managed to set up the different apps once i got an GUI (Portainer) setup.
So i'm not sure how to pull a old image or change the docker in a command window.
But i would love if i could change the timeout time and how often Bazarr - Sonarr sync is running, in Bazarr.
Ideally i only want it to sync every 3 hours and have a long timeout time.
The frequency will be configurable in 0.9. As for the timeout, I don't plan to offer an option for that.
Thumbs up for the frequency.
About the timeout. Consider it a wish from my side. Maybe with a warning not to change it, unless you know what you're doing.
Could be an idea. I suggest you open a feature request for it on https://features.bazarr.media and we'll see how it get upvoted.
Most helpful comment
Firewall issue? Try to use localhost or 127.0.0.1 maybe?