alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.52k stars 214 forks source link

🐛 [qBittorrent] Running addon produces a HAOS full crash & restart #1594

Open diamant-x opened 2 weeks ago

diamant-x commented 2 weeks ago

Description

Hi,

Everytime I run qBittorrent addon, after some (variable, non precise) time my whole HAOS crashes and self-restarts. I have reduced that to the qBittorrent addon, with not sure reason why. It used to run just fine. I believe my problems started when HAOS upgraded their Python library https://github.com/home-assistant/core/issues/110538#issue-2134045723 which I thought was related to HAOS issue. But lately I've been doing some A/B testing and have re-assessed that the issue is down to qBittorrent (or Sonar, or Radar, which I run at the same time always). My HA full system error log file looks the same as in the original linked thread above.

I understand is not a common issues or this would be flooded of tickets, but would love to understand why, and if maybe the addon is using some old ha-utils or Python versions that makes it crash with latest HAOS versions?

Versión core-2024.9.3
Tipo de instalación Home Assistant OS
Desarrollo false
Supervisor true
Docker true
Usuario root
Entorno virtual false
Versión de Python 3.12.4
Familia del sistema operativo Linux
Versión del sistema operativo 6.6.31-haos-raspi
Arquitectura de la CPU aarch64

Reproduction steps

1. Normal stable running HAOS
2. Start qBittorrent addon (which uses smb mounted folders)
3. After some time (either 5 minutes or 5 hours) system will crash and reload.

Addon Logs

[custom-init] No custom files found, skipping...
crond: crond (busybox 1.36.1) started, log level 8
WebUI will be started shortly after internal preparations. Please wait...

******** Information ********
To control qBittorrent, access the WebUI at: http://localhost:8080

Connection to localhost (::1) 8080 port [tcp/http-alt] succeeded!
[ls.io-init] done.
[14:06:35] INFO: Starting NGinx...
nginx: [warn] the "http2_push_preload" directive is obsolete, ignored in /etc/nginx/servers/ingress.conf:17
crond: USER root pid 1629 cmd run-parts /etc/periodic/15min
crond: USER root pid 2886 cmd run-parts /etc/periodic/15min

Architecture

aarch64

OS

HAos

alexbelgium commented 1 week ago

Hi, I experienced the same but only once. I tried reducing the amount of accepted connections from the qBittorrent settings and it seems stable since! Or it was a coincidence, but worth testing

diamant-x commented 1 week ago

I'm trying to apply you suggestion. I also cleaned up my list. But I think there's something else. I saw my HAOS RAM usage chart creepingly increasing when the torrent addon is running, but the RAM usage reported by the addon is stable, which means it might be using some "core OS" processes for some of its stuff.

Example, whole HA OS RAM:, last 24h: image QBit addon reported RAM: image

EDIT: Just to document it so that's clear the relationship one to the other. I jsut restarted the addon and new RAM data: HAOS: image Addon: image

alexbelgium commented 6 days ago

Very interesting, nicely seen ! Alas I'm not sure how to use this info to solve the issue... Any ideas?

alexbelgium commented 6 days ago

Mmh there seems to be a reported memory leak on the core also, not necessarily linked but at least coincidental https://github.com/home-assistant/core/issues/123831

alexbelgium commented 6 days ago

Globally it seems that for each ha memory leak I've seen do far the solution is just to restart the add-on everyday :) https://github.com/coder/code-server/issues/5201

alexbelgium commented 6 days ago

OK it's confirmed to be due to qbittorrent itself it seems : https://github.com/qbittorrent/qBittorrent/issues/21502

diamant-x commented 6 days ago

OK it's confirmed to be due to qbittorrent itself it seems : qbittorrent/qBittorrent#21502

It does seem to be that in regards to. The memory leak indeed. Nice finding thanks! I might try to roll back to pre v5, although is a pain in the a* to do it because emy backup location contains a lot of files

However I do recall the haos crashes also happened before v5.