Skip to content

Bazarr: error when there are no series #244

@RobReus

Description

@RobReus

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions