Zigbee2MQTT fails to start after recent upgrade

Just upgraded to Home Assistant OS 5.11, supervisor-2021.02.6, core-2021.2.2.

Zigbee2MQTT add-on is now failing to start with the following error:
— begin log —
ERR!

code ELIFECYCLE
npm ERR! errno 1
npm

ERR!
[email protected] start: node index.js
npm
ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm

ERR!
A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-02-11T05_09_07_959Z-debug.log
2021-02-10T21:09:09: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2021-02-10T21:09:09: PM2 log: App [npm:0] starting in -fork mode-
2021-02-10T21:09:09: PM2 log: App [npm:0] online

[email protected] start /zigbee2mqtt-1.17.1
node index.js
Zigbee2MQTT:info 2021-02-10 21:09:10: Logging to console and directory: ‘/share/zigbee2mqtt/log/2021-02-10.21-09-10’ filename: log.txt
Zigbee2MQTT:info 2021-02-10 21:09:11: Starting Zigbee2MQTT version 1.17.1 (commit #1.17.1)
Zigbee2MQTT:info 2021-02-10 21:09:11: Starting zigbee-herdsman (0.13.59)
Zigbee2MQTT:error 2021-02-10 21:09:11: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-02-10 21:09:11: Failed to start zigbee
Zigbee2MQTT:error 2021-02-10 21:09:11: Exiting…
Zigbee2MQTT:error 2021-02-10 21:09:11: Error: Error while opening serialport ‘Error: Error: Operation not permitted, cannot open /dev/ttyS2’
at Znp. (/zigbee2mqtt-1.17.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:136:32)
at Generator.next ()
at /zigbee2mqtt-1.17.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:27:71
at new Promise ()
at __awaiter (/zigbee2mqtt-1.17.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:23:12)
at SerialPort. (/zigbee2mqtt-1.17.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:134:49)
at SerialPort._error (/zigbee2mqtt-1.17.1/node_modules/zigbee-herdsman/node_modules/@serialport/stream/lib/index.js:198:14)
at /zigbee2mqtt-1.17.1/node_modules/zigbee-herdsman/node_modules/@serialport/stream/lib/index.js:242:12
— end log —

The debug log in /root/.npm doesn’t exist (the .npm directory doesn’t even exist).

Another curiosity: As part of debugging protocol, I set Zigbee2MQTT “Start at boot” option to false and I still get this error on boot. I am surprised that the add-on still seems to be trying to run at boot.

Z2M cannot connect to your coordinator hardware or the hardware‘s path changed.

Also, use code formatting (<> icon), when including log output.

I get the same issue. It seems the deviceById names have changed.
I looked through the Hardware list in hassio and found it had been renamed to /dev/ttyACM0.
Updating the config to the new device name lets the system startup and report the devices, however, I can no longer interact with them.
I tried restoring, but that didn’t work.

Is anyone else having trouble?

I am not familiar with Home Assistant OS or the Supervisor or whatever keeps you from the underlying OS, but it is always better to use stable device paths at /dev/serial/by-id/…

I don’t see a /dev/serial directory in HA OS. I’ve also verified by looking at dmesg that I have the correct device. I’m running HA OS in VirtualBox with a Windows host.

I see another thread Udevd[529]: bind failed: Address in use where other people seem to be having similar issues with USB devices.

I find it odd that the add-on runs at boot even if I have it configured not to run at boot. That seems like a bug whether or not it is related to this issue.

I notice that /dev/ttyS2 is assigned to group audio, which seems odd to me. Shouldn’t it be tty?

If the group is wrong, that might explain this error in the log:

Zigbee2MQTT:error 2021-02-11 08:48:49: Error: Error while opening serialport 'Error: Error: Operation not permitted, cannot open /dev/ttyS2'

The CC2531 was exposed to the VirtualBox VM as a serial port instead of a USB device, which has worked fine up to now. This is why it showed up as /dev/ttyS2 instead of /dev/ttyACM0. My guess is that the udev rules must have changed recently which is why the group was set incorrectly (“audio” instead of “dialout”). I changed it to USB, it shows up as ACMO, and Zigbee2MQTT is happy again.

1 Like

I’ve had exactly the same problem. Using a USB device mapping instead of a Serial Port mapping (from the VM host) solved it for me too.

1 Like