Zigbee2MqttAssistant icon indicating copy to clipboard operation
Zigbee2MqttAssistant copied to clipboard

[BUG] only partial connection to z2m

Open Zirafarafa opened this issue 2 years ago • 5 comments

Describe the bug

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

  • The version of Zigbee2Mqtt in the Status tab is blank,
  • Clicking the 'Allow devices to join' button does not send any message to z2m
  • No device shows its uptime in the Devices tab.

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:

  • Installed the latest version
  • Installed multiple previous versions (back to carldebilly/zigbee2mqttassistant:0.3.178-399-linux-arm32)
  • Tried different version of zigbee2mqtt (from 1.19.1 to 1.21.1)

Screenshots

  • image
  • image

Installation

  • Version of Zigbee2Mqtt: 1.19.1 and later
  • Version of Zigbee2MqttAssistant:0.3.178-399 and later
  • Installation type (HASS.IO, Docker...): docker
  • Docker version + CPU type (amd64, arm arm64...): docker 18.09.1, arm32 (raspberry pi)

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"}'

Zirafarafa avatar Sep 20 '21 06:09 Zirafarafa

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

MrTheBarbarian avatar Oct 09 '21 17:10 MrTheBarbarian

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.

danmandle avatar Oct 12 '21 13:10 danmandle

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.

Lefuneste83 avatar Dec 31 '21 18:12 Lefuneste83

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

nakermann1973 avatar Feb 03 '22 14:02 nakermann1973

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

Lefuneste83 avatar Feb 03 '22 14:02 Lefuneste83