martabal / qbittorrent-exporter

A fast and lightweight prometheus exporter for qBittorrent
MIT License
20 stars 1 forks source link

Exporter unhealthy after several days #79

Open llaumgui opened 2 weeks ago

llaumgui commented 2 weeks ago

Hi,

I have an issue, that need to restart exporter each 2 or 3 days:

qbittorrent-exporter (version dev)
Author: martabal
Using log level: DEBUG
[2024-10-08 10:26:49] INFO qbittorrent URL: https://xxxxxxxxxxxxxxx/yyyyy/qbittorrent
[2024-10-08 10:26:49] INFO username: yyyyy
[2024-10-08 10:26:49] INFO password: **************
[2024-10-08 10:26:49] INFO Started
[2024-10-08 10:26:49] DEBUG Trackers info is enabled
[2024-10-08 10:26:49] DEBUG New cookie for auth stored
[2024-10-08 10:26:49] INFO Starting the exporter
[2024-10-08 14:13:35] DEBUG Get "https://xxxxxxxxxxxxxxx/yyyyy/qbittorrent/api/v2/app/version": context deadline exceeded
[2024-10-08 14:13:35] DEBUG can't connect to qBittorrent
[2024-10-08 14:13:35] ERROR can't connect to qBittorrent
[2024-10-08 14:13:37] DEBUG Get "https://xxxxxxxxxxxxxxx/yyyyy/qbittorrent/api/v2/app/version": context deadline exceeded
[2024-10-08 14:13:37] DEBUG can't connect to qBittorrent
[2024-10-10 09:13:28] DEBUG Get "https://xxxxxxxxxxxxxxx/yyyyy/qbittorrent/qbittorrent/api/v2/app/version": context deadline exceeded
[2024-10-10 09:13:28] DEBUG can't connect to qBittorrent
[2024-10-10 09:13:28] ERROR can't connect to qBittorrent
[2024-10-10 09:13:37] DEBUG Get "https://xxxxxxxxxxxxxxx/yyyyy/qbittorrent/qbittorrent/api/v2/app/version": context deadline exceeded
[2024-10-10 09:13:37] DEBUG can't connect to qBittorrent
[2024-10-10 11:59:22] ERROR can't connect to qBittorrent
[2024-10-10 11:59:22] DEBUG Get "https://xxxxxxxxxxxxxxx/yyyyy/qbittorrent/qbittorrent/api/v2/app/version": context deadline exceeded
[2024-10-10 11:59:22] DEBUG can't connect to qBittorrent
[2024-10-10 22:09:16] ERROR Error code 502
[2024-10-10 22:09:16] DEBUG 502
[2024-10-11 08:44:16] DEBUG 
[2024-10-11 08:44:16] DEBUG unexpected end of JSON input
[2024-10-11 08:44:16] ERROR Error code 502
[2024-10-11 08:44:16] ERROR 502
[2024-10-11 08:44:16] ERROR 502
[2024-10-11 08:44:16] ERROR Can not unmarshal JSON for tracker

Exporter becomes unhealthy and need to restart to be healthy. Scrapper on Prometheus is down during the exporter was unhealthy.

martabal commented 2 weeks ago

Hello 👋

The exporter reports errors because it can't connect to your qbittorrent server (error 502) or qbittorrent takes too long to respond. If you are using nginx as a reverse proxy, I guess nginx sends back error 502 because it can't connect to qbittorrent

llaumgui commented 2 weeks ago

Yes, I know. But is it possible that exporter be resilient ?

martabal commented 2 weeks ago

Not really. The exporter is already supposed to get back to normal when qbittorrent is up and running