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

**URL:** <https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599>\
**Category:** Installation\
**Created:** [December 27, 2020, 7:00pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599 "2020-12-27T19:00:36Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![dk.mailbox](https://community.openhab.org/user_avatar/community.openhab.org/dk.mailbox/32/46228_2.png) [@dk.mailbox](https://community.openhab.org/u/dk.mailbox)\
**Post date:** [December 27, 2020, 7:00pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/1 "2020-12-27T19:00:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [December 27, 2020, 7:05pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/2 "2020-12-27T19:05:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dk.mailbox](https://community.openhab.org/user_avatar/community.openhab.org/dk.mailbox/32/46228_2.png) [@dk.mailbox](https://community.openhab.org/u/dk.mailbox)\
**Post date:** [December 27, 2020, 8:04pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/3 "2020-12-27T20:04:27Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![hafniumzinc](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@hafniumzinc](https://community.openhab.org/u/hafniumzinc)\
**Post date:** [December 27, 2020, 8:25pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/4 "2020-12-27T20:25:15Z")

</div>

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…

> [@\[OH3\] MQTT Setup and Configuration](https://community.openhab.org/t/oh3-mqtt-setup-and-configuration/111494):
>
> Overview In order to use MQTT devices, the following is required: An MQTT broker installed MQTT Binding installed in openHAB MQTT Bridge Thing configured in openHAB This tutorial was written with openHAB3 running on a headless Raspberry Pi 3B with Raspberry Pi OS, with SSH access. Method 1. Install the MQTT broker Install [Mosquitto](https://mosquitto.org/download/) On the Raspberry Pi, perform the following commands to install Mosquitto, and ensure it runs when re-starting the Pi: sudo apt install mosquitto sudo systemctl …

> **[Adding Things - Advanced](https://www.openhab.org/docs/tutorial/things_advanced.html#create-the-bridge-thing)**
>
> a vendor and technology agnostic open source automation software for your home

---

<div class="post-metadata">

**Author:** ![dk.mailbox](https://community.openhab.org/user_avatar/community.openhab.org/dk.mailbox/32/46228_2.png) [@dk.mailbox](https://community.openhab.org/u/dk.mailbox)\
**Post date:** [December 27, 2020, 8:39pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/5 "2020-12-27T20:39:37Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![dk.mailbox](https://community.openhab.org/user_avatar/community.openhab.org/dk.mailbox/32/46228_2.png) [@dk.mailbox](https://community.openhab.org/u/dk.mailbox)\
**Post date:** [January 1, 2021, 8:36pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/6 "2021-01-01T20:36:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![hafniumzinc](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@hafniumzinc](https://community.openhab.org/u/hafniumzinc)\
**Post date:** [January 1, 2021, 8:44pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/7 "2021-01-01T20:44:05Z")

</div>

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](https://community.openhab.org/t/oh3-mqtt-setup-and-configuration/111494), or in [the docs here](https://www.openhab.org/docs/tutorial/things_advanced.html).

---

<div class="post-metadata">

**Author:** ![dk.mailbox](https://community.openhab.org/user_avatar/community.openhab.org/dk.mailbox/32/46228_2.png) [@dk.mailbox](https://community.openhab.org/u/dk.mailbox)\
**Post date:** [January 1, 2021, 8:51pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/8 "2021-01-01T20:51:50Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![hafniumzinc](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@hafniumzinc](https://community.openhab.org/u/hafniumzinc)\
**Post date:** [January 1, 2021, 8:55pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/9 "2021-01-01T20:55:12Z")

</div>

> [@dk.mailbox](#):
>
> 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:

> **[GitHub - openhab/openhab-addons: Add-ons for openHAB](https://github.com/openhab/openhab-addons)**
>
> Add-ons for openHAB

---

<div class="post-metadata">

**Author:** ![denominator](https://community.openhab.org/user_avatar/community.openhab.org/denominator/32/37349_2.png) [@denominator](https://community.openhab.org/u/denominator)\
**Post date:** [January 1, 2021, 9:29pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/10 "2021-01-01T21:29:36Z")

</div>

The system broker is not an addon 🙂

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

---

<div class="post-metadata">

**Author:** ![hafniumzinc](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@hafniumzinc](https://community.openhab.org/u/hafniumzinc)\
**Post date:** [January 1, 2021, 9:38pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/11 "2021-01-01T21:38:15Z")

</div>

> [@denominator](#):
>
> system broker

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](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/0/d/0d2411678d48dd7e86a93e6781bda2453706f2d8.png)

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [January 1, 2021, 9:45pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/12 "2021-01-01T21:45:31Z")

</div>

> [@dk.mailbox](#):
>
> I do not know why the MQTT binding comes with that system broker concept

> [@OH3 MQTT Problem](https://community.openhab.org/t/oh3-mqtt-problem/110990/10):
>
> Good. You don’t need any System Broker Thing unless you use the embedded broker app (Moquette) - and that’s been removed from OH3 for support reasons. You just want an ordinary broker Thing pointing to your pre-existing MQTT broker, Mosquitto or whatever you use.

---

<div class="post-metadata">

**Author:** ![dk.mailbox](https://community.openhab.org/user_avatar/community.openhab.org/dk.mailbox/32/46228_2.png) [@dk.mailbox](https://community.openhab.org/u/dk.mailbox)\
**Post date:** [January 1, 2021, 9:56pm UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/13 "2021-01-01T21:56:38Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![denominator](https://community.openhab.org/user_avatar/community.openhab.org/denominator/32/37349_2.png) [@denominator](https://community.openhab.org/u/denominator)\
**Post date:** [January 2, 2021, 12:16am UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/14 "2021-01-02T00:16:04Z")

</div>

You set it up here

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b00aebe1ee807f569ee80baa0ad8e4e31790fef5.png)

I keep getting connection reset by peer  
Its working now

![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/3/d/3d31a6b05daa8cad2a4dedd092e5778607b00f82.png)

---

<div class="post-metadata">

**Author:** ![dk.mailbox](https://community.openhab.org/user_avatar/community.openhab.org/dk.mailbox/32/46228_2.png) [@dk.mailbox](https://community.openhab.org/u/dk.mailbox)\
**Post date:** [January 2, 2021, 10:00am UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/15 "2021-01-02T10:00:04Z")

</div>

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…)

---

<div class="post-metadata">

**Author:** ![denominator](https://community.openhab.org/user_avatar/community.openhab.org/denominator/32/37349_2.png) [@denominator](https://community.openhab.org/u/denominator)\
**Post date:** [January 2, 2021, 10:32am UTC](https://community.openhab.org/t/oh3-mqtt-system-broker-protocol-error-server-closed-connection-without-disconnect/111599/16 "2021-01-02T10:32:12Z")

</div>

Nothing Special

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/7/8/78e0f108adc26ba9748e3dc0663e703450126efa.png)

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/c/7/c787e68cfea7b866be8426c0ab13cbbe945c1653.png)

Someone may change it in the future
