MQTT Reconnecting very often after update to 3.1

After upgrading to 3.1 stable from 3.1M5, I’m noticing MQTT reconnecting very often. A log snippet is below and not much help to me. Is there anyway to determine if this is a real connection issue and if so, what could be causing something like this? I’m not sure how to troubleshoot this one with the limited log information.

openHAB 3.1 stable
Raspberry Pi4
Mosquitto Broker on Synology NAS

2021-06-30 21:23:06.882 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.1.7'. Next attempt in 60000ms
2021-06-30 21:23:06.892 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.1.7' with clientid Oh3MqttBrokerThing 
2021-06-30 21:23:07.250 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MT_GuestBedroom:temp
2021-06-30 21:23:07.824 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MQTT_Garage_OH:temp
2021-06-30 21:23:07.830 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MQTT_Garage_OH:temp
2021-06-30 21:23:07.868 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MQTT_Garage_OH:atemp
2021-06-30 21:23:07.905 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MQTT_Garage_OH:atemp
2021-06-30 21:23:15.328 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MT_Kitchen:temp
2021-06-30 21:23:15.334 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MT_Kitchen:temp
2021-06-30 21:23:15.370 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MT_Kitchen:CO2
2021-06-30 21:23:16.057 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MT_Master:temp
2021-06-30 21:23:16.061 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MT_Master:temp2021-06-30 21:23:16.730 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MT_HomePC:temp2021-06-30 21:23:16.736 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:MQTTBroker:MT_HomePC:temp
2021-06-30 21:23:26.909 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.1.7'. Next attempt in 60000ms
2021-06-30 21:23:26.915 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.1.7' with clientid Oh3MqttBrokerThing

Is MQTT otherwise working? Mosquitto is running properly? Do you have anything else trying to connect to Mosquitto with the ID Oh3MqttBrokerThing (another device, or another program, or maybe two Thing bridges in openHAB)?

I had similar issues. And did this:

Settings → Other Services → MQTT → check “Show Advanced” → Change the keep alive value(e.g. to 20) → save → change it back to 60

That worked for me.
Unfortunately I have to do that after every restart.

@hafniumzinc
Thanks for this tip. I forgot I upgraded my test system at the same time and left it running by accident, so both systems with identical configuration were running. It had nothing to do with the version of openHAB i was on.

Duplicate client ids….that was why on clicked on this topic to offer that as a reason if none other had been posted.

One solution I’ve found is to try and code the machine name into the client I’d “openHAB-frank”. As if you run a test machine somewhere else, at least they won’t clash