yllibed / Zigbee2MqttAssistant

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

[BUG] only partial connection to z2m #404

Open Zirafarafa opened 2 years ago

Zirafarafa commented 2 years ago

Describe the bug

z2ma appears to not fully connect to mqtt. I can see my device list, but

To Reproduce

This reproduces every time i create/recreate my z2ma docker container.

Steps I took to try resolve the problem

I have tried a few things:

Screenshots

Installation

Pertinent logs

I do not see any information in the zigbee2mqtt logs when pressing 'Allow devices to join'

z2ma startup logs:

zigbee2mqttAssistant    | Starting Zigbee2MqttAssistant v0.3.178+Branch.master.Sha.7b1877a40d9d37c5a18e33632ecf85e6eda09a95...
zigbee2mqttAssistant    | warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
zigbee2mqttAssistant    |       Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
zigbee2mqttAssistant    | warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
zigbee2mqttAssistant    |       No XML encryptor configured. Key {86466ab2-dde7-487b-98b4-bc291cd92b28} may be persisted to storage in unencrypted form.
zigbee2mqttAssistant    | Hosting environment: Production
zigbee2mqttAssistant    | Content root path: /app
zigbee2mqttAssistant    | Now listening on: http://[::]:80
zigbee2mqttAssistant    | Application started. Press Ctrl+C to shut down.

After clicking the Status tab

zigbee2mqttAssistant    | fail: Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery[7]
zigbee2mqttAssistant    |       An exception was thrown while deserializing the token.
zigbee2mqttAssistant    | Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted.
zigbee2mqttAssistant    |  ---> System.Security.Cryptography.CryptographicException: The key {21511362-727d-4ecb-a0dc-482ee4c079c4} was not found in the key ring.
zigbee2mqttAssistant    |    at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)
zigbee2mqttAssistant    |    at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.DangerousUnprotect(Byte[] protectedData, Boolean ignoreRevocationErrors, Boolean& requiresMigration, Boolean& wasRevoked)
zigbee2mqttAssistant    |    at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData)
zigbee2mqttAssistant    |    at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
zigbee2mqttAssistant    |    --- End of inner exception stack trace ---
zigbee2mqttAssistant    |    at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
zigbee2mqttAssistant    |    at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.GetCookieTokenDoesNotThrow(HttpContext httpContext)

Additional context

I have no issues between homeassistant and z2m

I can use an external mqtt client to successfully set zigbee2mqtt/bridge/request/permit_join to true or false. The z2m logs in this case look like:

zigbee2mqtt             | Zigbee2MQTT:info  2021-09-20 08:36:27: Zigbee: allowing new devices to join.
zigbee2mqtt             | Zigbee2MQTT:info  2021-09-20 08:36:27: MQTT publish: topic 'zigbee2mqtt/bridge/response/permit_join', payload '{"data":{"value":true},"status":"ok"}'
zigbee2mqtt             | Zigbee2MQTT:info  2021-09-20 08:36:58: Zigbee: disabling joining new devices.
zigbee2mqtt             | Zigbee2MQTT:info  2021-09-20 08:36:59: MQTT publish: topic 'zigbee2mqtt/bridge/response/permit_join', payload '{"data":{"value":false},"status":"ok"}'
MrTheBarbarian commented 2 years ago

Hello! In my case is the same. Did you find workaround?

danmandle commented 2 years ago

I am also experiencing this issue. When viewing the network tab in Chrome after any action that requires a POST, it shows (pending) and eventually times out. Same as OP, I've tried multiple z2mA versions and they all have the same behavior. I've tried on multiple machines and multiple browsers.

Lefuneste83 commented 2 years ago

Same issue on a fresh install of this Add-on. It used to work until I reinstalled my Z2M raspberry pi (dedicated install) with latest Dev version. HA is running on Docker with no access to USB port (VM in TrueNas).

Not sure what is going on, but this add-on seems to be more or less abandoned with no updates nor reactions to issues and an increasing pile of bugs. This is quite disappointing.

nakermann1973 commented 2 years ago

Since zigbee2mqtt now has a frontend (https://www.zigbee2mqtt.io/guide/configuration/frontend.html), I have stopped using zigbee2mqttassistant

Lefuneste83 commented 2 years ago

Agreed. Much better UI and functionalities. Wish it could be integrated in HA though. It should be easy to do.