Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z2M won´t start - required add-on configuration ‘data_path’ option is missing! #662

Open
kyrgorsh opened this issue Nov 29, 2024 · 10 comments

Comments

@kyrgorsh
Copy link

kyrgorsh commented Nov 29, 2024

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

@warlordattack
Copy link

warlordattack commented Dec 2, 2024

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

Capture d’écran 2024-12-02 à 10 49 53

Capture d’écran 2024-12-02 à 10 48 59

@dpgh947
Copy link

dpgh947 commented Dec 2, 2024

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?

@PABHudds
Copy link

PABHudds commented Dec 2, 2024

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)

@PABHudds
Copy link

PABHudds commented Dec 2, 2024

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

@PABHudds
Copy link

PABHudds commented Dec 2, 2024

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

@alainvdu69
Copy link

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 ?

@chocobidou
Copy link

Same here, my system is down

@spincrisis
Copy link

Here are the steps that I took in order to get my Z2M add-on back up and running:

  1. Install the HA Terminal add-on.
  2. Open the HA Terminal add-on.
  3. 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/"
  4. Return to the home directory:
    4.a) Issue the command: "cd .."
    4.b) Issue the command: "cd .."
  5. Copy the existing configuration folder to the new location:
    5.a) Issue the command: "cp -r config/zigbee2mqtt/ addon_configs/45df7312_zigbee2mqtt/zigbee2mqtt"
  6. Return to the Z2M add-on Configuration page and ensure the data_path is set to "/addon_config/zigbee2mqtt"
  7. Start the add on.

I hope this is helpful, please use extreme caution with these instructions!

@Nerivec
Copy link
Contributor

Nerivec commented Dec 2, 2024

Please see #664 (comment)

@kyrgorsh
Copy link
Author

kyrgorsh commented Dec 2, 2024

Solved with 1.42.0-2 addon. However default data_path setting still points to config/zigbee2mqtt. Release log is confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants