yllibed / Zigbee2MqttAssistant

GUI for Zigbee2Mqtt running in docker and HASS.IO
447 stars 43 forks source link

[BUG]Unable to connect to MQTT server mqtt #363

Closed shuttenbah closed 3 years ago

shuttenbah commented 3 years ago

Describe the bug

To Reproduce

Steps to reproduce the behavior:

  1. Add the following repository url in HASS.IO: https://github.com/yllibed/hassio
  2. Install Zigbee2Mq2ttAssistant
  3. Configure credentials for MQTT server and press save.
  4. Due to starting i see in log (pic.1): warn: Zigbee2MqttAssistant.Services.SettingsService[0] Section 'settings' in configuration does not exists. Will use default settings instead. Hosting environment: Production Content root path: /app Now listening on: http://[::]:80 Application started. Press Ctrl+C to shut down. warn: Zigbee2MqttAssistant.Services.MqttConnectionService[0] Unable to connect to MQTT server mqtt. Web UI showing - Status Bridge State: offline (pic.2)

Expected behavior

Steps I took to try resolve the problem

I tried to remove Zigbee2MqttAssistant, Zigbee2Mqtt, MQTT integration and install again. But it did not help. I have same error.

Screenshots

pic.1 image pic.2 image

Installation

Pertinent logs

Additional context

shuttenbah commented 3 years ago

UPD. Seems to settings do not save when i am pressing save. image image I put settings into appsettings.json and restart container. And Zigbee2Mq2ttAssistant successfully started. image image image But after restart add-on settings empty again.

carldebilly commented 3 years ago

The user configuration coming from HASS.IO can be found in /data/options.json.

In Z2MA, it's configured there: https://github.com/yllibed/Zigbee2MqttAssistant/blob/7b1877a40d9d37c5a18e33632ecf85e6eda09a95/Zigbee2MqttAssistant/Program.cs#L22

shuttenbah commented 3 years ago

Thank you for replying. I insert setting and press save: image But /data/options.json is still empty: image

carldebilly commented 3 years ago

To be honest, I don't know what this could be, but for sure, it's a HASS.IO issue, not in Z2MA. Do you think it's something caused by a recent version of HASS.IO?

shuttenbah commented 3 years ago

it is very likely. I updated hass.io to 2021.2.0 yesterday

carldebilly commented 3 years ago

I'll upgrade my lab to test this...

carldebilly commented 3 years ago

It works on my Raspberry Pi 3 with the latest version of HASS OS :-|

LA-chel commented 3 years ago

The same problem: core-2021.2.1, supervisor-2021.02.4, Docker version 20.10.3 Zigbee2MqttAssistant Section 'settings' in configuration does not exists. ! The user configuration /usr/share/hassio/addons/data/806b11b5_zigbee2mqttassistant/options.json is empty ?

jirmjos commented 3 years ago

Same Issue here, from this morning after upgrade my hassio to supervisor-2021.02.6, zigbee2mqttassistant seems unable to propperly start and no devices in it. Raise error bellow , an my parameters are the same as before when was working for months without issues. I uninstall the add-on and reinstall without success then to try I install zigbee2mqttassistant addon dev-branch raising same error. So all points clearly last hassio core and supervisor upgrades had broken to this addon.

warn: Zigbee2MqttAssistant.Services.SettingsService[0] Section 'settings' in configuration does not exists. Will use default settings instead. Hosting environment: Production Content root path: /app Now listening on: http://[::]:80 Application started. Press Ctrl+C to shut down. warn: Zigbee2MqttAssistant.Services.MqttConnectionService[0] Unable to connect to MQTT server mqtt.

sander816 commented 3 years ago

yes, same error here, updated and now zigbee2mqtt assistant is offline

user514 commented 3 years ago

Today I notice the same problem. 'zigbee2mqtt' working ok (devices reachable, etc), but I noticed entering 'zigbee2mqtt assistant webui' has no devices on the list.

Same error: Unable to connect to MQTT server mqtt in the assistant log. Not sure when 'assistant' list of devices dissapear.

(I have 2 machines with hassios. Both with 2021.1.5, both with the error).

MageMaster87 commented 3 years ago

On my Raspberry Pi 4, after updating to Home Assistant 2021.2.2 also stopped working, there was no problem before update. Everything still works through mqtt but in zigbee2mqttassistant I don't have any device in list and bridge state is offline

Same error in log: "Section 'settings' in configuration does not exists. Will use default settings instead."

paranojk commented 3 years ago

Same here. HA Core made a lot of security updates in release 2021.1.5. They are mentioning something about directory traversal, but I need to do some more reading. https://www.home-assistant.io/blog/2021/01/23/security-disclosure2/

solsv commented 3 years ago

I'm experiencing the same issue. Looking at the supervisor logs, it appears as though the settings are not getting passed to Z2MA for some reason:

21-02-09 23:42:00 INFO (SyncWorker_1) [supervisor.docker.interface] Downloading docker image carldebilly/zigbee2mqttassistant with tag 0.3.157.
21-02-09 23:42:06 INFO (MainThread) [supervisor.addons] Add-on '806b11b5_zigbee2mqttassistant' successfully installed
21-02-09 23:42:48 WARNING (MainThread) [supervisor.addons.options] Unknown options settings
21-02-09 23:43:34 WARNING (MainThread) [supervisor.addons.options] Unknown options settings
21-02-09 23:43:34 WARNING (MainThread) [supervisor.addons.options] Unknown options settings
21-02-09 23:43:37 INFO (SyncWorker_1) [supervisor.docker.addon] Starting Docker add-on carldebilly/zigbee2mqttassistant with version 172
paranojk commented 3 years ago

Quick update - I've just found bug and solution. config.json in the repository is missing schema (it is set to schema: false). After trying on my repo and adding schema everything is working again :-)

Added pull request https://github.com/yllibed/hassio/pull/6

solsv commented 3 years ago

@paranojk's solution is working for me.

shuttenbah commented 3 years ago

@paranojk Hi, it works. Great. Nice work.

diagonali commented 3 years ago

Quick update - I've just found bug and solution. config.json in the repository is missing schema (it is set to schema: false). After trying on my repo and adding schema everything is working again :-)

Added pull request yllibed/hassio#6

Thanks for info. Where is the config.json you mention and what do we need to change?

paranojk commented 3 years ago

@diagonali: file affected is https://github.com/yllibed/hassio/blob/master/zigbee2mqttassistant/config.json - it is used for repo configuration in HA. You could temporary use my fork with fix https://github.com/paranojk/hassio until it's merged with main repo.

jirmjos commented 3 years ago

Thank you @paranojk, with your repo working like a champ !

carldebilly commented 3 years ago

Fixed by https://github.com/yllibed/hassio/pull/6

Pawel128 commented 3 years ago

I also have this problem. I believe that your solution is very good, but I don't know how to apply it, what to do with the config.json file? put it somewhere? please give me a hint, thank you

solsv commented 3 years ago

@Pawel128 the fix is now incorporated into this repo. Try reinstalling and it should work.