Thanks for the feedback, I actually heard back from the maintainer of matter-js and there is indeed a bug in the library’s autoConnect: true parameter.
He published a fix here :
And he gave me a workaround in the meantime to fix the issue!
I’ll keep you posted as soon as I have a new functional and tested build
Alright, I made a new PR this morning, and indeed with autoConnect working, it changes everything — I was able to remove 50% of the code I had written for this migration
A new build is available under a new tag:
gladysassistant/gladys:upgrade-matter-latest
I took the opportunity to make a few practical improvements:
1/ In the logs, warning messages when a device has not yet been added to Gladys are now displayed on a single line, at the « info » log level, because it’s not an error per se but just a warning:
2/ Refreshing the Matter device list, being sometimes a long operation on large Matter networks containing unavailable devices, I made this operation non-blocking for Gladys startup to avoid lengthening Gladys’s startup time.
There may be remnants due to my various tests.
Otherwise I would need to completely remove matter and start from scratch by integrating matterbridge as if I were starting from an installation with the latest stable version of Gladys and then use upgrade-matter-latest
Thanks for the test and the logs, that helps me a lot!
You have a device that is unreachable and, as a result, it breaks the rest of the integration. I’m adding code so that won’t be the case, and I’ll make a build for you
Quick question: which architecture are you testing on: amd64 or arm64? ARM builds take longer, so if it’s amd64 I’ll do an amd64 Docker build only — it saves time
The error is quite clear, it’s a bug in the matter.js library!
2026-03-23 11:20:33.533 ERROR ClientNode [internal] Unsupported async initialization detected when loading known peer
at ClientNode.initialize (/src/server/services/matter/node_modules/@matter/node/src/node/ClientNode.ts:101:19)
at ClientNode.[construct] (/src/server/services/matter/node_modules/@matter/node/src/endpoint/Endpoint.ts:896:21)
at initializer (/src/server/services/matter/node_modules/@matter/general/src/util/Construction.ts:289:80)
at invokeInitializer (/src/server/services/matter/node_modules/@matter/general/src/util/Construction.ts:598:30)
at Construction.start (/src/server/services/matter/node_modules/@matter/general/src/util/Construction.ts:290:17)
at Factory.create (/src/server/services/matter/node_modules/@matter/node/src/node/client/Peers.ts:495:27)
at Peers.initialize (/src/server/services/matter/node_modules/@matter/node/src/node/client/Peers.ts:108:25)
at ServerNode.get peers [as peers] (/src/server/services/matter/node_modules/@matter/node/src/node/ServerNode.ts:168:29)
at ChangeNotificationService.#beginPeerObservation (/src/server/services/matter/node_modules/@matter/node/src/node/integration/ChangeNotificationService.ts:112:27)
at /src/server/services/matter/node_modules/@matter/node/src/node/integration/ChangeNotificationService.ts:35:50
at BasicObservable.emit (/src/server/services/matter/node_modules/@matter/general/src/util/Observable.ts:377:26)
at NodeLifecycle.change (/src/server/services/matter/node_modules/@matter/node/src/endpoint/properties/EndpointLifecycle.ts:226:32)
at onReady (/src/server/services/matter/node_modules/@matter/node/src/endpoint/properties/Behaviors.ts:264:38)
at ServerNode.initialize (/src/server/services/matter/node_modules/@matter/node/src/node/ServerNode.ts:188:9)
2026-03-23T11:20:33+0100 \u003cwarn\u003e service.start.js:44 (Service.start) Unable to start service matter [crashed-dependency] MatterController unavailable due to initialization error
at crashedError (/src/server/services/matter/node_modules/@matter/general/src/util/Construction.ts:623:32)
at handleRejection (/src/server/services/matter/node_modules/@matter/general/src/util/Construction.ts:325:69)
Caused by: [crashed-dependency] matter-controller-data.peer2 initialization failed
at Object.assertActive (/src/server/services/matter/node_modules/@matter/general/src/util/Lifecycle.ts:48:23)
at Construction.assert (/src/server/services/matter/node_modules/@matter/general/src/util/Construction.ts:298:23)
at Behaviors.#backingFor (/src/server/services/matter/node_modules/@matter/node/src/endpoint/properties/Behaviors.ts:736:41)
at Object.get [as commissioning] (/src/server/services/matter/node_modules/@matter/node/src/endpoint/properties/Behaviors.ts:799:32)
at ClientNode.maybeStateOf (/src/server/services/matter/node_modules/@matter/node/src/endpoint/Endpoint.ts:225:22)
at Peers.get (/src/server/services/matter/node_modules/@matter/node/src/node/client/Peers.ts:184:46)
at MatterController.#migrateNodeData (/src/server/services/matter/node_modules/@project-chip/matter.js/src/MatterController.ts:695:45)
at /src/server/services/matter/node_modules/@project-chip/matter.js/src/MatterController.ts:399:17
I’ve sent the error to the maintainer, I’ll keep you posted
I’m reposting my message here as a reminder, the maintainer of matter.js is asking me for an archive of your matter folder (/var/lib/gladysassistant/matter in Gladys), this will allow him to replay the migration and see what’s crashing in your case.
Hi @pierre-gilles
I just tested your latest build and I have some improvement on my Matter integration.
First, I can see the matterbridge node again in the Matter settings!
My Somfy blinds are shown as disconnected. I was able to « recover » them via sharing one of the blinds from Apple Home on iOS: I entered the sharing code and then my devices went to Mettre à jour (which I applied) but control isn’t working (not a big deal for now).
Then I tried to reintegrate my SONOFF switch (which still doesn’t appear in the Matter nodes): sharing the code from HA, adding it in Gladys and problem:
Do you have the Gladys logs from when the container started?
This version of Matter.js introduces quite a few breaking changes and starts a file migration. Maybe, like @prohand, you encountered errors during that migration, which could have led to the loss of your devices?
You really don’t see them anywhere? Not even in « Settings » -\u003e « Matter Nodes » ?
No news! I just pinged him again; it’s been a week.
If needed, we’ll create a GitHub issue on the matter.js side.
Ok, did you get any particular logs when you launched the container for the first time? In the latest version of Matter.js, there is a file migration, and that might have failed. If you have the logs, I can forward them to the Matter.js maintainer!
Well, I took the bull by the horns and tried to fix the bug myself
The maintainer really helped me identify the problem, and we think we found it!
I opened a PR on the Matter.js repo:
I will also backport the fix to the 0.16.x version so we can benefit from it quickly, without waiting for the release of 0.17, which is not planned for about two weeks.