zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Migration 1.42.0 to 2.0.0 - AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value

Open thierryprats opened this issue 1 year ago • 15 comments

What happened?

Migration from 1.42.0 to 2.0.0 return this error :

Using '/app/data' as data directory
Starting Zigbee2MQTT without watchdog.
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  (0, node_assert_1.default)(result instanceof Object)

    at read (/app/lib/util/yaml.ts:24:15)
    at Object.readIfExists (/app/lib/util/yaml.ts:36:34)
    at readDevicesOrGroups (/app/lib/util/settings.ts:317:38)
    at read (/app/lib/util/settings.ts:325:5)
    at getPersistedSettings (/app/lib/util/settings.ts:393:21)
    at Object.reRead (/app/lib/util/settings.ts:640:5)
    at start (/app/index.js:130:14)

zigbee2mqtt runs on docker engine with SMLIGHT SLZB-06 CC2652P Ethernet mode.

About the adapter :

Radio Core
CPU model CC2652P ESP32-D0WD-V3
Firmware version 20240710 v2.3.6

Here is my configuration.yaml :

homeassistant: true
advanced:
  # log_level: debug
  network_key:
    - 237
    - 55
    - 91
    - 2
    - 144
    - 251
    - 253
    - 199
    - 30
    - 235
    - 159
    - 138
    - 203
    - 43
    - 133
    - 113
  pan_id: 41531
  ext_pan_id:
    - 123
    - 104
    - 250
    - 62
    - 90
    - 148
    - 1
    - 118
  homeassistant_legacy_entity_attributes: false
  homeassistant_legacy_triggers: false
  legacy_api: false
  legacy_availability_payload: false
  channel: 25
  last_seen: ISO_8601
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://mqtt:1883
  user: fake_user
  password: fake_password
serial:
  port: tcp://192.168.1.104:6638
  adapter: zstack
  baudrate: 115200
frontend:
  port: 8080
device_options:
  legacy: false
devices: devices.yaml
groups: groups.yaml
availability:
  active:
    timeout: 10
  passive:
    timeout: 1500

Here is my compose.yml :

services:
  zigbee2mqtt:
    image: koenkk/zigbee2mqtt:2.0.0
    container_name: z2m
    hostname: z2m
    restart: always
    networks:
      lan:
        ipv4_address: $IP_ADDR
    environment:
      - TZ=Europe/Paris
    volumes:
      - data:/app/data
    healthcheck:
      test: ["CMD", "nc", "-z", "localhost", "8080"]
      interval: 5s
      timeout: 10s
      retries: 5

volumes:
  data:
networks:
  lan:
    external: true

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

2.0.0

Adapter firmware version

20240710

Adapter

SMLIGHT SLZB-06 CC2652P Ethernet mode

Setup

docker compose

Debug log

No response

thierryprats avatar Jan 04 '25 03:01 thierryprats

스크린샷 2025-01-04 123617

keidischoi avatar Jan 04 '25 04:01 keidischoi

It seems that I am seeing more and more reports of the SLZB-06 no longer working with Z2M as of the 2.0.0-1 release and none of the typical fixes are working for anyone.

I have z2m: Error: network commissioning timed out - most likely network with the same panId or extendedPanId already exists nearby occurring now and nothing I do resolves it. I have tried different firmwares on the stick, I tried generating new IDs, adding new values, the legacy false settings in YAML, power cycling the stick... Nothing is working. This is very frustrating, was this release even tested on this stick by anyone?

cmdshft avatar Jan 04 '25 04:01 cmdshft

I am having the exact same error:

Using '/app/data' as data directory
Starting Zigbee2MQTT without watchdog.
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  (0, node_assert_1.default)(result instanceof Object)

    at read (/app/lib/util/yaml.ts:24:15)
    at Object.readIfExists (/app/lib/util/yaml.ts:36:34)
    at readDevicesOrGroups (/app/lib/util/settings.ts:317:38)
    at read (/app/lib/util/settings.ts:325:5)
    at getPersistedSettings (/app/lib/util/settings.ts:393:21)
    at Object.reRead (/app/lib/util/settings.ts:640:5)
    at start (/app/index.js:130:14)
version: "3.8"
services:
  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt:latest
    restart: unless-stopped
    network_mode: bridge
    ports:
      - 8124:8124
    environment:
      - TZ=America/New_York
    volumes:
      - ./data:/app/data
      - /run/udev:/run/udev:ro
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
permit_join: false
serial:
  port: /dev/ttyUSB0
  adapter: ember
frontend:
  port: 8124
mqtt:
  server: mqtt://172.17.0.1:1883
  user: -----------------
  password: -----------------
  base_topic: zigbee2mqtt
  include_device_information: true
homeassistant:
  discovery_topic: homeassistant
  legacy_entity_attributes: false
  legacy_triggers: false
advanced:
  log_level: info
  network_key: '!secret.yaml network_key'
  channel: 25
  homeassistant_legacy_entity_attributes: false
  homeassistant_legacy_triggers: false
  legacy_api: false
  legacy_availability_payload: false
device_options:
  legacy: false
devices: devices.yaml
groups: groups.yaml

I am using the Home Assistant Skyconnect; running on Ember.

I am using Inovelli VZM31-SN and VZM35-SN switches exclusively.

Jaxel avatar Jan 04 '25 10:01 Jaxel

same

anrada73 avatar Jan 04 '25 13:01 anrada73

Also having this issue but I'm on the SLZB-06M, firmware 20241127. Has anyone got a workaround for now or way to rollback?

My startup logs are:

[16:41:56] INFO: Preparing to start... [16:41:56] INFO: Socat not enabled [16:41:56] INFO: Starting Zigbee2MQTT... Starting Zigbee2MQTT without watchdog. [2025-01-04 16:41:57] error: zh:ember:uart:ash: Received ERROR from adapter while connecting, with code=ERROR_EXCEEDED_MAXIMUM_ACK_TIMEOUT_COUNT. [2025-01-04 16:42:28] error: zh:ember:uart:ash: Port Error: read ECONNRESET [2025-01-04 16:42:28] error: zh:ember: Adapter fatal error: ERROR_SERIAL_INIT [2025-01-04 16:42:28] error: z2m: Adapter disconnected, stopping [2025-01-04 16:42:28] error: z2m: Failed to call 'Frontend' 'stop' (TypeError: Cannot read properties of undefined (reading 'close') at /app/lib/extension/frontend.ts:132:52 at new Promise () at Frontend.stop (/app/lib/extension/frontend.ts:132:15) at processTicksAndRejections (node:internal/process/task_queues:105:5) at Controller.callExtensions (/app/lib/controller.ts:368:17) at Controller.stop (/app/lib/controller.ts:233:9) at Controller.onZigbeeAdapterDisconnected (/app/lib/controller.ts:260:9) at EventEmitter.wrappedCallback (/app/lib/eventBus.ts:204:17)) at EventEmitter.wrappedCallback (/app/lib/eventBus.ts:204:17))

jlmkerr avatar Jan 04 '25 17:01 jlmkerr

I figured out this issue... it comes from the following line in configuration.yaml

groups: groups.yaml

Because I have no groups, this file groups.yaml was EMPTY. So the declaration resolved to falsy. Just delete this line, and everything fixes itself.

Jaxel avatar Jan 05 '25 11:01 Jaxel

I figured out this issue... it comes from the following line in configuration.yaml

groups: groups.yaml

Because I have no groups, this file groups.yaml was EMPTY. So the declaration resolved to falsy. Just delete this line, and everything fixes itself.

It works! Thanks

XIIIX13 avatar Jan 05 '25 11:01 XIIIX13

I figured out this issue... it comes from the following line in configuration.yaml

groups: groups.yaml

Because I have no groups, this file groups.yaml was EMPTY. So the declaration resolved to falsy. Just delete this line, and everything fixes itself.

It works, thank you !

thierryprats avatar Jan 05 '25 12:01 thierryprats

Confirmed, this is the workaround, thanks!

Beware to specify the extra settings fro HA, without that it still didn't work

advanced:
  homeassistant_legacy_entity_attributes: false
  homeassistant_legacy_triggers: false
  legacy_api: false
  legacy_availability_payload: false
device_options:
  legacy: false

ElStupid avatar Jan 06 '25 12:01 ElStupid

Should this have been closed, some error handling / type checking would be quick, easy and helpful?

levexis avatar Jan 11 '25 09:01 levexis

Should this have been closed, some error handling / type checking would be quick, easy and helpful?

Agree!

lbird-mma avatar Jan 12 '25 02:01 lbird-mma

I figured out this issue... it comes from the following line in configuration.yaml

groups: groups.yaml

Because I have no groups, this file groups.yaml was EMPTY. So the declaration resolved to falsy. Just delete this line, and everything fixes itself.

just as me, many thanks, now upgrade works fine on homeassistant

WilliLz avatar Feb 05 '25 12:02 WilliLz

FYI, starting from a fresh install (2.11) but adding the line devices: devices.yaml gave the same error

JC38 avatar Feb 24 '25 20:02 JC38

is 'device.yaml' an empty file? if yes, I would first add a device and after working move it in 'device: device.yaml'

WilliLz avatar Feb 25 '25 07:02 WilliLz

Yes, device.yaml was there but empty. I've removed the line in my configuration.yaml as I am not on site for now for enrolling any devices. Affter I'll enroll one, I will split the devices into their dedicated files. However, I think that the error that occurred with empty files like groups.yaml and devices.yaml could be handle with a piece of code. But unfortunately I don't have the skill for this.

JC38 avatar Feb 25 '25 11:02 JC38