Z2M suddenly does not start and can't get any good logs

I am running Zigbee2MQTT for years without much hiccups. Lately, though, the whole system came crumbling down. In the log I only see three lines:

[21:00:58] INFO: Preparing to start...
[21:00:58] INFO: Socat not enabled
[21:01:00] INFO: Starting Zigbee2MQTT...

but it doesn’t actually succeed in starting. The log is obviously not very helpful, but I can’t figure out how to get more details of what is going on. I already have zigbee2mqtt/configuration.yaml expanded with log=debug but either I am too stupid to find the output or there isn’t any :person_shrugging: :frowning:

data_path: /config/zigbee2mqtt
socat:
  enabled: false
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: true
mqtt: {}
serial:
  port: /dev/ttyUSB0
advanced:
  log_level: debug
  log_directory: /homeassistant/zigbee2mqtt/log/%TIMESTAMP%
  log_file: log.txt
  log_rotation: true
  log_output:
    - console
    - file

Apart from the advanced section the configuration worked for months. I am running Hassio in Virtualbox. The last week HomeAssistant kept freezing, which seems to have been due to Z2M but I have no proof as again there were zero logs for anything indicating what was happening. The freezes seem to have gone away after upgrading to Z2M 1.37.0-1 from 1.36.1-1, where it now doesn’t start at all. As I had automatic updates on, I don’t know whether the freezes coincide with a previous update, as said it could also have been something else.

I don’t know how to debug this without more details of what is going on. config/zigbee2mqtt/log does not have new log directories, the last one is from before the upgrade to 1.37.0-1.

Does anybody know how to get more insight into what is going on here? Or possible how to fix it?

P.S.: Some version details:

  • Adapter: zzh! CC2652R Multiprotocol RF Stick (bought in 2020)
  • Coordinator firmware version: ‘{“meta”:{“maintrel”:1,“majorrel”:2,“minorrel”:7,“product”:1,“revision”:20220219,“transportrev”:2},“type”:“zStack3x0”}’
  • HomeAssistant:
    • Core 2024.5.2
    • Supervisor 2024.05.1
    • Operating System 12.3
    • Frontend 20240501.1

P.S.: I also plugged the zigbee stick directly to the host to rule out damages to the USB extension cable). It is passed through correctly (if I unplug it, /dev/ttyUSB0 vanishes in Hassio).

So the advanced: section I added by switching to yaml mode for the addon configuration isn’t actually recognized. I have it in the zigbee2mqtt/configuration.yaml as well though (for ages, nothing new). Still, no logs.

In the meantime, I installed zigbee2mqtt-edge addon. This one does work mostly. It fails to communicate with my Osram Lightify ceiling lights, but all other lights work, and afaict so far so do all sensors and actuators. What’s also back is freezing of HomeAssistant, e.g. when stopping the addon I need to restart the VM :frowning:

After installing the VirtualBox Extension Pack (only had a really outdated version that was not used anymore), the freezes when stopping the zigbee2mqtt-edge add-on seem to be gone (for now, let’s hope the best). Osram lights are working as well, whether that’s coincidence or due to me putting the zzh-stick back on the extension cord + antenna I don’t know (at least one light was directly above it, so I would assume it should be easy to reach). The stable zigbee2mqtt add-on still is not working (same three log lines and then nothing).

Zigbee keeps the last 10* logs in config > zigbee2mqtt > log, so you can use the File Editor Addon in HA to view those.

*Not sure if this is the default number or whether I had increased it - the point is, you can find the full startup logs there.

Unfortunately there are no logs created at this location :frowning: The last one is from before the upgrade to 1.37.0-1.

Weird. So, no new logs even if you restart Z2M?

If that’s the case, I’m stumped. Might be a good time to copy the coordinator_backup.json, configuration.yaml and both database.db files & try to start over from scratch

Yes, no logs even if I restart (which I have done a few dozen times by now :wink: )

As the edge add-on is working, I’d rather avoid having to repair all my 50+ devices. One of the reasons why I haven’t tried updating the coordinator firmware yet, either.

You do know that you can’t run the edge & regular version at the same time using the same coordinator, right?

I know it’s a stupid question, but sometimes it’s the stupid stuff which gets you.

Either way, if the Edge version is working for you, I’d stick to that. You might have some unwanted behaviour due to it being essentially the dev branch, but you should be mostly fine.

PS - the 1.37.0-1 brought in a switch from ezsp to ember drivers, as well as changes to where the logs are saved.
I haven’t upgraded yet, but maybe the link will help find your logs and narrow down some troubleshooting options.

Obviously I am not running them at the same time (concurrently) :wink:

I am not using ember/ezsp but zstack (at least afaict, see p.s. in my initial post). As for the logs, I would not be surprised if the changes in 1.3.7 are the cause of logs not being available anymore, but from the changelog it reads like there should be more stuff in it (i.e., the -herdsman logs) rather than less. Bugs notwithstanding, of course.

Yep, just spotted that, sorry.

Like I said, I’m stumped. Trying to clutch at straws in the hope that something works for you

There was a bug in the logging. 1.37.1 is released with a fix.

2 Likes

Thanks, just popped up in my install and the update to 1.37.1 does indeed fix the problem (I suspect Fix logger crashing on restart by Nerivec · Pull Request #22565 · Koenkk/zigbee2mqtt · GitHub is the one that caused this for me - would explain the symptoms).