After updating the Z2M plugin: MQTT failed to connect: Connection refused: Not authorized

Hi there,

after updating the Zigbee2MQTT plugin to version 1.27.2-1 it doesn’t start anymore, the log says

Zigbee2MQTT:warn  2022-09-04 17:11:25: `permit_join` set to  `true` in configuration.yaml.
Zigbee2MQTT:warn  2022-09-04 17:11:25: Allowing new devices to join.
Zigbee2MQTT:warn  2022-09-04 17:11:25: Set `permit_join` to `false` once you joined all devices.
Zigbee2MQTT:error 2022-09-04 17:11:25: MQTT failed to connect: Connection refused: Not authorized
Zigbee2MQTT:error 2022-09-04 17:11:25: Exiting...

I didn’t change anything in my configuration so user and password are still correct.

Dis- and reconnecting the adapter like mentioned here doesn’t solve the problem.

Can anybody help me here?

Thank you!

I seem to recall having a similar problem not long ago and I had to completely remove Z2M and reinstall. To be safe make sure you take a backup first. When I did this after the re-install everything worked just fine and I didn’t lose anything. YMMV.

It won’t, because your problem is:

Zigbee2MQTT:error 2022-09-04 17:11:25: MQTT failed to connect: Connection refused: Not authorized

Check your MQTT settings and the broker logs.

Thank you for your answer.

My broker is HA’s Mosquitto broker, its log says

2022-09-04 20:28:01: New connection from 172.30.32.1:41434 on port 1883.
2022-09-04 20:28:01: Client <unknown> disconnected, not authorised.

In the MQTT settings I didn’t change anything too and I don’t know what to configure here as it is done automatically when installing it (as far as I remember).

I’m sorry but I am not too familiar with MQTT etc. I installed it when setting up my HA and ever since it worked just fine.
My coordinator is a Dresden ConBee II Zigbee USb stick.

Please see my configuration for everything in the attached screen shots.



2022-09-04 20_45_28-Window

:hushed:
I hope I can find another solution but will try your proposal as plan b (well, maybe c or even d :wink:)

FYI, the removal and reinstall doesn’t mean you have to set everything back up. It doesn’t remove the configuration, it didn’t in my case. However, because it didn’t require me to start over doesn’t mean it couldn’t happen to someone else which is why I suggested taking a backup.

I see, thank you.
How exactly did you do your backup? Just copying your zigbee2mqtt/configuration.yaml?

With a local installation of MQTT, Mosquitto, then the server for Z2M should be like this in the zigbee2mqtt configuration.yaml

  server: mqtt://core-mosquitto:1883

And, remember the user you created, mqtt_user should have admin rights.

@fahrer17 so I have the Google Drive Backup add-on installed so it sends my HA backups to my Google Drive so that I have them stored outside of HA. However, in your case you should be able to just use the built-in Settings->System->Backups option to take a backup.

Ah, I see. I have a daily backup to a samba share I can use.
I think I will try this.

Edit:
So I simply restored my latest backup and everything is working again.
No removing and reinstalling anything - just restoring :man_shrugging:
Even the Z2M plugin is now uptodate.
Strange…

I keep the thread “unsolved” for the next days - one never knows…

Good night and thanks to everyone who contributed :+1:

I changed both the server address as well as the mqtt user rights with no success.

Configuring Z2M seems to have changed a little jugding by this video:

1 Like

Reinstall mosquitto addon

Everything is still working fine after restoring my nightly backup so I think I can call this thread done.

Thank you everyone for your support!

for anyone having a similar issue after restore/ update. what i did is to change the port to 1885 in both the market and z2mqtt then z2mqtt worked immediately.

i think the old port was reserved by the old machine, anyways, just change the port and see if it work, for me that solved the problem immediately.

Hello guys, this is what worked for me.
I had to delete the username and password from the Configuration tab, Zigbee2MQTT started and then I added the login to the Web UI - > Settings → MQTT