home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.32k stars 30.63k forks source link

Matter integration not working #104921

Closed WeeXnes closed 11 months ago

WeeXnes commented 11 months ago

The problem

Ive tried installing and reinstalling the matter server add-on and the Matter integration multiple times, going as far as reinstalling my whole HomeAssistantOS, but whatever i do i always get the error "Failed Setup, will retry" i tried this on the latest stable and on the latest RC of HA

image

image

Matter Server Log:

2023-12-02 23:34:28 core-matter-server matter_server.server.stack[126] INFO Initializing CHIP/Matter Controller Stack...
[1701556468.332796][126:126] CHIP:CTL: Setting attestation nonce to random value
[1701556468.332953][126:126] CHIP:CTL: Setting CSR nonce to random value
[1701556468.333793][126:126] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_kvs
[1701556468.333938][126:126] CHIP:DL: writing settings to file (/tmp/chip_kvs-dXXRCH)
[1701556468.334019][126:126] CHIP:DL: renamed tmp file to file (/tmp/chip_kvs)
[1701556468.334112][126:126] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_factory.ini
[1701556468.334176][126:126] CHIP:DL: writing settings to file (/data/chip_factory.ini-Q9me8G)
[1701556468.334219][126:126] CHIP:DL: renamed tmp file to file (/data/chip_factory.ini)
[1701556468.334249][126:126] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_config.ini
[1701556468.334293][126:126] CHIP:DL: writing settings to file (/data/chip_config.ini-WrAOAK)
[1701556468.334338][126:126] CHIP:DL: renamed tmp file to file (/data/chip_config.ini)
[1701556468.334359][126:126] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_counters.ini
[1701556468.334445][126:126] CHIP:DL: writing settings to file (/data/chip_counters.ini-N9lXmL)
[1701556468.334487][126:126] CHIP:DL: renamed tmp file to file (/data/chip_counters.ini)
[1701556468.334636][126:126] CHIP:DL: writing settings to file (/data/chip_factory.ini-gxCWQH)
[1701556468.335088][126:126] CHIP:DL: renamed tmp file to file (/data/chip_factory.ini)
[1701556468.335109][126:126] CHIP:DL: NVS set: chip-factory/unique-id = "6ACE33E6AF9A101D"
[1701556468.335188][126:126] CHIP:DL: writing settings to file (/data/chip_factory.ini-0ptK0G)
[1701556468.335625][126:126] CHIP:DL: renamed tmp file to file (/data/chip_factory.ini)
[1701556468.335665][126:126] CHIP:DL: NVS set: chip-factory/vendor-id = 65521 (0xFFF1)
[1701556468.335748][126:126] CHIP:DL: writing settings to file (/data/chip_factory.ini-lCG50H)
[1701556468.336197][126:126] CHIP:DL: renamed tmp file to file (/data/chip_factory.ini)
[1701556468.336219][126:126] CHIP:DL: NVS set: chip-factory/product-id = 32769 (0x8001)
[1701556468.336353][126:126] CHIP:DL: writing settings to file (/data/chip_counters.ini-6kJWwI)
[1701556468.336665][126:126] CHIP:DL: renamed tmp file to file (/data/chip_counters.ini)
[1701556468.336685][126:126] CHIP:DL: NVS set: chip-counters/reboot-count = 1 (0x1)
[1701556468.336742][126:126] CHIP:DL: writing settings to file (/data/chip_counters.ini-KU0a9K)
[1701556468.337141][126:126] CHIP:DL: renamed tmp file to file (/data/chip_counters.ini)
[1701556468.337160][126:126] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0)
[1701556468.337287][126:126] CHIP:DL: writing settings to file (/data/chip_counters.ini-Ow67ZK)
[1701556468.337585][126:126] CHIP:DL: renamed tmp file to file (/data/chip_counters.ini)
[1701556468.337605][126:126] CHIP:DL: NVS set: chip-counters/boot-reason = 0 (0x0)
[1701556468.337666][126:126] CHIP:DL: writing settings to file (/data/chip_config.ini-oEGIfI)
[1701556468.338009][126:126] CHIP:DL: renamed tmp file to file (/data/chip_config.ini)
[1701556468.338028][126:126] CHIP:DL: NVS set: chip-config/regulatory-location = 0 (0x0)
[1701556468.338186][126:126] CHIP:DL: writing settings to file (/data/chip_config.ini-idQrgH)
[1701556468.338510][126:126] CHIP:DL: renamed tmp file to file (/data/chip_config.ini)
[1701556468.338544][126:126] CHIP:DL: NVS set: chip-config/location-capability = 2 (0x2)
[1701556468.338995][126:126] CHIP:DL: Got Ethernet interface: enp0s3
[1701556468.339161][126:126] CHIP:DL: Found the primary Ethernet interface:enp0s3
[1701556468.339620][126:126] CHIP:DL: Failed to get WiFi interface
[1701556468.339635][126:126] CHIP:DL: Failed to reset WiFi statistic counts
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] WARNING Initializing persistent storage from file: /data/chip.json
2023-12-02 23:34:28 core-matter-server root[126] ERROR [Errno 2] No such file or directory: '/data/chip.json'
2023-12-02 23:34:28 core-matter-server root[126] CRITICAL Could not load configuration from /data/chip.json - resetting configuration...
2023-12-02 23:34:28 core-matter-server root[126] WARNING No valid SDK configuration present - clearing out configuration
2023-12-02 23:34:28 core-matter-server root[126] WARNING No valid REPL configuration present - clearing out configuration
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO SetSdkKey: g/lkgt = b'\x15&\x00\x80\xa8\xbc,\x18'
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO Committing...
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO SetSdkKey: g/gcc = b'\xd4\xe5\xae\x0c'
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO Committing...
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO SetSdkKey: g/gdc = b'\x03\xad\xf0\r'
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO Committing...
2023-12-02 23:34:28 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vethf2acb14 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 23:34:28 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth4744cc2 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 23:34:28 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vethc7c439a for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 23:34:28 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vethfd124c6 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 23:34:28 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth182fa1f for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 23:34:28 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vethd3b948d for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 23:34:28 core-matter-server CertificateAuthorityManager[126] WARNING Loading certificate authorities from storage...
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO SetReplKey: caList = {'1': []}
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO Committing...
2023-12-02 23:34:28 core-matter-server CertificateAuthority[126] WARNING New CertificateAuthority at index 1
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO SetSdkKey: ExampleOpCredsCAKey1 = b'\x04G\x1di/\xa3f\x07\x8cB\xbf\xdd\xe8\x9a\xc0RZ\xbb\xfdo\xdfx\xe0\x12\xb4\xe4\xee\x9b\x85\xd3./\xbco\xe1R[Ce\xabJb\xfcwB\tJ\xf2\xc2J\xad\x01;w\x1b\xea\xe6\x06\x10Vh\xfd\xee,X\x98\xaf\xaf\x8a9Q\x8bK\xc6\x8f\xc4\x00\xee\x19*V1\x1e\xa8\xda\xe4}\xdd\x0c\x04?=L\xb4F\x17l'
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO Committing...
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO SetSdkKey: ExampleOpCredsICAKey1 = b'\x04\xfe\xe8\x88\x1d\xdfm\x0fn\xee\xbe\xd4\xcb`\x0eCN\x9e\xd5\xcfm\x0b\x85\x10\xe9ed\xe8]\x9a\x0c\xc6K\x0b\x03\x052\x93PL\xd5\xe0X\xa5\x8e\xf6\x1chR?\xa20\xd4\xb3i\x99\x85\x9a\xe1\xd9C\xe4\x14\xd7\xbf\xbf\x88g\xa4)\x0f\xb7\xd8\r\x1e\xa8%\xa9\x03\xd7\x03XZU\xe2\n\xb6\x0b\x85\x8a>\x1f\x17\xc1\x1a\xfbL'
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO Committing...
2023-12-02 23:34:28 core-matter-server FabricAdmin[126] WARNING New FabricAdmin: FabricId: 0x0000000000000002, VendorId = 0x134B
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO SetReplKey: caList = {'1': [{'fabricId': 2, 'vendorId': 4939}]}
2023-12-02 23:34:28 core-matter-server PersistentStorage[126] INFO Committing...
2023-12-02 23:34:28 core-matter-server matter_server.server.stack[126] INFO CHIP Controller Stack initialized.
2023-12-02 23:34:28 core-matter-server matter_server.server.server[126] INFO Starting the Matter Server...
2023-12-02 23:34:28 core-matter-server matter_server.server.helpers.paa_certificates[126] INFO Fetching the latest PAA root certificates from DCL.
/usr/local/lib/python3.11/site-packages/matter_server/server/helpers/paa_certificates.py:46: CryptographyDeprecationWarning: The parsed certificate contains a NULL parameter value in its signature algorithm parameters. This is invalid and will be rejected in a future version of cryptography. If this certificate was created via Java, please upgrade to JDK16+ or the latest JDK11 once a fix is issued. If this certificate was created in some other fashion please report the issue to the cryptography issue tracker. See https://github.com/pyca/cryptography/issues/8996 for more details.
  pem_certificate = x509.load_pem_x509_certificate(certificate.encode())
2023-12-02 23:34:39 core-matter-server matter_server.server.helpers.paa_certificates[126] INFO Fetched 115 PAA root certificates from DCL.
2023-12-02 23:34:39 core-matter-server matter_server.server.helpers.paa_certificates[126] INFO Fetching the latest PAA root certificates from Git.
2023-12-02 23:39:40 core-matter-server asyncio[126] ERROR Task exception was never retrieved
future: <Task finished name='Task-1' coro=<run.<locals>.new_coro() done, defined at /usr/local/lib/python3.11/site-packages/aiorun.py:209> exception=TimeoutError()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiorun.py", line 219, in new_coro
    await coro
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/server.py", line 94, in start
    await self.device_controller.initialize()
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/device_controller.py", line 94, in initialize
    await fetch_certificates()
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/helpers/paa_certificates.py", line 153, in fetch_certificates
    fetch_count += await fetch_git_certificates()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/helpers/paa_certificates.py", line 126, in fetch_git_certificates
    async with http_session.get(f"{GIT_URL}/{cert}.pem") as response:
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1167, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 493, in _request
    with timer:
  File "/usr/local/lib/python3.11/site-packages/aiohttp/helpers.py", line 725, in __exit__
    raise asyncio.TimeoutError from None
TimeoutError

What version of Home Assistant Core has the issue?

core-2023.11.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Matter

Link to integration documentation on our website

https://www.home-assistant.io/integrations/matter

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 11 months ago

Hey there @home-assistant/matter, mind taking a look at this issue as it has been labeled with an integration (matter) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `matter` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign matter` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


matter documentation matter source (message by IssueLinks)

marcelveldt commented 11 months ago

At startup, the Matter server needs to fetch the latest (dev/test) certificates from Github, used for device attestation. Looks like while you tried installing, either Github had a temporary outage or you are blocking access to Github ?

WeeXnes commented 11 months ago

At startup, the Matter server needs to fetch the latest (dev/test) certificates from Github, used for device attestation. Looks like while you tried installing, either Github had a temporary outage or you are blocking access to Github ?

I tried it again this morning and had the same result, so it's unlikely to be a github outage, and the only think in my network that could block something is my pihole but that wouldnt block any github access right?

pr0927 commented 11 months ago

Out of the blue I am having this problem today too - everything worked fine, but now it's giving me the same issue as what's pictured in the OP.

Absolutely nothing changed on my end, so I'm very puzzled.

My Thread hub/router is the Aqara M2 Hub, and using the app it appears totally fine and reachable in there (along with the smart lock which is associated to it).

WeeXnes commented 11 months ago

At startup, the Matter server needs to fetch the latest (dev/test) certificates from Github, used for device attestation. Looks like while you tried installing, either Github had a temporary outage or you are blocking access to Github ?

The issue lays in the matter server 5.0.0. I manually set up a matter server docker container on the 4.0.2, and it's working perfectly fine. In another issue realted to this problem you stated "you cant expect to update without having any issues" https://github.com/home-assistant-libs/python-matter-server/issues/442#issuecomment-1835907294 but this is clearly not an issue with updating. I tried this with multiple fresh installs and the issue is clearly that the 5.0.0 is not working properly. When a user downloads a software the way its ment to be and its nit working, its not the user whos to blame. Issue is on ur side, think you should have noticed that by the amount of down votes you got on ur comment.

WeeXnes commented 11 months ago

Out of the blue I am having this problem today too - everything worked fine, but now it's giving me the same issue as what's pictured in the OP.

Absolutely nothing changed on my end, so I'm very puzzled.

My Thread hub/router is the Aqara M2 Hub, and using the app it appears totally fine and reachable in there (along with the smart lock which is associated to it).

Got it working, issue is the non working 5.0.0 release of the matter server. U gotta manually setup the docker container for matter server 4.0.2 and it should be working again