-
-
Notifications
You must be signed in to change notification settings - Fork 45
Description
When bazarr contains no series, it will still try to fetch the episodes. This results in the episodes api endpoint returning a 404, and as a result, exportarr returns a 500 to prometheus when prometheus tries to scrape the metrics. I believe this is a bug, as it would be a perfectly acceptable scenario to have no series in bazarr at all.
The culprit is in this part:
exportarr/internal/arr/collector/bazarr.go
Line 389 in e732d20
params := client.QueryParams{"seriesid[]": ids} |
When no series are returned, the collector should not attempt to fetch the episodes (as there is nothing to fetch).
This is the error returned by exportarr /metrics when there are no series:
< HTTP/1.1 500 Internal Server Error
An error has occurred while serving metrics:
error collecting metric Desc{fqName: "bazarr_collector_error", help: "Error while collecting metrics", constLabels: {url="http://bazarr:6767"}, variableLabels: {}}: Failed to execute HTTP Request(http://bazarr:6767/api/episodes): Get "http://bazarr:6767/api/episodes": Received Client Error Status Code: 404
And from the exportarr logs:
2023-11-20T12:12:47.147+0100 INFO Sending HTTP request {"url": "http://bazarr:6767/api/system/health"}
2023-11-20T12:12:47.150+0100 INFO Sending HTTP request {"url": "http://bazarr:6767/api/system/status"}
2023-11-20T12:13:02.137+0100 INFO Sending HTTP request {"url": "http://bazarr:6767/api/series"}
2023-11-20T12:13:02.141+0100 INFO Sending HTTP request {"url": "http://bazarr:6767/api/episodes"}
2023-11-20T12:13:02.142+0100 ERROR Error getting episodes subtitles {"collector": "bazarr", "error": "Failed to execute HTTP Request(http://bazarr:6767/api/episodes): Get \"http://bazarr:6767/api/episodes\": Received Client Error Status Code: 404"}
As soon as you add sonarr to bazarr and it synced the series, it starts to work without problems.
Let me know if any other details are required.