Open RobReus opened 1 year ago
while minor, easily avoided. will look at adding in a check at some point after https://github.com/onedr0p/exportarr/pull/238 is merged
i adjusted the tests to take a bunch of empty json payloads, kept a series list so it would try for episodes and it didnt throw any errors. i don't think this is a reproducible as it seems.
Given how short the window for this to be an issue is id argue we just close (unless theres more info for reproduce?)
There's really two situations that would lead to this state:
In the latter case, a 5XX response is the expected handling in prometheus, as this indicates to prometheus that the scrape failed (A 5XX actually flops the up
metrics to 0). For the former case, we can just return if the response to the seriesId call is empty.
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: https://github.com/onedr0p/exportarr/blob/e732d200a9a7cac6f84e9e1f8f1faee74dcb5d58/internal/arr/collector/bazarr.go#L389
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:
And from the exportarr logs:
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.