Hassio-zigbee2mqtt: Issue today after updating to 2.0

Created on 15 Nov 2018  Â·  32Comments  Â·  Source: danielwelch/hassio-zigbee2mqtt

I got this issue today after updating to 2.0. I have soft restarted, and also hard-restarted,

  zigbee2mqtt:info 2018-11-15 17:29:36 Logging to directory: '/share/zigbee2mqtt/log/2018-11-15.17-29-36'
  zigbee2mqtt:info 2018-11-15 17:29:39 Starting zigbee2mqtt version 0.2.0 (commit #unknown)
  zigbee2mqtt:info 2018-11-15 17:29:39 Starting zigbee-shepherd
  zigbee2mqtt:info 2018-11-15 17:29:44 zigbee-shepherd started
  zigbee2mqtt:info 2018-11-15 17:29:44 Coordinator firmware version: 'undefined'
  zigbee2mqtt:info 2018-11-15 17:29:44 Currently 0 devices are joined:
  zigbee2mqtt:warn 2018-11-15 17:29:44 `permit_join` set to  `true` in configuration.yaml.
  zigbee2mqtt:warn 2018-11-15 17:29:44 Allowing new devices to join.
  zigbee2mqtt:warn 2018-11-15 17:29:44 Set `permit_join` to `false` once you joined all devices.
  zigbee2mqtt:info 2018-11-15 17:29:44 Zigbee: allowing new devices to join.
  zigbee2mqtt:info 2018-11-15 17:29:44 Connecting to MQTT server at mqtt://192.168.0.40:1883
  zigbee2mqtt:info 2018-11-15 17:29:45 zigbee-shepherd ready
events.js:183
      throw er; // Unhandled 'error' event
      ^
Error: Connection refused: Not authorized
    at MqttClient._handleConnack (/zigbee2mqtt-0.2.0/node_modules/mqtt/lib/client.js:920:15)
    at MqttClient._handlePacket (/zigbee2mqtt-0.2.0/node_modules/mqtt/lib/client.js:350:12)
    at work (/zigbee2mqtt-0.2.0/node_modules/mqtt/lib/client.js:292:12)
    at Writable.writable._write (/zigbee2mqtt-0.2.0/node_modules/mqtt/lib/client.js:302:5)
    at doWrite (/zigbee2mqtt-0.2.0/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/zigbee2mqtt-0.2.0/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Writable.write (/zigbee2mqtt-0.2.0/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Socket.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
npm
 ERR! code ELIFECYCLE
npm ERR! errno 1
npm
 ERR! [email protected] start: `node index.js`
npm ERR!
 Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!
     /root/.npm/_logs/2018-11-15T16_29_45_726Z-debug.log
2018-11-15T17:29:46: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2018-11-15T17:29:46: PM2 log: App [npm:0] starting in -fork mode-
2018-11-15T17:29:46: PM2 log: App [npm:0] online
> [email protected] start /zigbee2mqtt-0.2.0
> node index.js
        Zigbee2mqtt requires node version >=8.11 10, you are running v8.11.4!
  zigbee2mqtt:info 2018-11-15 17:29:53 Logging to directory: '/share/zigbee2mqtt/log/2018-11-15.17-29-53'
  zigbee2mqtt:info 2018-11-15 17:29:55 Starting zigbee2mqtt version 0.2.0 (commit #unknown)
  zigbee2mqtt:info 2018-11-15 17:29:55 Starting zigbee-shepherd
  zigbee2mqtt:info 2018-11-15 17:30:00 zigbee-shepherd started
  zigbee2mqtt:info 2018-11-15 17:30:00 Coordinator firmware version: 'undefined'
  zigbee2mqtt:info 2018-11-15 17:30:00 Currently 0 devices are joined:
  zigbee2mqtt:warn 2018-11-15 17:30:00 `permit_join` set to  `true` in configuration.yaml.
  zigbee2mqtt:warn 2018-11-15 17:30:00 Allowing new devices to join.
  zigbee2mqtt:warn 2018-11-15 17:30:00 Set `permit_join` to `false` once you joined all devices.
  zigbee2mqtt:info 2018-11-15 17:30:00 Zigbee: allowing new devices to join.
  zigbee2mqtt:info 2018-11-15 17:30:00 Connecting to MQTT server at mqtt://192.168.0.40:1883
  zigbee2mqtt:info 2018-11-15 17:30:01 zigbee-shepherd ready
events.js:183
      throw er; // Unhandled 'error' event
      ^
Error: Connection refused: Not authorized
    at MqttClient._handleConnack (/zigbee2mqtt-0.2.0/node_modules/mqtt/lib/client.js:920:15)
    at MqttClient._handlePacket (/zigbee2mqtt-0.2.0/node_modules/mqtt/lib/client.js:350:12)
    at work (/zigbee2mqtt-0.2.0/node_modules/mqtt/lib/client.js:292:12)
    at Writable.writable._write (/zigbee2mqtt-0.2.0/node_modules/mqtt/lib/client.js:302:5)
    at doWrite (/zigbee2mqtt-0.2.0/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/zigbee2mqtt-0.2.0/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Writable.write (/zigbee2mqtt-0.2.0/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Socket.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
npm
 ERR! 
code ELIFECYCLE
npm ERR! errno 1
npm
 ERR! [email protected] start: `node index.js`
npm 
ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!
     /root/.npm/_logs/2018-11-15T16_30_01_571Z-debug.log
2018-11-15T17:30:01: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2018-11-15T17:30:01: PM2 log: App [npm:0] starting in -fork mode-
2018-11-15T17:30:01: PM2 log: App [npm:0] online
> [email protected] start /zigbee2mqtt-0.2.0
> node index.js
        Zigbee2mqtt requires node version >=8.11 10, you are running v8.11.4!
  zigbee2mqtt:info 2018-11-15 17:30:09 Logging to directory: '/share/zigbee2mqtt/log/2018-11-15.17-30-09'
  zigbee2mqtt:info 2018-11-15 17:30:12 Starting zigbee2mqtt version 0.2.0 (commit #unknown)
  zigbee2mqtt:info 2018-11-15 17:30:12 Starting zigbee-shepherd
  zigbee2mqtt:info 2018-11-15 17:30:15 Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds)
  zigbee2mqtt:info 2018-11-15 17:31:15 Starting zigbee-shepherd
  zigbee2mqtt:error 2018-11-15 17:31:18 Error while starting zigbee-shepherd!
  zigbee2mqtt:error 2018-11-15 17:31:18 Press the reset button on the stick (the one closest to the USB) and start again
  zigbee2mqtt:error 2018-11-15 17:31:18 Failed to start
    {"message":"request timeout","stack":"Error: request timeout\n    at CcZnp.<anonymous> (/zigbee2mqtt-0.2.0/node_modules/cc-znp/lib/ccznp.js:255:22)\n    at Object.onceWrapper (events.js:315:30)\n    at emitOne (events.js:116:13)\n    at CcZnp.emit (events.js:211:7)\n    at Timeout.<anonymous> (/zigbee2mqtt-0.2.0/node_modules/cc-znp/lib/ccznp.js:234:18)\n    at ontimeout (timers.js:498:11)\n    at tryOnTimeout (timers.js:323:5)\n    at Timer.listOnTimeout (timers.js:290:5)"}
stale

All 32 comments

Did you create a corresponding issue in zigbee2mqtt repo? Probably would be a good idea given I think it’s more likely to be an issue there than with the add-on

I have the same issue today, how did you solve this?

I haven't yet

ons. 21. nov. 2018 21.37 skrev 1981nick1982 notifications@github.com:

I have the same issue today, how did you solve this?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/danielwelch/hassio-zigbee2mqtt/issues/71#issuecomment-440801467,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACe97lGkRq8zLWoK2SlXIT5c4LurYRH2ks5uxbmggaJpZM4YgpOb
.

Same issue. Had a running configuration on HomeAssistant/hassio on a Raspberry Pi 3. Updated to hassio-zigbee2mqtt Version 0.2.0 and lost the complete zigbee functionality. I read several posts (for example https://github.com/Koenkk/zigbee2mqtt/issues/67#issuecomment-393521792) but even after un-plugging and re-plugging the stick, resetting it etc it does not work at all.

I am not sure how "Jessie" or "not-Jessie" translates to hassio (https://github.com/Koenkk/zigbee2mqtt/wiki/Running-the-bridge "NOTE: it is reported that Raspbian Jessie doesn't work.") but as hassio on a Pi3 does not seem to be an exotic configuration, I am wondering how to resolve this issue...

Thanks for the reports, I’ll try to look into it. Again, I’d echo that an issue should be created in zigbee2mqtt and linked here.

This seems to be a zigbee2mqtt issue, lets continue here: https://github.com/Koenkk/zigbee2mqtt/issues/617

EDIT: it seems that all users who have this problem are running hassio

For users having this problem, do you have authentication enabled on the MQTT server?

I do

fre. 23. nov. 2018 08.55 skrev Koen Kanters notifications@github.com:

For users having this problem, do you have authentication enabled on the
MQTT server?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/danielwelch/hassio-zigbee2mqtt/issues/71#issuecomment-441173552,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACe97t9aGrSjf8iCrYhK-SCO4hYOafymks5ux6nWgaJpZM4YgpOb
.

Might be worth knowing what backend everyone is using for MQTT in Hassio. I use the community add on, but I think some changes were made recently to the official MQTT add on

@danielwelch that would mean when downgrading the hassio zigbee2mqtt addon to 0.1.8 it should not work. @martincollignon can you try this?

I also have the community add-on of MQTT.

@jensbri are you using the optional logins config for that add on and, if so, are you using those credentials for this add on?

Okay,

So I have hassio installed with just Zigbee2mqtt addon, connecting to a mqtt server on different machine altogether, upgrading to v2 has completely broken zigbee network

Also tried full restore of v1.8 working snapshot, automatically upgrades to v2.0, during addon boot up resulting with no zigbee network. So down grading does not work

Even tried deleting db, and re-pairing, this just causes the device to constantly crash and reboot

Hope this helps in trying to figure out what’s broken, log also warning node-js needs upgrading (not compatible).

@1981nick1982 mentioned in https://github.com/Koenkk/zigbee2mqtt/issues/617 that setting anonymous setting on true, for the hassio mosquitto broker fixed the problem.

Could it be that the authentication configuration is not used correctly @danielwelch ?

Hi. I followed your recommendation and set anonymous to true in the "Mosquitto broker". Now everything works like a Charme. Thanks!

I’m wondering if the move to authenticating with the homeassistant user in the latest versions of the mosquito official add-on is what’s causing the problem for most. The fact that it works with anonymous access certainly supports this. The latest versions of the add-on (if I recall, version 3 and beyond) require you to set up an “integration” via the front end. If anyone reading this upgraded without doing that, I’d refer to the add on docs and do that.

Allowing anonymous access is, generally speaking, a bad idea. In the example config posted by @1981nick1982, the logins option is blank. You should be able to use that option to define login credentials that you can then use in zigbee2mqtt, allowing zigbee2mqtt to connect without enabling anonymous access.

Edit: this theory doesn’t explain reports from a user who uses the community add-on or another that hosts an MQTT broker on a different machine altogether from Hassio/homeassistant

Okay,
So back at home today, restored working snapshot Hass.io v0.81.6, addon version v0.1.8, all working!!, logs report using v0.2.0 zigbee2mqtt. So decided to upgrade addon to v0.2.0, restarted and no issues.

The problems start when you update Hass.io from v0.81.6 to v0.82.1, hope this helps in narrowing down the issue!

I dont think it has anything to do with MQTT addon, but then I am connecting to MQTT server on different device.

Spoke too soon,

Now getting sames issue!!!! with v0.81.6

@01kbpatel could you tell us more about your setup? Is your log error identical to the one we are discussing here? What are you using for an MQTT server/broker? Do you have authentication enabled on your MQTT server? Does disabling that fix the problem? Based on the one suggested fix, it seems like a problem with zigbee2mqtt authentication, but I’m not aware of any change that was made relating to that. I suspect changes to the official MQTT add-on are causing the problem for some, but I’d like to hear more about your issue since you’re using a separate MQTT server.

Hi Guys, I made it working for me! I have changed mosquito to: "anonymous": true,
I have also added in the configuration.yaml file"
mqtt:
broker: (IP of Raspberry)

And I have added the allow to join configuration of zigbee2mqtt. works like a charme.

So install the add ons:
Mosquitto broker - and punt anonymous on true.
zigbee2mqtt
mqtt- and put the IP address in the configuration
add the allow to join configuration. ( you need to remove 2 spaces before every line before it works)

Hi Guys, I made it working for me! I have changed mosquito to: "anonymous": true,
I have also added in the configuration.yaml file"
mqtt:
broker: (IP of Raspberry)

And I have added the allow to join configuration of zigbee2mqtt. works like a charme.

So install the add ons:
Mosquitto broker - and punt anonymous on true.
zigbee2mqtt
mqtt- and put the IP address in the configuration
add the allow to join configuration. ( you need to remove 2 spaces before every line before it works)

@michaeldbr, when you say "allow to join" for zigbee2mqtt do you mean set permit_join to true?

Sorry I made a mistake. I used the the allow to join script from:
https://github.com/danielwelch/hassio-zigbee2mqtt/blob/master/README.md

Hi Guys, I made it working for me! I have changed mosquito to: "anonymous": true,
I have also added in the configuration.yaml file"
mqtt:
broker: (IP of Raspberry)

And I have added the allow to join configuration of zigbee2mqtt. works like a charme.

So install the add ons:
Mosquitto broker - and punt anonymous on true.
zigbee2mqtt
mqtt- and put the IP address in the configuration
add the allow to join configuration. ( you need to remove 2 spaces before every line before it works)

This only works for a short time. After some hours i get this error:
1543758328: Saving in-memory database to /data/mosquitto.db.

I am also having this isssue with HA 0.83.2.
Zigbee2mqtt only works for a short period of time. It was working correctly before updating to this HA latest version.
I have a manual installation of HA on top of raspbian, mosquito in the same RPi with authentication.
I can provide more details if needed to help to solve this issue.
Thanks

Hi everyone,
Just a quick update since I like to answer my own questions :-)
Yesterday I updated my HA to the latest 0.83.3 but this dindn't solve the zigbee2mqtt issue.
After some debugging running zigbee2mqtt manually and analyzing its the logs and also mosquitto's, I fixed the issue I was having by deleting the mosquitto database:

sudo service mosquitto stop
sudo rm /var/lib/mosquitto/mosquitto.db
sudo service mosquitto start

Not sure if this was really needed but since I was having a huge delay only with mqtt messages from/to zigbee2mqtt, I decided to delete mosquitto database.

after that I comented/removed the following line in zigbee2mqtt configuration yaml:

#include_device_information: true

Since then my zigbee2mqtt is working without any issues as before last weekeng HA update.

HTH anyone

Hi,
I had similar issues upon updating to 0.2.0, zigbee2mqtt was logging
Error: Connection refused: Not authorized
and mosquitto was logging
Socket error on client
at the same time.

I followed the steps below, my system seems to be stable for the time being:

  • Updated mosquitto add-on to version 4
  • Set a local user on mosquitto config - i.e.
"logins": [
    {
      "username": "mqttuser",
      "password": "password"
    }
  ],   
  • Set this user in zigbee2mqtt config:
"mqtt_user": "mqttuser",
"mqtt_pass": "password"
  • Restart mosquitto add-on
  • Restart zigbee2mqtt

looks like it still broken. Im using my own mqtt broker and addon can not connect to it.
All other mqtt devices - tasmota with TLS and without - can connect without any issues.

Any updates on this ?

I’m pretty certain there are multiple separate issues being discussed in this thread, causing some confusion. @ekinmeroglu and others ran into problems because the official mosquito add-on changed the way it did authorization, so they just needed a configuration update to get things going. Others are having problems while running their own brokers and, obviously, are experiencing a separate issue.

When this issue was opened, everyone that experienced it was an add-on user, and I think the correlation was that these were also Hassio users and using the mosquito add-on as well. I think others need more troubleshooting and investigation into if this is even an add-on issue vs a zigbee2mqtt issue. Maybe everyone still having issues should open a new issue with logs? (I’m not even sure if the OP for this issue has had their problem solved or not)

I'm pretty sure I've had two separate issues with zigbee2mqtt 0.2.0: There was another one even before updating mosquitto to v4.

I was using a customized devices.js via zigbee_shepherd_devices: true statement, and the custom file in question was from 0.1.8 era - It seems some parts were not compatible with 0.2.0, so the service failed to start with an exception like TypeError: Cannot read property 'key' of undefined

I disabled this custom devices.js usage, and everything got back to normal.

Long story short, I'd try running the add-on with only the default settings / parameters, and if it fails with an exception other than ..Not authorized, I'd go on and open a different issue, as @danielwelch suggested.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

In case anyone else has this issue and stumbles across this page, this issue is fixed by creating a Home Assistant user with the same username and password as you put in the zigbeetomqtt configuration.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gualostly picture gualostly  Â·  12Comments

backcountrymountains picture backcountrymountains  Â·  6Comments

knutasund picture knutasund  Â·  11Comments

eric-zimmer picture eric-zimmer  Â·  6Comments

SPEC1AL1ST picture SPEC1AL1ST  Â·  12Comments