MQTT stops working in OH2.5

Have you stopped OH, cleaned the cache, and rebooted since updating? I needed that plus 3 OH restarts for my system to work correctly.

Also note that restdocs have moved from misc to ui so check in your addons.cfg that it’s listed properly.

I have stopped openHAB at least four times and performed an:
openhab-cli clean-cache
Which made my self created items disappear so did a touch items/* too

I have not rebooted yet, I don’t reboot my server often: it is my fileserver/webserver etc.
Is there a connection between restdocs and mqtt? But as Restdocs is mentioned in the release notes, yes: I did change that from misc to ui,

Only need to clean cache once, it’s the restarts that are needed.

Can you post the contents of /var/lib/openhab2/config/org/openhab/addons.config and etc/openhab2/services/addons.cfg

What I meant is: restarted at least 4 times (as mqtt stops working after a while and a reboot solves it) and did a cache clean only once :slight_smile:

/var/lib/openhab2/config/org/openhab/addons.config

:org.apache.felix.configadmin.revision:=L"10"
action=""
binding="zwave,\ hue,\ \ astro,\ harmonyhub,\ squeezebox,\ mqtt,\ astro,\ kodi,\ expire1,\ http1,\ airquality"
legacy="true"
misc="openhabcloud,\ hueemulation\ ,\ homekit,\ mqttbroker"
package="standard"
persistence="jdbc-mariadb"
remote="true"
service.pid="org.openhab.addons"
transformation="map,\ jsonpath"
ui="habmin,\ restdocs,\ paper,\ basic"
voice=""

/etc/openhab2/services/addons.cfg

# The base installation package of this openHAB instance (default is "standard")
# Valid options:
#   - minimal  : Installation only with dashboard, but no UIs or other addons
#   - standard : Typical installation with all standards UIs
#   - demo     : A demo setup which includes UIs, a few bindings, config files etc.
#
package = standard

# Access Remote Add-on Repositories
# Defines whether the remote openHAB add-on repository should be used for browsing and installing add-ons.
# This not only makes latest snapshots of add-ons available, it is also required for the installation of
# any legacy 1.x add-on and all experimental features. (default is false for offline distro, true for online distro)
#
remote = true

# Include legacy 1.x bindings. If set to true, it also allows the installation of 1.x bindings for which there is
# already a 2.x version available (requires remote repo access, see above). (default is false)
#
legacy = true

# Include experimental add-ons. If set to true, it also allows the installation of extensions that are not (yet) part
# of the official distribution and need further testing (requires remote repo access, see above). (default is false)
#
#experimental = true


# A comma-separated list of bindings to install (e.g. "sonos,knx,zwave")
binding = zwave, hue,  astro, harmonyhub, squeezebox, mqtt, astro, kodi, expire1, http1, airquality
#binding = ,amazondashbutton


# A comma-separated list of UIs to install (e.g. "basic,paper")
ui = habmin, restdocs, paper, basic

# A comma-separated list of persistence services to install (e.g. "rrd4j,jpa")
persistence = jdbc-mariadb

# A comma-separated list of actions to install (e.g. "mail,pushover")
action =

# A comma-separated list of transformation services to install (e.g. "map,jsonpath")
transformation = map, jsonpath

# A comma-separated list of voice services to install (e.g. "marytts,freetts")
voice =

# A comma-separated list of miscellaneous services to install (e.g. "myopenhab")
misc = openhabcloud, hueemulation , homekit, mqttbroker

Go to your addons.cfg and remove the extra spaces (as seen in addons.config as \ \ ) as you should only have a single space between bindings and restart.

After the restart check the console for the binding version of mqtt and verify it’s active. Use command bundle:list to show everything and look for any duplicates as well.

I have removed the spaces from my addons.cfg
restarted openhab (which means that it will work fine for a few hours, keeping fingers crossed if it will after that) Had a look at the bundle list and can’t find any duplicates, except for:

 21 │ Active │  80 │ 18.0.0                  │ Guava: Google Core Libraries for Java
 22 │ Active │  80 │ 27.1.0.jre              │ Guava: Google Core Libraries for Java

The versions of mqtt:

openhab> bundle:list | grep -i mq
212 x Active x  80 x 1.1.2                   x hivemq-mqtt-client
217 x Active x  80 x 4.1.42.Final            x Netty/Codec/MQTT
255 x Active x  80 x 2.5.0                   x openHAB Add-ons :: Bundles :: MQTT Broker Binding
256 x Active x  81 x 2.5.0                   x openHAB Add-ons :: Bundles :: MQTT Things and Channels
257 x Active x  82 x 2.5.0                   x openHAB Add-ons :: Bundles :: MQTT HomeAssistant Convention
258 x Active x  82 x 2.5.0                   x openHAB Add-ons :: Bundles :: MQTT Homie Convention
268 x Active x  80 x 2.5.0                   x openHAB Core :: Bundles :: MQTT Transport
276 x Active x  75 x 2.5.0                   x openHAB Add-ons :: Bundles :: IO :: MQTT Broker Moquette

Number 276 do you use the embedded broker as it lacks support? I recommend moving to mosquitto.

Now I am a bit confused: I thought the whole point of version 2.4 was to replace the old 1.x mqtt binding and move to a 2.x binding supporting things. At the same time adding an internal broker that would be the way forward.

Basically I moved from mosquitto (openhab 1.8) to openhab2 using old binding and openhab 2.4 using internal broker and things…

You can still use mosquitto with mqtt 2.5.

For more detail on the differences see this topic.

BTW: When I upgraded I had to restart OH 3 times before everything was working correctly.

Also just remembered this in the upgrade notes:

MQTT Binding

Homie channel names may have changed if special characters are used for MQTT topic names.

Yes, saw that too. But as I am not using any special characters (and assumed none of my devices is using homie anyway) I thought I had that covered.

Now in the process of reviving my mosquitto setup (probably all I need to do is systemctl start moquitto and replacing the embedded broker
:slight_smile:

1 Like

Just making sure.:wink:

Sound good.:+1:

Up and running with mosquitto. Adding mosquitto was so simple and straightforward that I had a bit of doubt if it was indeed using mosquitto and not the embedded broker :slight_smile:
Let’s see if it keeps running but I guess so: mosquitto always appeared to be pretty stable…

Thanks @H102!

1 Like

The only time I like a mosquito.:rofl:

I would also recommend uninstalling the embedded broker as I’ve read having both installed may cause an issue.

Let me know how it turns out, very curious, as others have run into issues with upgrading and we are trying to make a somewhat list.

Thanks

What I did:

  1. remove (uninstall) the embedded broker
  2. remove the broker thing
  3. start mosquitto
  4. add mqtt thing, it found mosquitto

done

Will let you know if it still works tomorrow

Now I need to remove some of the errors in my log files: never really look at them but see that there are some messages there that shouldn’t be…

Thanks and for the errors I had some until I restarted OH 3 times.

I think the mosquitto broker solved the problem. But I am not out of the woods completely:
I get a lof of warnings in my openhab.log, these are related to GenericMQTTThingHandler but I can’t find which item or thing to look at

2019-12-30 09:18:26.610 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'min': null
java.lang.NumberFormatException: null
        at java.math.BigDecimal.<init>(BigDecimal.java:599) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:809) ~[?:1.8.0_232]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.objectConvert(ConfigMapper.java:157) ~[bundleFile:?]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:98) [bundleFile:?]
        at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:80) [bundleFile:?]
        at org.openhab.binding.mqtt.generic.internal.handler.GenericMQTTThingHandler.initialize(GenericMQTTThingHandler.java:151) [bundleFile:?]
        at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2019-12-30 09:18:26.613 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'max': null
java.lang.NumberFormatException: null
        at java.math.BigDecimal.<init>(BigDecimal.java:599) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:809) ~[?:1.8.0_232]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.objectConvert(ConfigMapper.java:157) ~[bundleFile:?]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:98) [bundleFile:?]
        at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:80) [bundleFile:?]
        at org.openhab.binding.mqtt.generic.internal.handler.GenericMQTTThingHandler.initialize(GenericMQTTThingHandler.java:151) [bundleFile:?]
        at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2019-12-30 09:18:26.688 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'min': null
java.lang.NumberFormatException: null
        at java.math.BigDecimal.<init>(BigDecimal.java:599) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:809) ~[?:1.8.0_232]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.objectConvert(ConfigMapper.java:157) ~[bundleFile:?]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:98) [bundleFile:?]
        at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:80) [bundleFile:?]
        at org.openhab.binding.mqtt.generic.internal.handler.GenericMQTTThingHandler.initialize(GenericMQTTThingHandler.java:151) [bundleFile:?]
        at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2019-12-30 09:18:26.690 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'max': null
java.lang.NumberFormatException: null
        at java.math.BigDecimal.<init>(BigDecimal.java:599) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:809) ~[?:1.8.0_232]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.objectConvert(ConfigMapper.java:157) ~[bundleFile:?]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:98) [bundleFile:?]
        at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:80) [bundleFile:?]
        at org.openhab.binding.mqtt.generic.internal.handler.GenericMQTTThingHandler.initialize(GenericMQTTThingHandler.java:151) [bundleFile:?]
        at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2019-12-30 09:18:26.693 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'min': null
java.lang.NumberFormatException: null
        at java.math.BigDecimal.<init>(BigDecimal.java:599) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:809) ~[?:1.8.0_232]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.objectConvert(ConfigMapper.java:157) ~[bundleFile:?]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:98) [bundleFile:?]
        at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:80) [bundleFile:?]
        at org.openhab.binding.mqtt.generic.internal.handler.GenericMQTTThingHandler.initialize(GenericMQTTThingHandler.java:151) [bundleFile:?]
        at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2019-12-30 09:18:26.695 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'max': null
java.lang.NumberFormatException: null
        at java.math.BigDecimal.<init>(BigDecimal.java:599) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:809) ~[?:1.8.0_232]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.objectConvert(ConfigMapper.java:157) ~[bundleFile:?]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:98) [bundleFile:?]
        at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:80) [bundleFile:?]
        at org.openhab.binding.mqtt.generic.internal.handler.GenericMQTTThingHandler.initialize(GenericMQTTThingHandler.java:151) [bundleFile:?]
        at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2019-12-30 09:18:26.697 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'min': null
java.lang.NumberFormatException: null
        at java.math.BigDecimal.<init>(BigDecimal.java:599) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:1.8.0_232]
        at java.math.BigDecimal.<init>(BigDecimal.java:809) ~[?:1.8.0_232]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.objectConvert(ConfigMapper.java:157) ~[bundleFile:?]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:98) [bundleFile:?]
        at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:80) [bundleFile:?]
        at org.openhab.binding.mqtt.generic.internal.handler.GenericMQTTThingHandler.initialize(GenericMQTTThingHandler.java:151) [bundleFile:?]
        at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

Ok, solved that one by adding min and max values to all involved channels in the things (percentages and temperatures)

Glad you got the min max figured out.:+1: Sorry for slow response, had to get some sleep.:crazy_face: Guess I should have mentioned you may need to set a few things after the change but didn’t really know what all you had in your files.

Please click the square box on solution post to mark the topic solved.

Thanks and have a happy new year!

What??? You need to sleep? :smiley: thanks and have a great end to the year and an even better start of the new one!

1 Like