Z2M Errors on Start - JS out of memory

Hi Folks,

On start Z2M fails to start properly, some Z2M devices work fine but things like temperature sensors and lightbulbs don’t. Z2M log shows the below after restart. The controller is a CC2531 s below:

Any help appreciated. I just wonder if the controller is failing?

ttyACM0
/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B001CCC433C-if00


[11:35:30] INFO: Preparing to start…

[11:35:30] INFO: Socat not enabled

[11:35:31] INFO: Starting Zigbee2MQTT…

Starting Zigbee2MQTT without watchdog.

[2024-11-10 11:49:53] error: zh:controller:device: Handling of poll check-in from 0x38398ffffeec651a failed (ZCL command 0x38398ffffeec651a/1 genPollCtrl.checkinRsp({“startFastPolling”:false,“fastPollTimeout”:0}, {“timeout”:10000,“disableResponse”:false,“disableRecovery”:false,“disableDefaultResponse”:false,“direction”:0,“reservedBits”:0,“writeUndiv”:false,“sendPolicy”:“immediate”}) failed (Timeout - 11061 - 1 - 57 - 32 - 11 after 10000ms))

<— Last few GCs —>

[7:0x7fb8b39590] 13845082 ms: Mark-Compact 2043.0 (2089.4) → 2039.2 (2089.6) MB, 5006.62 / 0.00 ms (average mu = 0.130, current mu = 0.034) allocation failure; scavenge might not succeed

[7:0x7fb8b39590] 13849881 ms: Mark-Compact 2043.2 (2089.6) → 2039.4 (2089.9) MB, 4295.86 / 0.00 ms (average mu = 0.118, current mu = 0.105) allocation failure; scavenge might not succeed

<— JS stacktrace —>

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

----- Native stack trace -----

What hardware are you running Z2M on?

And how (e.g. as HA add-on)?

Hi, thanks for the reply.

RPi4 8Gb. Zigbee2MQTT Add-On. Everything up-to-date, and issues started with October update of core, but would fix themselves on reboot. But that doesn’t happen now.

Just noticed that the green LED on the CC2531 turns off after re-seating, as it was also off, I think it may be on its last legs? Yes/No?

It’s old and no longer recommended so a newer coordinator is not a bad idea anyhow.

3 Likes

I thought so, my HA has been running for many years. Upgrade time! Thanks folks!

I can recommend these: https://tubeszb.com/

A network attached coordinator gives you a lot of flexibility for placement compared to a USB version.

1 Like

Thanks Tom, one for a future upgrade that. :grinning:

So bought a Sonoff 3.0, and still having issues. Z2M now says, as below, any ideas?

[11:55:46] INFO: Preparing to start…
[11:55:47] INFO: Socat not enabled
[11:55:47] INFO: Starting Zigbee2MQTT…
Starting Zigbee2MQTT without watchdog.
[2024-11-17 11:56:17] error: z2m: Error while starting zigbee-herdsman
[2024-11-17 11:56:17] error: z2m: Failed to start zigbee
[2024-11-17 11:56:17] error: z2m: Check Zigbee2MQTT fails to start | Zigbee2MQTT for possible solutions
[2024-11-17 11:56:17] error: z2m: Exiting…
[2024-11-17 11:56:17] error: z2m: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:113:27)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:137:29)
at Zigbee.start (/app/lib/zigbee.ts:69:27)
at Controller.start (/app/lib/controller.ts:161:27)
at start (/app/index.js:154:5)


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: false

base_topic: zigbee2mqtt
server: mqtt://core-mosquitto:1883
user: xxxx
password: xxxx

port: >-
/dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_52ab09bd8a38ef11a4d1357af3d9b1e5-if00-port0

FYI for port also tried: ttyUSB1, but same issues.

There are two different versions of this, E and P. If you have the E you need to add the correct driver and make sure it is updated.

serial:
    adapter: ember
2 Likes

Thanks, will see what happens…

Jeepers lol, that was a challenge, couldn’t get connected to the dongle by most of the methods online (YouTube) to perform the upgrade. However, following this guide (https://www.youtube.com/watch?v=x1QeNPi6tK8) I successfully upgraded to Ember.

Unfortunately, I am getting the exact same errors.

Any suggestions folks? Thank you.

Can you show your current configuration.yaml (under the zigbee2mqtt folder)? Remember to format it correctly.

Hi, weird one, the adaptor in the config file was different than the config on the add-on. Changed it but no difference. Config as below, I can’t see any glaring error though.

external_converters: []
devices:
  - devices.yaml
groups:
  - groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://localhost'
  user: xxxx
  password: xxxx
serial:
  port: /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B001CCC433C-if00
advanced:
  log_level: warn
  pan_id: 6754
  channel: 25
  network_key:
    - 1
    - 3
    - 5
    - 7
    - 9
    - 11
    - 13
    - 15
    - 0
    - 2
    - 4
    - 6
    - 8
    - 10
    - 12
    - 13
  availability_blocklist: []
  availability_passlist: []
  log_syslog:
    app_name: Zigbee2MQTT
    eol: /n
    host: localhost
    localhost: localhost
    path: /dev/log
    pid: process.pid
    port: 514
    protocol: udp4
    type: '5424'
device_options: {}
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental: {}
availability: false

Seems you haven’t added

serial:
    adapter: ember

In your case that would be

serial:
  port: /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B001CCC433C-if00
  adapter: ember

Right will check, its contained within the add-on config though, no idea why it’s not there… Will update and see what happens.

Thanks for the support.

Nope! lol… Log as follows:

[10:26:43] INFO: Preparing to start...
[10:26:43] INFO: Socat not enabled
[10:26:44] INFO: Starting Zigbee2MQTT...
Starting Zigbee2MQTT without watchdog.
[2024-11-18 10:26:53] error: 	z2m: Error while starting zigbee-herdsman
[2024-11-18 10:26:53] error: 	z2m: Failed to start zigbee
[2024-11-18 10:26:53] error: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-11-18 10:26:53] error: 	z2m: Exiting...
[2024-11-18 10:26:53] error: 	z2m: Error: [BACKUP] Current backup file is not for EmberZNet stack.
    at EmberAdapter.getStoredBackup (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1161:23)
    at EmberAdapter.initTrustCenter (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:937:29)
    at EmberAdapter.initEzsp (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:726:18)
    at EmberAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1598:24)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:137:29)
    at Zigbee.start (/app/lib/zigbee.ts:69:27)
    at Controller.start (/app/lib/controller.ts:161:27)
    at start (/app/index.js:154:5)

There’s the error. Try renaming or removing the backup file.

1 Like

Hi, so I removed database.db.backup from config/zigbee2mqtt, but now Z2M has got even worse.

It’s dead Jim!

Any suggestions folks… This is all I get on the log.

v[15:10:28] INFO: Preparing to start...
[15:10:28] INFO: Socat not enabled
[15:10:29] INFO: Starting Zigbee2MQTT...
Starting Zigbee2MQTT without watchdog.

It’s not dead though, is it? Can you see the GUI? As the FAQ states when you change your coordinator from a CC2531 to a Ember one you need to re-pair all the devices.

Ah ha, yep that’s working - right I will start and see what happens.

Thanks!