I’ve implemented the log reading (as with updates) and built an image.
I can’t test our specific case (because my dongle is up to date) but I’ll run some tests with other patterns in the logs.
The AI review gave some feedback about missing resets and I think the test coverage isn’t perfect. I’m looking into that.
Do you want to wait for the full PR or already deliver the first part (without the logs)?
@cicoub13 by the way I’m thinking, if the error is unknown, I think we can even display the « raw » error in the interface, that will prevent us from asking beginners to go check the logs
I pushed a new image that handles both known errors and unknown errors
I also changed the log reading to stream mode
I think the file readZ2mContainerLogs deserves a proper review with a clear head.
I will test tomorrow on a Raspberry Pi
@cicoub13 I just ran a test and I have this in the logs:
2026-02-25T08:33:23+0100 \u003cwarn\u003e readZ2mContainerLogs.js:97 (Zigbee2mqttManager.readZ2mContainerLogs) Zigbee2mqtt: failed to read container logs: stream.on is not a function
I updated and tested this morning on RPI. It looks like it’s working
I’m now listening asynchronously for 30 seconds with forward:true
If we encounter a known error (the ember firmware one), we stop listening and surface the error. Otherwise, we wait for the 30 seconds to finish and surface the last raw error in the frontend.
I couldn’t test the specific ember firmware case, but I generated other errors
We could imagine surfacing the first error for faster reactivity but it’s not very meaningful
[2026-02-25 10:31:08] error: z2m: Error while starting zigbee-herdsman
[2026-02-25 10:31:08] error: z2m: Failed to start zigbee-herdsman
[2026-02-25 10:31:08] error: z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions
[2026-02-25 10:31:08] error: z2m: Exiting...
[2026-02-25 10:31:08] error: z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR.
at EmberAdapter.initEzsp (/app/node_modules/.pnpm/zigbee-herdsman@7.0.4/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:666:19)
at EmberAdapter.start (/app/node_modules/.pnpm/zigbee-herdsman@7.0.4/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1539:24)
at Controller.start (/app/node_modules/.pnpm/zigbee-herdsman@7.0.4/node_modules/zigbee-herdsman/src/controller/controller.ts:143:29)
at Zigbee.start (/app/lib/zigbee.ts:70:27)
at Controller.start (/app/lib/controller.ts:101:13)
at start (/app/index.js:149:5)
I think this will really help newcomers to Gladys, beyond the Ember aspect Well done
Just one remark — couldn’t the error message be improved to indicate the different options: update the dongle’s firmware, or select the legacy ezsp driver?
Also, I tested something and I don’t understand why this happens: if I roll back to « ezsp » (I select the old driver + click save), I get this:
When changing the Dongle, the Z2M container is restarted (with the new configuration file) and not recreated.
So the logs still contain the previous errors and the containers are in an unstable state.
I pushed a commit and a Docker image to recreate the container in case of a Dongle change. I think that’s cleaner. I couldn’t test it in real life and I won’t be able to look at it tomorrow (Thursday).
Yes, I changed it to this “Warning: The firmware of your Ember coordinator is outdated. Version 7.4.x or higher is required. You can follow this guide to update it. Otherwise, select the dongle (legacy ezsp) in the configuration.”