MQTT broker - Server closed connection without DISCONNECT

Tags: #<Tag:0x00007f61696415a0> #<Tag:0x00007f6169641488> #<Tag:0x00007f6169641398>

Use the console to restart the bundle.

There bundles are installed when you install MQTT. Nothing wrong with that.

@roryd did you look at the link above

The binding needs Homie stuff whether you use it or not. If no Homie self-identifying messages arrive, it doesn’t do anything. File inder “unused feature”.

I did, but it’s a bit beyond my pay-grade. I’m starting to reach the limits of my expertise…

Quick update - did this:

  • sudo apt purge openhab2*
  • rebooted
  • reinstalled openhab2
  • restored from a backup from September, well before I had these issues.

Still the same problem. Next step is to wipe the disk and reinstall from scratch.

Did you look at the mosquitto log?

Okay, so I’ve now done this:

  • Created a brand new VM
  • Installed Ubuntu 18.04 LTS (no post install updates applied)
  • Installed zulu-8
  • Installed openhab2.5 main
  • Added MQTT Binding
  • Added MQTT Broker thing
  • Configured broker exactly as other systems

Same error again, yet mosquitto_sub works fine:

I also installed openhab 2.4 on Synology and the broker works fine on that.

Finally, I downgraded my main box from 2.5.0-1 to 2.4.0-1 and the broker started working again. Upgraded back to 2.5.0-1 and the broker stops working again. So I got busy upgrading…

2.4.0-1 works
2.5.0~M2-1 works
2.5.0~M3-1 works
2.5.0~M4-1 works
2.5.0~M5-1 does not work

Downgraded to 2.5.0-M4-1 and the broker works again.

Okay so I upgraded from 2.5.0~M4-1 to S1772-1 and the broker didn’t work there.

I also downgraded my second OH installation to M4 (different network entirely) and that also started working again.

Did you set different clientids? Some brokers don‘t allow two connections with the same client id

The client IDs are identical, but they are both on diffferent sites, and both talking to different brokers, so there’s no connectivity at all between the two systems or brokers.

Please set org.eclipse.smarthome.io.transport.mqtt and com.hivemq to TRACE and show the output. Please also set the broker to debug logging and show that, too.

I’m back on M4 now as that’s working for me - do you want me to do the trace on that or 2.5.0-1?

M4 is not helping (old underlying mqtt library). 2.5.0 would be great.

Hi,

it seems to be the same error as here I setup debug envronment and run into the same exception. Additionally, log file is flood with

[.incoming.MqttIncomingPublishService] - No publish flow registered for MqttStatefulPublish{stateless=MqttPublish{topic=$aws/things/<blid>/shadow/update, payload=121byte, qos=AT_MOST_ONCE, retain=false}, packetIdentifier=-1, dup=false, topicAlias=0, subscriptionIdentifiers=[]}

Things definition can be found here

Please, ping me in case any assistance is need

Kind regards,

Alexander

Jan, is this what I need to set?

log:set TRACE org.eclipse.smarthome.io.transport.mqtt
log:set TRACE com.hivemq.client.mqtt
log:set DEBUG org.eclipse.smarthome.mqttbroker
log:set TRACE org.openhab.binding.mqtt

Here’s what I get when I create the broker:

09:24:23.852 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@2f470034 to discovery topic homeassistant/# on broker mqtt:broker:e6bcc300
09:24:23.853 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.homie.internal.discovery.Homie300Discovery@614e0cd3 to discovery topic +/+/$homie on broker mqtt:broker:e6bcc300
09:24:23.856 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:broker:e6bcc300' changed from UNINITIALIZED to INITIALIZING
09:24:23.860 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:broker:e6bcc300' changed from INITIALIZING to OFFLINE
09:24:23.864 [INFO ] [o.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'openhab' with clientid a3dfe15c-3c20-4d78-b869-391bd902dcea
09:24:23.866 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@2f470034 to discovery topic homeassistant/# on broker mqtt:broker:e6bcc300
09:24:23.867 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.homie.internal.discovery.Homie300Discovery@614e0cd3 to discovery topic +/+/$homie on broker mqtt:broker:e6bcc300
09:24:23.876 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:broker:e6bcc300' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Timeout
09:24:23.877 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:broker:e6bcc300' changed from OFFLINE (COMMUNICATION_ERROR): Timeout to OFFLINE (COMMUNICATION_ERROR): Server closed connection without DISCONNECT.

@falkena @J-N-K Is this what you need?

@roryd are you configuring your mqtt thing in a file or PaperUI?

Also, may help to post your mqtt config.

I’m configuring mqtt via Paper UI, so no mqtt.cfg (apart from the default one with all the options commented out).

Do you use the embeddedbroker? I understood you use mosquitto. If you use the embedded broker: Try mosquitto. The embedded broker has bugs. If you use mosquitto: with “broker” I meant mosquitto. Not sure about the syntax.

The other logs look goof, but I need around 20 lines after the initial connect, around 20 lines before and after the disconnect.

I installed the MQTT binding from Paper UI.

I had deleted the broker from Paper UI and then recreated it, and that resulted in the logs above.

I’m away from that system for the night, but I’ll redo the logs in the morning and post the results.

1 Like