Thanks for reply! Seems to work now. There still is a warning, but Mosquitto has started. Following the advice to restart the servis, the warning is gone, but comes back after a reeboot. Anything to worry about?
[13:24:01] openhabian@openhab2neu:~$ systemctl status mosquitto.service
Warning: The unit file, source configuration file or drop-ins of mosquitto.service changed on disk. Run 'sy
ā mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/mosquitto.service.d
āāoverride.conf
Active: active (running) since Wed 2020-11-04 13:20:08 CET; 3min 55s ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Main PID: 1014 (mosquitto)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/mosquitto.service
āā1014 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
Nov 04 13:20:07 openhab2neu systemd[1]: Starting Mosquitto MQTT v3.1/v3.1.1 Broker...
Nov 04 13:20:08 openhab2neu systemd[1]: Started Mosquitto MQTT v3.1/v3.1.1 Broker.
I am having the same problem. I am trying to migrate my Pi 3 to a new Pi 4 setup with more reliable backups and so on. So I started with a new RPi. Everything else moves across OK, rules, items, bindings. I even managed to work out how to move Node-Red and its credentials.
But the Mosquitto broker will not run. It fails on startup and I get the same error as others here about not being able to access /var/log/mosquitto/mosquitto.log.
I tried disabling zram (is this related to the cause?) and Iāve tried reinstalling Mosquitto with the same error as others again
There was an error or interruption during the execution of: ā
ā ā20 | Optional Componentsā
Iāve read through this thread and Iām not sure if weāve found the answer. The more I muck about with trying different things, the further away from a clean standard installation I get and I worry if Iām breaking something else or future upgrades.
This is a device that controls things I use every day (wife not happy if something fails) so I prefer to keep to stable packages with as little deviation from standard setups as possible. Iām not a beginner with Openhab but I am no Linux or RPi expert so Iām just following people who know more than me.
Does anyone have a definitive summary view on why a clean installation of the latest Openhabian downloadable image onto a 16GB card installed in a brand new 2GB Pi4 cannot run Mosquitto? Better still, a way to make it work without making my system ānon-standardā and perhaps not upgradeable. Even better, is there a fix coming for the standard Openhabian download?
Thatās what I added as a fix to openHABian, too. So if you install from scratch it should work right away. Just make sure you use the master branch to install (default is stable).
Ah - super. Thatās what I was looking for. Many thanks
I was a bit concerned that if I make a structural change it might get undone on the next update and then mission-critical stuff like my entire heating system falls over! Iām a bit reluctant to go creating new directories and changing ownerships to make something work but now I know youāre right on top of it and it is being incorporated in later versions too then I am happy.
Iāll make the change tonight and hopefully Iām all good
Can confirm: Installing mosquitto from the setup menu (sudo openhabian-config) works perfectly, set up several devices, all in proper working order. Reboot, no mosquitto. Manually restarting it results in authentication errors from the OH bridge thing. So something is definitely up here.
Update: It turns out the MQTT bridge was not configured correctly, although it boggles my mind how it worked on initial installation but not after reboot. At any rate, adding username/password to the thing configuration resolves the issue. Although the restart issue still remains, but thatās easy enough to hack around.
Can confirm whatās in the post right above you: Mosquitto installs from openhabian-config, works fine until reboot/restart. Post 41 code doesnāt fix anything.
Well AFAIK youāre the only one with this problem. You didnāt answer which openHABian branch you use. Does journalctl -xu mosquitto.service give any hint ?
openHAB version is not of interest and I donāt know what an āOA bridgeā is so canāt tell if thatās related.
I doubt you run a OH core 2.5.0. Either way, thatās pretty old. Is your openHABian installation even buster based ? Have you ever upgraded openHABian OS packages (menu 02) ?
You should move to openHABian master and could try to uninstall and reinstall zram then eventually reinstall mosquitto.
Update: Discovered the problem: In addition to the ā:ā character, there are apparently other prohibited password characters not enumerated in the mosquitto_passwd manpage. One of these is apparently ā$ā. Donāt bother using it in your password; authentication will fail.
Here is what is misleading: For whatever reason, when mosquitto is first installed from openhabian-config, access is set to āallow_anonymous trueā. This allows any publisher/subscriber to connect, even though it might appear that authentication is being used. If the mosquitto daemon is restarted, allow_anonymous reverts to whatever is in the .conf file (false by default).
Obviously not an OH issue, but might still cause some issues due to lack of documentation.
Original post: It was installed from one of the pre-built OpenHABian images, probably mid-2019. I really canāt speak for the accuracy of the version info thatās installed with OpenHABian; I would assume it is at least close to be correct. At any rate, I doubt itās an OH issue, so it probably has nothing to do with the OpenHABian branch that the image was built from.
If I find a solution Iāll post here to help others who might run into this problem.
Thanks Marcus for your prompt help. I suffered the same issue with a new install of the openhabian image on RPi3b.
Following your instructions, repeated below for those that need it too, everything works as it should, no errors:
I was having a similar issue. After installing Mosquitto using openhabian-config, everything seemed to work fine. But after doing some troubleshooting to get MQTT working, Mosquitto stopped working. I tried to find log files, run files, etc., but couldnāt find any indication there was a working version on the Pi (3B+). I tried reinstalling it a few times (as per the instructions) - no go. I tried removing it with apt and reinstalling with openhabian-config - same issue. Finally, I removed it and reinstalled it with apt - it is working again, well kind-of. Being my first iteration of MQTT, Iām having other issues, but at least the broker is online.
I got the same problem. Mosquitto worked well directly after install but after reboot it stopped working. I donāt know anything about Linux. The last three years I somewhat managed to use openhab using the config files. I was happy when openhabian came around and you didnāt have to be a linux-expert to use openhab. Coming around to version 2.5 on my raspberry 4, I tried upgrading my setup. Through much trial and error I managed to write some things files, which, due to the lack of documentation, is really difficult. When I wanted to restart and installed openhab using the openhabian installer, I encountered the same problem as others in this thread. I uninstalled the zram using the openhabian config, but this didnāt help. What should I do?
PS: Suggesting I check some xyz-config file isnāt helpful, because I donāt understand the linux system.
Bug reports are only useful/can only be worked upon when they show the problem/misbehavior happen so provide a log showing this and do not forget to describe your starting point.
Set debugmode=maximum in openhabian.conf and record the required output.