MQTT not working after upgrade

  • Platform information:
    • Hardware: Pi4 4gb
    • OS: Openhabian cant find version number but openhabian-config shows 2022-12-02
    • openHAB version: 3.3.1 upgrade to 3.4.1

Note: problem solved already, just documenting it in case anyone else has the same problem.

Today I upgraded my system from 3.3.1 to 3.4.1 using the openhabian-config menu item 02 - Upgrade System.

Immediately after the upgrade had finished, I noted that none of my zigbee items were working (using zigbee2mqtt and openhabian installed mosquitto).
On a second screen I could see that MQTT explorer could not connect to the broker.

I checked ‘systemctl status mosquitto’ which rreferred to ‘journalctl’. I checked that with ‘journalctl -u mosquitto.service’ which reported that it could not write to /var/log/mosquitto/mosquitto.log (permission denied).

Upon checking the relevant directory I found that there was no such file. I created one using ‘touch mosquitto.log’ and rebooted the pi. No luck, same error.

I went back to the directory, entered ‘chown openhab:openhab mosquitto.log’ EDIT: later changed to chown mosquitto:mosquitto mosquitto.log (see below) and ‘chmod 777 mosquitto.log’ and rebooted

Problem solved, all working again.

I can only guess that there has been changes made to mosquitto. Could someone look at the upgrade system and suggest appropriate changes. Before anyone says ‘submit a PR on github’, I do not have a github account and do not know how to do this.

ps: this is not a complaint. I love openHAB and the rest of the upgrade worked perfectly. I now have 3.4.1 and can use web audio on Main UI.:grinning:

I doubt that this is a structural problem of the OH upgrade process:

  • 3.4 is out since december, 3.4.1 a few days but this is the first report that I am aware of I would expect to see more of this in case it is a generic problem of 3.4[.1]
  • the owner of and file in directory originally is mosquitto:mosquitto; it just works because you changed it to 777
  • do you use ZRAM ? I had similar problem when I installed mosquitto some time ago; I think the problem was that the permissions created in ZRAM directory made it not into the underlying ‘master copy’ but as I did not further investigate it I am not 100% sure about it

Thanks for the reply.
‘mosquitto:mosquitto’ noted and corrected. :pray: What are the correct file permissions?
I do use ZRAM. Why would this cause the file to go missing? Would it have been created after a reboot?
What did you do to solve the problem you had?

The message you posted said “permission denied” in write context.
That means that most probably the parent folder ( /var/log/mosquitto ) had wrong permissions e.g. belonging to root:root. This permission did not allow user mosquitto to write any file to the directory.
Hard to say if it would have been created. If the above was the reason and the permissions/ownership of the directory was not changed during reboot that would not have changed anything.

At that time I made sure that ZRAM was not running.
Reinstalled mosquitto and enabled afterwards again.