hassio-addons / addon-unifi

UniFi Network Application - Home Assistant Community Add-ons
https://addons.community
MIT License
276 stars 137 forks source link

Add-on seems to cause HA crash #503

Closed Vinisz closed 3 months ago

Vinisz commented 6 months ago

Problem/Motivation

With the plugin enabled, HA crashes every night at 2:00 AM exactly, with add-on disabled, HA stays stable, is there something like a maintanance routine in Unifi which can cause this ?

Expected behavior

Normal running add-on without HA crashes

Actual behavior

HA crashing every night at 2:00 AM with add-on enabled

Steps to reproduce

Enable add-on, HA will crash every night

Proposed changes

Provide workaround to keep add-on running (maybe change some unifi config? ) or permanent fix

cfergeau commented 6 months ago

Maybe backups are triggered at that time? Does your hardware have enough memory for your HA + Unifi workload?

Vinisz commented 6 months ago

I run HA on an intel NUC I5 with 32Gb memory so yeah, I think that should be more then enough.. Backups are disabled in Unifi, so that can not be the case, I do see I have "automatisch device upgrades " enabled around that time, seems strange that that causes any issues but I disabled it now, let's see.

Vinisz commented 5 months ago

Add-on still crashes HA, even with "automatic device upgrades" disabled but I noticed it's not at 2:00 AM anymore but at a random time. I'll investigate some more and will post results here.

renewoensdregt commented 5 months ago

As mentioned before I suspect some kind of memory issue. Even if your NUC has enough memory, maybe the container doesn’t get or use all. Is strart tracking memory usage and see


From: Vinisz @.> Sent: Sunday, April 21, 2024 5:07:44 PM To: hassio-addons/addon-unifi @.> Cc: Subscribed @.***> Subject: Re: [hassio-addons/addon-unifi] Add-on seems to cause HA crash (Issue #503)

Add-on still crashes HA, even with "automatic device upgrades" disabled but I noticed it's not at 2:00 AM anymore but at a random time. I'll investigate some more and will post results here.

— Reply to this email directly, view it on GitHubhttps://github.com/hassio-addons/addon-unifi/issues/503#issuecomment-2068077758, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM63QKUGQHIMMS3TE25WDGTY6PI4BAVCNFSM6AAAAABGOWRC52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRYGA3TONZVHA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Vinisz commented 5 months ago

How can i track the memory usage or spot the memory leak ? Will there be an error/warning reported ? I already adjusted the "logging level" for the add-on but I don't see much of a difference.

There are however other errors reported like this:

:0 Permanent error code on channel bind request: 400 - Empty port number in channel bind request :0 All TURN channel bindings failed :0 Unable to read data from SCTP socket. Permanent error: (104) Connection reset by peer :0 SCTP ingest failed :0 SCTP ingest failed :0 Unable to do SSL I/O :0 webRtcId 1 terminated with code: (-2147090409) WebRTC connection interrupted from far side :0 Permanent error code on channel bind request: 400 - Empty port number in channel bind request :0 All TURN channel bindings failed

But I'm unsure if that is really the problem (it's not like the crash is happening directly after that error)

Vinisz commented 5 months ago

In the meantime, I assigned more memory to the add-on, however, after running for two days, it again crashed at exactly 02:00 AM. Logs still not saying much about a memory issue or something like that, still no idea what's going on

image

Vinisz commented 5 months ago

Any updates here ?

stryk3rr3al commented 5 months ago

I came here hoping someone had posted some kind of fix. I'm contemplating moving my Unifi controller off Home assistant.

Vinisz commented 5 months ago

latest update also does not help, still no information in the logging

Vinisz commented 4 months ago

Tried even more memory, does not help.. Also nothing clear in the logs on what the issue really is (memory was just a "guess" from dev) , I think I'm giving up on this and moving the Unifi controller away from HA (maybe onto dedicated RpI or something)

github-actions[bot] commented 3 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!