OH3 MQTT system broker - protocol error, 'Server closed connection without DISCONNECT'

Hi everyone, I bit the bullet a couple of days ago, and started to migrate my OH setup to version 3. Or so I thought…

I have a problem with the MQTT add on, which is that I cannot get the system broker to work.
The symptoms:

  • SystemBroker thing has status “ERROR:COM”, says ‘Server closed connection without DISCONNECT.’
  • mosquitto says: Client disconnected due to protocol error
  • When I add a (non-system) broker thing myself, that works fine (things that reference that broker work fine too - they don’t save channels that I create, but that is probably a different issue)
  • Mosquitto itself works fine (my devices can connect to it, I get the expected messages in all the right topics, etc

I am at my wits end with this at the moment, tried clean installs of both currently available OH3 builds, changed mosquitto port mappings around to make sure there’s no glitch there, of course I used the identical settings as in OH2 where this works fine.
Any ideas what the issue might be here?

My setup

  • all dockerized, controlled with docker-compose
  • running mosquitto as MQTT broker, tried versions 1.6, 1.6.12, 2.0.4
  • tried openhab 3.0.0 and 3.1.0-snapshot, clean installs and everything
  • Platform information:
    • Hardware: Raspi 4
    • OS: Raspian, current/latest
    • Java Runtime Environment: whatever is in the official docker image
    • openHAB version: (dockerized) 3.0.0, 3.1.0-snapshot

If you have a mosquitto broker, was do you install another broker (the System broker)?

The OH “System Broker” isn’t a mqtt broker itself, rather it is a default, read-only connection to a separate mqtt component (mosquitto in my case), which the OH MQTT binding brings with it, cannot be turned off/removed, and which leads to a Thing being automatically generated to represent this default/system broker connection.

It is possible to remove that auto-generated thing, and functionally that system broker connection isn’t needed in my setup. However, I do not want to begin a from-scratch installation with some fundamental issue, that is also messing up my log files (due to the OH3-mosquitto connection attempts failing continually).

Perhaps I’m not understanding a nuance here, but why not use the MQTT Broker Thing, instead of the System MQTT Broker Thing? Isn’t System MQTT Broker Thing a relic from when the MQTT Binding shipped with an internal MQTT broker? As OH3 doesn’t ship with this internal MQTT broker anymore, I don’t know what System MQTT Broker does…

I do not know why the MQTT binding comes with that system broker concept - what I can see is that it’s there (on top-level settings screen), and that it doesn’t work in OH3.

Note: in OH2, the system broker of the MQTT binding is the bridge I use for interacting with the MQTT devices in my installation - in v2 builds, this works fine (also using mosquito)

Just wanted to raise the hand on this one - is there any other input? Or is that MQTT System Broker entity just not working at the moment?

Forget about the System MQTT Broker Thing - no one seems to actually know why it exists.

Use the MQTT Broker Thing to create a Bridge to Mosquitto, as outlined in the forum here, or in the docs here.

Ok, then I’ll try to redo my setup so that I don’t get log-spammed with error messages from that system broker’s attempts to connect, and proceed with my migration.

Can I request that the system broker stuff gets cleaned out/removed, then? Would avoid similar confusions down the line, and help declutter the settings screen a tiny bit…

If you raise an issue in the add-ons section of GitHub you’ll get the attention of the developer:

The system broker is not an addon :slight_smile:

I did have it working in one of the milestones and it dose connect to the TLS port by default.

The system MQTT broker no longer exists - OH3 doesn’t come with an embedded broker.

The option for the System MQTT Broker Bridge Thing comes when you install the MQTT Binding, hence the issue needs raising in the add-ons section of GitHub!

mqtt_things.1f060431~2

1 Like

Ok, now that makes some sense (still inconcruent with v2 installations using the system broker for mosquitto as well, not just moquette - but whatever).

Then I’ll definitely raise an issue to remove this system broker stuff, because it sounds like it shouldn’t be there in the first place in v3!

You set it up here

I keep getting connection reset by peer
Its working now

Guys, just when I thought we were agreeing you’ve confused me again.

I know that the system broker connection is set up on the main settings screen - that is the gripe I had with the entire concept: if it’s there on that level, I’d expect that bit to work just like a non-system broker thing.
@denominator : did you do anything special to get it to work? Are you using TLS? Because that connection is what is causing the problems I’m seeing (I’m not using TLS though, and a non-standard port…)

Nothing Special

Someone may change it in the future