Unable to add a Matter device - HA companion app 'hangs'

@wmaker @peterxian

Thanks for the pointers. I have removed the Thread integration from my HA (not needed at present, so keep things simple). I also found how to view the matter server logs (it uses the container logging, obviously. doh!). Both my container (HA and matter-server) are using ‘host’ networking. I have verified that mDNS works fine on the Linux system hosting the containers and when in pairing mode the device shows up (under _matterc._udp.local) in the HA zeroconf browser. So that seems okay. However after restarting the matter server and then trying the pairing again this is what I see in the matter server logs…

2025-06-28 07:59:15.570 (MainThread) INFO [matter_server.server.stack] Initializing CHIP/Matter Logging...
2025-06-28 07:59:15.570 (MainThread) INFO [matter_server.server.stack] Initializing CHIP/Matter Controller Stack...
[1751093955.580470][1:1] CHIP:CTL: Setting attestation nonce to random value
[1751093955.580548][1:1] CHIP:CTL: Setting CSR nonce to random value
[1751093955.580867][1:1] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_kvs
[1751093955.581404][1:1] CHIP:DL: Wrote settings to /tmp/chip_kvs
[1751093955.581480][1:1] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_factory.ini
[1751093955.581519][1:1] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_config.ini
[1751093955.581531][1:1] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_counters.ini
[1751093955.581896][1:1] CHIP:DL: Wrote settings to /data/chip_counters.ini
[1751093955.581903][1:1] CHIP:DL: NVS set: chip-counters/reboot-count = 10 (0xA)
[1751093955.581976][1:1] CHIP:DL: Got Ethernet interface: enp0s5
[1751093955.581998][1:1] CHIP:DL: Found the primary Ethernet interface:enp0s5
[1751093955.582029][1:1] CHIP:DL: Failed to get WiFi interface
[1751093955.582033][1:1] CHIP:DL: Failed to reset WiFi statistic counts
2025-06-28 07:59:15.582 (MainThread) INFO [chip.storage] Initializing persistent storage from file: /data/chip.json
2025-06-28 07:59:15.582 (MainThread) INFO [chip.storage] Loading configuration from /data/chip.json...
2025-06-28 07:59:15.604 (MainThread) INFO [chip.CertificateAuthority] Loading certificate authorities from storage...
2025-06-28 07:59:15.604 (MainThread) INFO [chip.CertificateAuthority] New CertificateAuthority at index 1
2025-06-28 07:59:15.604 (MainThread) INFO [chip.CertificateAuthority] Loading fabric admins from storage...
2025-06-28 07:59:15.604 (MainThread) INFO [chip.FabricAdmin] New FabricAdmin: FabricId: 0x0000000000000001, VendorId = 0xFFF1
2025-06-28 07:59:15.604 (MainThread) INFO [matter_server.server.stack] CHIP Controller Stack initialized.
2025-06-28 07:59:15.604 (MainThread) INFO [matter_server.server.server] Starting the Matter Server...
2025-06-28 07:59:15.605 (MainThread) INFO [matter_server.server.helpers.paa_certificates] Skip fetching certificates (already fetched within the last 24h).
2025-06-28 07:59:15.605 (MainThread) INFO [chip.FabricAdmin] Allocating new controller with CaIndex: 1, FabricId: 0x0000000000000001, NodeId: 0x000000000001B669, CatTags: []
**2025-06-28 07:59:15.636 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:421: OS Error 0x02000065: Network is unreachable**
2025-06-28 07:59:15.638 (MainThread) INFO [matter_server.server.vendor_info] Loading vendor info from storage.
2025-06-28 07:59:15.639 (MainThread) INFO [matter_server.server.vendor_info] Loaded 327 vendors from storage.
2025-06-28 07:59:15.639 (MainThread) INFO [matter_server.server.vendor_info] Fetching the latest vendor info from DCL.
2025-06-28 07:59:15.795 (MainThread) INFO [matter_server.server.vendor_info] Fetched 326 vendors from DCL.
2025-06-28 07:59:15.795 (MainThread) INFO [matter_server.server.vendor_info] Saving vendor info to storage.
2025-06-28 07:59:15.796 (MainThread) INFO [matter_server.server.device_controller] Loaded 0 nodes from stored configuration
2025-06-28 07:59:15.799 (MainThread) INFO [matter_server.server.server] Matter Server successfully initialized.
2025-06-28 08:01:51.835 (MainThread) INFO [matter_server.server.device_controller] Starting Matter commissioning with code using Node ID 35.
**2025-06-28 08:02:21.841 (Dummy-2) CHIP_ERROR [chip.native.CTL] Discovery timed out**
2025-06-28 08:02:45.674 (Dummy-2) CHIP_ERROR [chip.native.EM] <<5 [E:45326i with Node: <0000000000000000, 0> S:0 M:34078560] (U) Msg Retransmission to 0:0000000000000000 failure (max retries:4)
2025-06-28 08:02:55.451 (Dummy-2) CHIP_ERROR [chip.native.SC] PASESession timed out while waiting for a response from the peer. Expected message type was 33
2025-06-28 08:03:47.452 (Dummy-2) CHIP_ERROR [chip.native.EM] <<5 [E:45327i with Node: <0000000000000000, 0> S:0 M:34078561] (U) Msg Retransmission to 0:0000000000000000 failure (max retries:4)
2025-06-28 08:03:59.063 (Dummy-2) CHIP_ERROR [chip.native.SC] PASESession timed out while waiting for a response from the peer. Expected message type was 33
2025-06-28 08:04:51.612 (Dummy-2) CHIP_ERROR [chip.native.EM] <<5 [E:45328i with Node: <0000000000000000, 0> S:0 M:34078562] (U) Msg Retransmission to 0:0000000000000000 failure (max retries:4)
2025-06-28 08:05:02.674 (Dummy-2) CHIP_ERROR [chip.native.SC] PASESession timed out while waiting for a response from the peer. Expected message type was 33
2025-06-28 08:05:56.318 (Dummy-2) CHIP_ERROR [chip.native.EM] <<5 [E:45329i with Node: <0000000000000000, 0> S:0 M:34078563] (U) Msg Retransmission to 0:0000000000000000 failure (max retries:4)
2025-06-28 08:06:06.285 (Dummy-2) CHIP_ERROR [chip.native.SC] PASESession timed out while waiting for a response from the peer. Expected message type was 33

and then this just repeats for a long time until it finally gives up. Two lines stand out to me as concerning (the ‘failed to advertise’ and ‘Discovery timed out’ errors). Do you see similar lines in your log when things are working? I suspect that for some reason the matter-server (only) maybe has an issue with mDNS discovery (but that is just a guess).