t0bst4r / home-assistant-matter-hub

Publish your Home-Assistant Instance using Matter.
Apache License 2.0
157 stars 10 forks source link

[Bug] Can not pair - "Cannot access fabric for unknown index" #158

Closed Der-WU closed 1 week ago

Der-WU commented 1 week ago

If i try to add it to alexa i get:

[ 2024-11-17T08:47:31.269Z ] [ INFO  ] [ matter.js / PaseServer                             ]: Received pairing request from udp://192.168.2.78:5541.
[ 2024-11-17T08:47:31.441Z ] [ INFO  ] [ matter.js / PaseServer                             ]: Session 50372 created with udp://192.168.2.78:5541.
[ 2024-11-17T08:47:31.448Z ] [ INFO  ] [ matter.js / InsecureSession                        ]: End insecure session insecure/14776241989947285107
[ 2024-11-17T08:47:31.456Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 6e88828736434b7290be32f796fdb0f3.generalCommissioning.armFailSafe online#634828e@0 expiryLengthSeconds: 80 breadcrumb: 1
[ 2024-11-17T08:47:31.521Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 6e88828736434b7290be32f796fdb0f3.generalCommissioning.setRegulatoryConfig online#6348296@0 newRegulatoryConfig: 2 countryCode: DE breadcrumb: 0
[ 2024-11-17T08:47:31.531Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 6e88828736434b7290be32f796fdb0f3.operationalCredentials.certificateChainRequest online#6348298@0 certificateType: 1
[ 2024-11-17T08:47:31.553Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 6e88828736434b7290be32f796fdb0f3.operationalCredentials.certificateChainRequest online#634829a@0 certificateType: 2
[ 2024-11-17T08:47:31.561Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 6e88828736434b7290be32f796fdb0f3.operationalCredentials.attestationRequest online#634829c@0 attestationNonce: c8fcd92ba990126d1a0657e933f7f0c404c3afb39ae82dcefe80c90c6a847032
[ 2024-11-17T08:47:41.737Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 6e88828736434b7290be32f796fdb0f3.operationalCredentials.csrRequest online#634829e@0 csrNonce: 80495e29da7097f476eedda9e5ce6de9911c9c2b05c9fa0349c30fb3477fe6c8
[ 2024-11-17T08:47:42.607Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 6e88828736434b7290be32f796fdb0f3.operationalCredentials.addTrustedRootCertificate online#63482a0@0 rootCaCertificate: 15300111008f7e89d8d67b0aecdeae6d212deaa3b724020137032714d894477fd1553601182604537ac72a2605e378cd5937062714d894477fd15536011824070124080130094104047302d8c1c429049055346a31cf2c7e62d7266a3ddeb60a854810d9a8d3ed50a2e90bb5f1fad51b29b727c153946b64718ae2422ea10dfc9b7db0cbc48164d4370a3501290118300414c6e675219d6a1ebb8e664f86d80fe11c3758b859240261300514c6e675219d6a1ebb8e664f86d80fe11c3758b85918300b40092a586ace30018a5fa614cca2c2b23c58ab6c75dc8e759f95a7ba13db97d84043b532505e0cf61c187d29c00f56f90a4952dfb195163d49bbb1f5402e52ad9818
[ 2024-11-17T08:47:42.621Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 6e88828736434b7290be32f796fdb0f3.operationalCredentials.addNoc online#63482a2@0 nocValue: 1530011100ed91f99021c018549dba8d9fdf54a19624020137032713ca58d7ee20f03f111826041e5ccc2e26052e6d98413706271572c27eb7b0c0ea032711e063ea4755bd10041824070124080130094104d2230e29d6158fb98beb518eecaf672f684f9a795c01cbc0c1f47ee8d7e81d0d1398d6ffe984dd61b772954e4fd0db3a52df8d1984575ed2766ae741fa51a8be370a3501280118300514514c32019ab2f61d57f8b4193a3226b835671e93300414e944f0d22355991036ac659b178a6c0382e570942402013603040204011818300b40fbae82870b73620e7532d97797174ebd9d55c6d3ce2790852016ead5b4c97d0b3f256987c84d0bd79391bc726a126a2eace926a33a7b73177f1ed60528f61a4b18 icacValue: 15300110067bfa076c59a9ef7b57dc5a8ebe753d24020137032714d894477fd15536011826043877942d2605487eca4937062713ca58d7ee20f03f1118240701240801300941048c626877d1ec37398162da1735ba69a3451698fd2f3b8120bac9e4373266eeab0550f79ec12e473fd44467fa8e397e8a52891f2fd21720262111392e87d22d31370a3501290124020018300514c6e675219d6a1ebb8e664f86d80fe11c3758b859300414514c32019ab2f61d57f8b4193a3226b835671e9324026118300b407eecd00c37e44dc8dcd3dddc57a93d8be0fc44df66c0b2d8539d05b16db05f452eaf63ecc8f40807f6da8ade5aa451076bad0e557705b2f014bff2fc0e36161e18 ipkValue: 8a53637b345c477ede058dee61a04b6c caseAdminSubject: 18446744060825763882 adminVendorId: 4631
[ 2024-11-17T08:47:42.629Z ] [ INFO  ] [ matter.js / DeviceCommissioner                     ]: Announce done fabric: 282249791889392242 fabricIndex: 5
[ 2024-11-17T08:47:42.647Z ] [ INFO  ] [ matter.js / Operationa~edentials                   ]: addNoc success, adminVendorId 4631, caseAdminSubject 18446744060825763882
[ 2024-11-17T08:47:42.650Z ] [ INFO  ] [ matter.js / AccessControlServer                    ]: ACL updated, updating ACL manager { fabricIndex: 1, privilege: 5, authMode: 2, subjects: [ 18446744060825763882 ], targets: null } { fabricIndex: 2, privilege: 5, authMode: 2, subjects: [ 18446744060825763885 ], targets: null } { fabricIndex: 3, privilege: 5, authMode: 2, subjects: [ 18446744060825763882 ], targets: null } { fabricIndex: 4, privilege: 5, authMode: 2, subjects: [ 18446744060825763882 ], targets: null } { fabricIndex: 5, privilege: 5, authMode: 2, subjects: [ 18446744060825763882 ], targets: null }
[ 2024-11-17T08:47:42.701Z ] [ INFO  ] [ matter.js / Behavior                               ]: Invoke 6e88828736434b7290be32f796fdb0f3.generalCommissioning.armFailSafe online#63482a4@0 expiryLengthSeconds: 0 breadcrumb: 1
[ 2024-11-17T08:47:42.703Z ] [ INFO  ] [ matter.js / FailsafeContext                        ]: Failsafe timer expired, Reset fabric builder.
[ 2024-11-17T08:47:42.726Z ] [ INFO  ] [ matter.js / SecureSession                          ]: Register Session secure/50372 to close when exchange is ended.
[ 2024-11-17T08:47:42.728Z ] [ ERROR ] [ matter.js / ServerNode~feContext                   ]: Unhandled error in [object AsyncConstruction] destructor: Cannot access fabric for unknown index 5
  at FabricManager.for (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/protocol/dist/esm/fabric/FabricManager.js:89:13)
  at ServerNodeFailsafeContext.rollback (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/protocol/dist/esm/common/FailsafeContext.js:186:33)
  at async file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/protocol/dist/esm/common/FailsafeContext.js:127:9
  at async ServerNodeFailsafeContext.close (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/protocol/dist/esm/common/FailsafeContext.js:123:5)
  at async #failSafeExpired (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/protocol/dist/esm/common/FailsafeContext.js:175:5)
  at async FailsafeTimer.expire (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/protocol/dist/esm/common/FailsafeTimer.js:52:5)
  at async FailsafeTimer.reArm (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/protocol/dist/esm/common/FailsafeTimer.js:44:7)
  at async ServerNodeFailsafeContext.extend (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/protocol/dist/esm/common/FailsafeContext.js:42:5)
  at async GeneralCommissioningServer.armFailSafe (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/node/dist/esm/behaviors/general-commissioning/GeneralCommissioningServer.js:36:9)
  at async CommandServer.invoke (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/protocol/dist/esm/cluster/server/CommandServer.js:38:22)
[ 2024-11-17T08:47:42.756Z ] [ INFO  ] [ matter.js / ExchangeManager                        ]: Exchange with index 114087 to delete not found or already deleted.
[ 2024-11-17T08:47:42.756Z ] [ INFO  ] [ matter.js / SecureSession                          ]: End PASE session secure/50372

Any solution what i am doing wrong?

t0bst4r commented 1 week ago

I've never seen this error before. Which port did you use for your bridge?

@Apollon77 did you see this error before?

Apollon77 commented 1 week ago

I can check but in fact this is just a side effect of an unfinished commissioning process. Commissioning went ok. It then it seems that the controller did not saw the operative announcement. And so the failings timer expired after defined wait time.

The exception just happened because the temporary added fabric was already removed as session was closed. Cool edge cases.

So when the question is why the commission did not work the answer is the above:: seems like the controller did not received the MDNS announcement. So check UDP routing. But I will also fix the error above.

Apollon77 commented 1 week ago

Aahhh wait. Nooo it is no MDNS topic. Sorry. I was wrong. The controller ended the process from his side (arm failings with 0 is cancelling in the end) ... so which controller was it?

But still the error is not the error listed but the fact that the controller cancelled the process.

But that's a completely new behavior with Alexa.

Der-WU commented 1 week ago

Okay. I think I found the reason. I have got 258 entities. It is to much for Alexa.