Z2M won´t start - required add-on configuration ‘data_path’ option is missing!
Description of the issue
Hi I´m running HAOS and I’m using the default data_path of /config/zigbee2mqtt. Here’s my current Z2mqtt configuration:
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: false
mqtt:
server: mqtt://localhost:1883
user: mqttuser
password: password
serial:
port: >-
/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20230508112711-if00
adapter: ezsp
When I try to Start the add-on, it will not and the log is filled with repetitive errors:
INFO: Preparing to start...
ERROR: Something went wrong contacting the API
FATAL: A required add-on configuration option is missing!
FATAL: Please set a value for the 'data_path' option.
FATAL: If unsure, check the add-on manual for more information
Addon version
1.41.0-1
Platform
Core: 2024.11.3 Supervisor: 2024.11.4 Operating System: 13.2 Frontend: 20241106.2
Logs of the issue (if applicable)
No response
Today after updating Home Assistant, my zigbee2mqtt addon refused to start, after reading update notes i discovered that a have to do this in order to make it work again :
[Unreleased]
Zigbee2MQTT configuration is now by default stored in the addon specific configuration directory rather than the main config directory.
This is required for Home Assistant's backup functionality to work correctly.
New installations and installations using the default settings will automatically migrate to the new path, existing setups with custom settings will continue to work but need to be manually migrated to make use of Home Assistant's backups:
Stop the addon
Move the /mnt/data/supervisor/homeassistant/zigbee2mqtt folder to /mnt/data/supervisor/addon_configs/45df7312_zigbee2mqtt/zigbee2mqtt (for example using SSH/SMB or the File Explorer/VSCode addon)
Go to the addon config and change the data_path from /config/zigbee2mqtt to /addon_config/zigbee2mqtt
Start the addon
Mount addon specific configuration into the addon container (/addon_config)
1.42.0-1
What i did to make it work : -i have Visual Studio Code addon, so with the addon a added this paths : File > Add folder to workspace > /addon_configs -right clic > copy (on the folder /confi/zigbee2mqtt) -right clic on the folder /addon_configs/45df7312_zigbee2mqtt then Paste (copies zigbee2mqtt folder to 45df7312_zigbee2mqtt folder) -then go to zigbee2mqtt Addon > config > Paths and put this value there : /addon_config/zigbee2mqtt -then restart the zigbee2mqtt Addon -then the addon works well again
After doin this it started again.
Best regards :)
This is all very confusing, especially that "Unreleased" heading - what does that mean? That the automatic migration is still to come?
I just updated to 1.42.0-1, didn't think I had to do anything because (afaik) I'm an installation "using the default settings", the addon has restarted, everything is still where it was under /config, the new dir under addon_configs is there but empty (seems to have been created at the start of November), and everything is still working.
So I don't understand if I am supposed to do anything still, and also why some people's installs seem to break after installing this update but mine hasn't?
I have just updated to 1.42.0-1 and my setup is now broken. ZtoMQTT will not start. I can't use the suggested VS Code fix as I don't have a certificate installed so can't use clipboard functionality and I'm not confident enough to use Linux command line to move stuff around, so I think my option option is to roll back.
[2024-12-02 10:03:20] error: z2m: Error: No path provided and failed to auto detect path at Function.create (/app/node_modules/zigbee-herdsman/src/adapter/adapter.ts:107:23) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:133:24) 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)
I changed the data_path back to /config/zigbee2mqtt in the Zigbee2MQTT Configuration page and it works again, but this has to be a temporary fix until I can figure out how to move the configuration files. I don't know why I have faced this issue as AFAIK mine is just a 'standard' setup under HAOSS on a RaPi
Seems the clipboard warning was not the issue, pasting the config folder created a 2nd copy of zigbee2mqtt folder (with 'copy' appended to the name, so I needed to rename the first config folder before pasting the one on config:
Hi ! I confirm that with the lastest release of the addon (1.42.0-1) , the explanation texte "unreleased" is strange.
I use HA OS on a Blue hardware : i have nothing under /mnt
The text say to move to /addon_config**s/45df7312_zigbee2mqtt**/zigb2mqtt and after to change the data_path value to /addon_config/zigb2mqtt !
So, what to do ?
Same here, my system is down
Here are the steps that I took in order to get my Z2M add-on back up and running:
- Install the HA Terminal add-on.
- Open the HA Terminal add-on.
- Remove the destination folder 'zigbee2mqtt' in the /addon_configs/45df7312_zigbee2mqtt/ location: 3.a) Issue the command: "cd /addon_configs/45df7312_zigbee2mqtt/" 3.b) Issue the command: "rm -rf zigbee2mqtt/"
- Return to the home directory: 4.a) Issue the command: "cd .." 4.b) Issue the command: "cd .."
- Copy the existing configuration folder to the new location: 5.a) Issue the command: "cp -r config/zigbee2mqtt/ addon_configs/45df7312_zigbee2mqtt/zigbee2mqtt"
- Return to the Z2M add-on Configuration page and ensure the data_path is set to "/addon_configs/zigbee2mqtt"
- Start the add on.
I hope this is helpful, please use extreme caution with these instructions!
Please see https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/issues/664#issuecomment-2512758513
Solved with 1.42.0-2 addon. However default data_path setting still points to config/zigbee2mqtt. Release log is confusing.
Hi ! Since 2 or 3 days, MQTT suddenly fail. A few messages in the log, many auto restart, and works again ... Very strange. In the log :
[22:00:43] INFO: Preparing to start... [22:00:43] ERROR: Got unexpected response from the API: System is not ready with state: setup [22:00:43] FATAL: [22:00:43] FATAL: A required add-on configuration option is missing! [22:00:43] FATAL: [22:00:43] FATAL: Please set a value for the 'data_path' option. [22:00:43] FATAL: [22:00:43] FATAL: If unsure, check the add-on manual for more information. [22:00:43] FATAL: [22:00:46] INFO: Preparing to start... [22:00:46] ERROR: Got unexpected response from the API: System is not ready with state: setup [22:00:46] FATAL: [22:00:46] FATAL: A required add-on configuration option is missing! [22:00:46] FATAL: [22:00:46] FATAL: Please set a value for the 'data_path' option. [22:00:46] FATAL: [22:00:46] FATAL: If unsure, check the add-on manual for more information. [22:00:46] FATAL: [00:31:47] INFO: Preparing to start... [00:31:47] INFO: Socat not enabled [00:31:48] INFO: Starting Zigbee2MQTT...
I have the latest version of the addon, done the stuff for migrating the location of the config and i have :
solved it here just by inputting the device in the port field into configuration tab of the addon.
Getting the device real path is as easy as ls /dev/serial/by-id/
This gives you the full path of the device :
# ls /dev/serial/by-id/
usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_b41af6c06951ef11828a338ccc32aab1-if00-port0
Now you know the full path of your device, you just have to go to the port field of the z2m addon and type :
port: /dev/serial/by-id/<YOURDEVICEID>
In my case it s :
port: /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_b41af6c06951ef11828a338ccc32aab1-if00-port0
Here is the configuration of z2m yaml (for info):
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: false
mqtt: {}
serial:
port: >-
/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_b41af6c06951ef11828a338ccc32aab1-if00-port0
What is the reason? How to solve it?
Hello and happy new year i am a newby in HA and i am working for more than 2 weeks on the problem that my ZB2MQTT is still not starting after updating to 1.42.0-2. I checkt all the forums but cant find a solution. my \mnt folder is empty, but i have a folder \192.168.1.61\addon_configs\45df7312_zigbee2mqtt\zigbee2mqtt I copied all data from folder /homeassistant/zigbee2mqtt into this new folder. i changed data path in the addon to /addon_config/zigbee2mqtt
the addon will not start yet "Error while starting zigbee-herdsman" an i think that i made a foult in the data path. It is confusing my, that i dont understand the file structure in HA. for example I the HA file editor i have the folder "/homeassistant/zigbee2mqtt" In samba share on windows i see only the folder \config\zigbee2mqtt but no \homeassistant In win scp i have only two folders \media and \share This is totally confusing I also reinstalled the addon but also without success. Is there anybody who can help me to start the addon?
I dont want to move to ZHA now but i will, if i cant find a solution. I am totally stuck
Thanks much and best regards Andreas
Hi again,
i made an update to version 2.0.0.1 but without success ): Is there anybody who can help me to bring the addon in thre right direction ? Thanks much BR Andreas
2025-01-05 12:08:33] info: z2m: Logging to console, file (filename: log.log) [2025-01-05 12:08:33] info: z2m: Starting Zigbee2MQTT version 2.0.0 (commit #unknown) [2025-01-05 12:08:33] info: z2m: Starting zigbee-herdsman (3.2.1) [2025-01-05 12:08:33] info: zh:ember: Using default stack config. [2025-01-05 12:08:33] info: zh:ember: ======== Ember Adapter Starting ======== [2025-01-05 12:08:33] info: zh:ember:ezsp: ======== EZSP starting ======== [2025-01-05 12:08:33] info: zh:ember:uart:ash: ======== ASH Adapter reset ======== [2025-01-05 12:08:33] info: zh:ember:uart:ash: RTS/CTS config is off, enabling software flow control. [2025-01-05 12:08:33] info: zh:ember:uart:ash: Serial port opened [2025-01-05 12:08:33] info: zh:ember:uart:ash: ======== ASH starting ======== [2025-01-05 12:08:35] info: zh:ember:uart:ash: ======== ASH Adapter reset ======== [2025-01-05 12:08:35] info: zh:ember:uart:ash: ======== ASH starting ======== [2025-01-05 12:08:38] info: zh:ember:uart:ash: ======== ASH Adapter reset ======== [2025-01-05 12:08:38] info: zh:ember:uart:ash: ======== ASH starting ======== [2025-01-05 12:08:40] info: zh:ember:uart:ash: ======== ASH Adapter reset ======== [2025-01-05 12:08:40] info: zh:ember:uart:ash: ======== ASH starting ======== [2025-01-05 12:08:43] info: zh:ember:uart:ash: ======== ASH Adapter reset ======== [2025-01-05 12:08:43] info: zh:ember:uart:ash: ======== ASH starting ======== [2025-01-05 12:08:45] error: z2m: Error while starting zigbee-herdsman [2025-01-05 12:08:45] error: z2m: Failed to start zigbee-herdsman [2025-01-05 12:08:45] error: z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions [2025-01-05 12:08:45] error: z2m: Exiting... [2025-01-05 12:08:45] error: z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR. at EmberAdapter.initEzsp (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:670:19) at EmberAdapter.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1533:24) at Controller.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/controller.ts:136:29) at Zigbee.start (/app/lib/zigbee.ts:69:27) at Controller.start (/app/lib/controller.ts:142:13) at start (/app/index.js:161:5)
hi ! if you put the old value in 'data_path' (if you haven't removed the old folder ...), what happen ? Z2M start again or not ? if yes, check the access rights of the new folder.
here what i have now on my HA OS (on Blue Hardware)
Hi, thank you for answering. i have not removed the old folder after copy the Z2M and add on is not starting. i have the following files in the folder (screenshot win explorer)
i used your command in Terminal (i am not a linux professional) (screenshot terminal)
there are only 1files in blue with drwxr-xr-x the log file
how i can check the access rights ?
the access rights look fine. but it's strange : no devices.yaml ? you don't have any devices in your zigbee network before you make the dir copy ?
This is strange indeed. I have more than 10 devices for sure but no device.yaml. All devices are in the configuration.yaml in the Z2H directory.
I have still doubts that i copyed to the right directory, because diferent file editors are showing deferent paths.
To be sure i restored a add on backup from version 1.41.0.1, but the is no separate device.yaml. So i copyed again from /homeassistant/zigbee2mqtt in \addon_configs\45df7312_zigbee2mqtt\zigbee2mqtt It will not start ): Its also strange, that a deinstall and reinstall is not working . This is really a special addon. I had no similar problem in other HA apps
if have these lines at the start of Z2M config file : devices:
- devices.yaml
so, is not strange i have one on you not.
the old repository of my Z2M files where like you
now, it will be a good idea to past here your Z2M configuration.yaml (hide passwords if needed)
i really appreciate your help ! here my configuration.yaml. I hope it helps. I am close to give up and move to ZHA. It is the second time that Z2M add on is down and i need weeks to solve the problem. This should be easier. But i will never make an update when everything works well with this app.
homeassistant: enabled: true advanced: network_key: - 171 - 140 - 16 - 139 - 19 - 55 - 213 - 81 - 125 - 209 - 136 - 60 - 77 - 47 - 14 - 25 pan_id: 49290 ext_pan_id: - 27 - 94 - 59 - 230 - 108 - 203 - 7 - 106 mqtt: server: mqtt://core-mosquitto:1883 user: MQTTUSER password: *************** serial: port: >- /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231220103737-if00 adapter: ember baudrate: 115200 frontend: enabled: true port: 8099 device_options: {} devices: '0x00178801029b6a12': friendly_name: '0x00178801029b6a12' '0x001788010ccafb4f': friendly_name: '0x001788010ccafb4f' '0xc49886000006e4c4': friendly_name: Dachboden_1 '0xc4988600000664cd': friendly_name: Dachboden_2 '0x001788010ccaccb6': friendly_name: Küche Deckenlampe '0x0017880109964d8e': friendly_name: Küche Fenster links '0x0017880109957c78': friendly_name: Küche Fenster rechts '0x001788010d5aba68': friendly_name: Garderobe Licht '0x9c693700001f7882': friendly_name: Lampe E14 1 Chillecke '0xc4988600004bd161': friendly_name: Lampe E14 2 Chillecke '0x842712fffe3420b5': friendly_name: Sonoff Schalter WZ 1 '0x0017880102c43e7c': friendly_name: '0x0017880102c43e7c' '0x0cae5ffffed88411': friendly_name: Sonoff Schalter WZ 2 '0x90395efffe3fdb3e': friendly_name: Sonoff Router Schuppen '0x90395efffe25fba3': friendly_name: Sonoff Router Garderobe '0xb43522fffe1e5c5e': friendly_name: Sonoff Router Dachboden '0x001788010d5ac190': friendly_name: Hausnummer version: 4
in the log this message :
[2025-01-05 12:08:45] error: z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions [2025-01-05 12:08:45] error: z2m: Exiting... [2025-01-05 12:08:45] error: z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR.
have you check the url and read & done the tests near the "host_fatal_error" in the text ?
https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html#error-srsp-sys-ping-after-6000ms-for-zstack-or-host-fatal-error-for-emberznet
I have tried the copying of files into the new folder and still nothing. I have tried 1.42, 2.0 and continue to get the error
curl: (28) Failed to connect to supervisor port 80 after 134771 ms: Could not connect to server [13:30:02] ERROR: Something went wrong contacting the API [13:30:02] FATAL: [13:30:02] FATAL: A required add-on configuration option is missing! [13:30:02] FATAL: [13:30:02] FATAL: Please set a value for the 'data_path' option. [13:30:02] FATAL: [13:30:02] FATAL: If unsure, check the add-on manual for more information.
Thanks for the tip Alain, I hadn't thought of that. My adapter is correct. I have found /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231220103737-if00
But i will check firmware update of the sonoff stick tomorrow.
I try and keep you informed. Have an nice evening BR from Germany Andreas
new release of Z2M ... 2.0.0-2 Fix addon crashing on serialport open on certain systems (e.g. Rpi4) #25464
try it ...
Oh, man :) This was the solution. It worked immediately.
I am so happy i can´t tell you.
I updated the firmware of my Sonoff dongle E with ncp-uart-hw-v7.4.5.0-zbdonglee-115200.gbl file and i updated the add on to 2.0.0.2 and it works.
Thank you very much. I learned a lot from your input.
Have a good time, thank you and good luck ! Regards Andreas
Hi guys. I am still running 1.42.0-2 and plan to migrate to 2.0.0-2 version. Do I have to do the migration of my config files to new folder /addon_config/zigbee2mqtt from 'unreleased' release notes from previous version of add on ?
I did as some others did but also others did not so your mileage may vary
Important question is: is it required?
Yes