home-assistant-libs / python-matter-server

Python server to interact with Matter
Apache License 2.0
485 stars 76 forks source link

Reliability regression from 5.0.1 to stable #476

Closed Xploder closed 10 months ago

Xploder commented 10 months ago

Hey, this one took a while to figure out.

I've tried matter together with a ESP32 example firmware (so just WiFi) as an UnRAID Docker. While everything worked fine when adding the device to Alexa and there were absolutely no reliability issues, when adding it to Home-Assistant using the latest stable version I get a super unstable experience after just a couple of seconds. Because of the finnicky IPV6 setup I've first started trying different Hosts, so I've spun up the docker on multiple other host machines (Arch VM, UbuntuServer VM, Raspberry Pi 3 running Raspbian 12) with the same outcome.

This was with current stable and the version before that.

It was when I tried HAOS on a VM when it started working and I thought it had something to do with kernel/networkmanager patches in this distribution. Turns out the HAOS addon was still using an older version 5.0.1.

So I've tried this version on one of the other hosts and it worked! Guess there has been a regression somewhere in between?! I'd love to help troubleshoot this.

Logs with current stable: https://pastebin.com/EAFpB0z4

Logs with 5.0.1 https://pastebin.com/mVy5g8rU

lineumaciel commented 10 months ago

You have the same problem as me. Up to version 5.0.3 I had no problems. Since version 5.1.0 I have been experiencing the same symptoms as you. In my case, as the log shows:

2023-12-27 10:56:20 server root[1] INFO Re-subscription succeeded! 2023-12-27 10:56:20 server matter_server.server.device_controller.[node 4][1] INFO Re-Subscription succeeded 2023-12-27 10:56:24 server chip.DMG[1] ERROR Subscription Liveness timeout with SubscriptionID = 0x5d7d5d76, Peer = 01:0000000000000001 2023-12-27 10:56:24 server matter_server.server.device_controller.[node 1][1] INFO Previous subscription failed with Error: 50, re-subscribing in 0 ms... 2023-12-27 10:56:26 server root[1] INFO Re-subscription succeeded! 2023-12-27 10:56:26 server matter_server.server.device_controller.[node 1][1] INFO Re-Subscription succeeded 2023-12-27 10:56:32 server chip.DMG[1] ERROR Subscription Liveness timeout with SubscriptionID = 0xfe5c792d, Peer = 01:0000000000000004 2023-12-27 10:56:32 server matter_server.server.device_controller.[node 4][1] INFO Previous subscription failed with Error: 50, re-subscribing in 0 ms... 2023-12-27 10:56:33 server chip.DMG[1] ERROR Subscription Liveness timeout with SubscriptionID = 0xebe5dabb, Peer = 01:0000000000000004 2023-12-27 10:56:33 server matter_server.server.device_controller.[node 4][1] INFO Previous subscription failed with Error: 50, re-subscribing in 0 ms... 2023-12-27 10:56:35 server matter_server.server.device_controller.[node 4][1] INFO Previous subscription failed with Error: 1408, re-subscribing in 6464 ms... 2023-12-27 10:56:35 server root[1] INFO Re-subscription succeeded!

Due to the fact that I have a non-standard installation (working without problems until version 5.0.3), I will look for help on Discord.

The guys have a lot on their plate and I fully understand their attitude about not supporting installation types other than the official one.

Xploder commented 10 months ago

Can confirm that 5.0.3 works aswell.

marcelveldt commented 10 months ago

5.0.1 was a very flaky version which we should have fixed with 5.0.3. Can you please also test with version 5.1.1 please ?

Xploder commented 10 months ago

Hey Marcel, my "stable version" logs from the original post are from version 5.1.1.

Best regards

marcelveldt commented 10 months ago

I can reproduce the situation here, I'm looking at a fix.

lineumaciel commented 10 months ago

Hi

I'm not asking for a solution because I know your answer (HA/openthread/matter on Docker) ;-), but maybe the logs will help (someone else). The problems appeared only after moving from version 5.0.3 (no problems so far) to version 5.1.1.

I have included logs from both versions (level: info).

logs 5.1.1: https://pastebin.com/v0dc1WPZ logs: 5.0.3 https://pastebin.com/ixT7yXGg

Device: EVE Energy plug