Installation of Embedded MQTT Broker with 2.5.0-SNAPSHOT fails AND/OR connection refused

Tags: #<Tag:0x00007faee5376568>
  • Platform information:

    • OS: Ubuntu 18.04.2 LTS

    • Java Runtime Environment:
      openjdk version “1.8.0_202”
      OpenJDK Runtime Environment (Zulu 8.36.0.1-CA-linux64) (build 1.8.0_202-b05)
      OpenJDK 64-Bit Server VM (Zulu 8.36.0.1-CA-linux64) (build 25.202-b05, mixed mode)

    • openHAB version: 2.5.0-SNAPSHOT (#1561)

Yesterday my MQTT Instance (V2 Binding, internal OH MQTT Broker) works great on my OH 2.5 (sadly, idk the Version Nummer). Then i did update … never change a running system … and OH was not able to connect to the MQTT Broker:

 [hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden

I tried to reinstall (stopped OH, cleaned the cache, out commented the mqtt.thing file) the embedded broker (Moquette misc-mqttbroker - 2.5.0.SNAPSHOT) with no success:

[ERROR] [org.openhab.io.mqttembeddedbroker   ] - bundle org.openhab.io.mqttembeddedbroker:2.5.0.201903260112 (258)[org.openhab.io.mqttembeddedbroker.internal.EmbeddedBrokerService(304)] : The activate method has thrown an exception

[hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

and “can’t establish connection to server”

'mqtt:broker:openhabembedded' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden

==> /var/log/openhab2/openhab.log <==

 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to 'localhost'. Next attempt in 10000ms

==> /var/log/openhab2/events.log <==

 [hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden to OFFLINE

==> /var/log/openhab2/openhab.log <==

 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'localhost' with clientid paho34229486255687 and file store '/var/lib/openhab2/mqtt/localhost'

==> /var/log/openhab2/events.log <==

 [hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden

==> /var/log/openhab2/openhab.log <==

 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to 'localhost'. Next attempt in 10000ms

==> /var/log/openhab2/events.log <==

 [hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden to OFFLINE

==> /var/log/openhab2/openhab.log <==
 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'localhost' with clientid paho34229486255687 and file store '/var/lib/openhab2/mqtt/localhost'

==> /var/log/openhab2/events.log <==

[hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden

I configured the Broker only with a text file (Visual Studio):

Bridge mqtt:broker:openhabembedded "OH embedded Broker" [ host="localhost", port=1883, secure=false ]

Is this a known error of the snapshot or my misconfiguration? How can i rescue my system? (e.g.using a extern mosquitto server?)
I was so happy with my mqtt system: learned to filter out json strings, convert them to a number, calculate a new value and post the value on the knx bus. But … i crashed my system. :-0

(Off topic, skip if you do not want to read frustation: My user experience the last two months: steep learning curve, too many changes, new concepts (great), but confusing without documention and examples (bad). I never experienced a change that radical in the last 1…2…3 years. I hope OH will slow down its pace.)

2 Likes

downgrade to 2.4.0-1 (sudo apt-get install openhab2=2.4.0-1), same config file, no reboot: back in business!

(Off-Topic: This openhabian-config tool …:

Grafana+influxdb installation: no success (old repository entry) solution: manual installation
Downgrade: no success … manual installation.
Sadly the log output is unreadable, so the user has no feedback, if his action had suceeded.)
Hmmm …

Personally, I would recommend using the external Mosquitto server at this time. I’d give the embedded broker a bit of time to mature a bit before I’d rely on it.

I’d also stay away from the snapshot builds unless you want to help find and solve the many many problems that have popped up with the merge of ESH back into the OH core. Though I don’t think any of those changes should be a cause of the problem you are seeing.

It does sound like you may have discovered a bug in the embedded broker. Please file an issue on the openhab2-addons repo. See How to file an Issue for details if you need help.

@rlkoshak, why would you currently advice to go wit mosquitto (VS embedded broker)?
I’m currently getting into my first mqtt connection so I try to learn ‘the right thing’

That isn’t a general recommendation but a recommendation specific to OP’s situation.

My generic opinion is that I don’t have one. It doesn’t really make much of a difference. But because the OP was having trouble, I couldn’t tell what was causing the trouble, and setting up Mosquitto is so easy I recommend moving to that.

Thanks for the explanation

The snapshot build are not recommended right now. We are currently migrating all bindings to a new build system and it is likely that the packaging does not work as intended.

The actual change is that we no longer package external dependencies like the Moquette broker in this case with the bundle but only reference them as dependencies. That seem to have failed here.

Rich and David: Many thanks for your reply with your explanations and your patience! That make things clear!

:slight_smile:

Now we’re 2 months later… are we still on the general recommendation that the snapshot build is not recommended? Because I just upgraded too it and s#*t went downhill pretty fast :slight_smile: I’m about to rollback to the stable release, but I did the upgrade to snapshot release in an effort to get MQTT 2.x going (after my initial migration from 1.x with things not working consistently) - that was initially due to 1.x completely stopping working totally out of the blue.

While I greatly appreciate the effort of everyone involved in developing an open source home automation product such as OpenHAB, as the OP states it does seem to be going at a great rate of knots in the past 3-4 months, hopefully not to it’s detriment long term.

The buildsystem migration + reintegration of eclipse smarthome pretty much made openHAB an openHAB 3. Not the API (Application Programming Interface) changed, but the ABI (Application binary interface) did.

Every single addon need to be checked if it still works, most don’t. And a lot of maintainers disappeared. It’s like with the openHAB 1 -> openHAB 2 situation at the moment is my personal perception of things.

The core itself works. Kind of.

That’s why I have suggested in the Developer section to think about a more generic binding development, based on open standards, not so much tied to openHAB itself. That way we can share bindings with other communities and have potentially more maintainers.

1 Like