Error starting mqtt connection

hi to all for a few days this error appears in the log how can I solve?
Thank you all

2019-08-01 09:22:40.342 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.

2019-08-01 09:22:40.351 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ‘’

2019-08-01 09:22:40.414 [ERROR] [penhab.io.transport.mqtt.MqttService] - Error starting broker connection

Could you provide more details. Bridge/Thing configuration, more logging (from openhab start until this errror). openHAB version? Any changes you made?

Maybe this helps:

sarpberry p3 b+
openHAB 2.4.0-1 (Release Build)
i have sonoff/tasmota
astro binding
mqtt

java.lang.NullPointerException: null

at org.eclipse.smarthome.automation.module.script.defaultscope.internal.DefaultScriptScopeProvider.addThingActions(DefaultScriptScopeProvider.java:125) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:228) ~[39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) ~[39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:664) ~[39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:510) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.inject.methods.BindMethod.invoke(BindMethod.java:42) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1809) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.DependencyManager.bindDependency(DependencyManager.java:1637) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.DependencyManager.bind(DependencyManager.java:1625) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:301) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:114) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:947) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:919) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:863) [39:org.apache.felix.scr:2.1.2]

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) [?:?]

at java.security.AccessController.doPrivileged(Native Method) ~[?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) [?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) [?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) [?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:508) [?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) [?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:624) [?:?]

at org.apache.felix.scr.impl.manager.SingleRefPair.getServiceObject(SingleRefPair.java:73) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.inject.BindParameters.getServiceObject(BindParameters.java:47) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.inject.methods.BindMethod.getServiceObject(BindMethod.java:662) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.DependencyManager.getServiceObject(DependencyManager.java:2304) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1801) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1784) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:409) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:333) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:302) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1216) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1137) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:944) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:880) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1168) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:125) [39:org.apache.felix.scr:2.1.2]

at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) [?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:920) [?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]

at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) [?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) [?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) [?:?]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) [?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:469) [?:?]

at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:891) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:877) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:128) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:944) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:727) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:661) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:427) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:665) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:339) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:381) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.Activator.access$200(Activator.java:49) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:263) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.AbstractExtender.createExtension(AbstractExtender.java:196) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:169) [39:org.apache.felix.scr:2.1.2]

at org.apache.felix.scr.impl.AbstractExtender.modifiedBundle(AbstractExtender.java:49) [39:org.apache.felix.scr:2.1.2]

at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482) [?:?]

at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415) [?:?]

at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) [?:?]

at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444) [?:?]

at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908) [?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]

at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]

at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213) [?:?]

at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) [?:?]

at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) [?:?]

at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168) [?:?]

at org.eclipse.osgi.container.Module.publishEvent(Module.java:476) [?:?]

at org.eclipse.osgi.container.Module.start(Module.java:467) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

2019-08-01 09:35:01.616 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.

2019-08-01 09:35:01.619 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ‘’

2019-08-01 09:35:01.685 [ERROR] [penhab.io.transport.mqtt.MqttService] - Error starting broker connection

java.lang.IllegalArgumentException: openhabianpi-mqtt.url=tcp://localhost:1883

at org.eclipse.paho.client.mqttv3.MqttConnectOptions.validateURI(MqttConnectOptions.java:555) ~[198:org.eclipse.paho.client.mqttv3:1.2.0]

at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:463) ~[198:org.eclipse.paho.client.mqttv3:1.2.0]

at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:328) ~[198:org.eclipse.paho.client.mqttv3:1.2.0]

at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:323) ~[198:org.eclipse.paho.client.mqttv3:1.2.0]

at org.eclipse.paho.client.mqttv3.MqttClient.<init>(MqttClient.java:229) ~[198:org.eclipse.paho.client.mqttv3:1.2.0]

at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.openConnection(MqttBrokerConnection.java:312) ~[227:org.openhab.io.transport.mqtt:1.13.0]

at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.start(MqttBrokerConnection.java:97) ~[227:org.openhab.io.transport.mqtt:1.13.0]

at org.openhab.io.transport.mqtt.MqttService.updated(MqttService.java:122) [227:org.openhab.io.transport.mqtt:1.13.0]

at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [9:org.apache.felix.configadmin:1.9.4]

at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [9:org.apache.felix.configadmin:1.9.4]

at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [9:org.apache.felix.configadmin:1.9.4]

at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1102) [9:org.apache.felix.configadmin:1.9.4]

at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1058) [9:org.apache.felix.configadmin:1.9.4]

at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138) [9:org.apache.felix.configadmin:1.9.4]

at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [9:org.apache.felix.configadmin:1.9.4]

at java.lang.Thread.run(Thread.java:748) [?:?]

2019-08-01 09:35:01.688 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ‘openhabian’

==> /var/log/openhab2/events.log <==

and the openhab app has never worked outside the wifi network
I apologize but I’m just a beginner

No problem, everyone is a beginner at some point in time :slight_smile:

Could you post openhab.log ?
Are you using textual config or paperUI to configure the MQTT Bridge/Things?
If using textual, the *.things would be usefull too.

Are you using mosquitto? Or the build in broker?

https://drive.google.com/file/d/1fxnc3-DX3BBJ4yzERc-29-KXwWFF0i9C/view?usp=sharing openhab.log

use textual config
use mosquitto

where is * .things

I see several of these:

2019-08-01 09:30:49.034 [WARN ] [.MqttBrokerConnectionServiceInstance] - MqttBroker connection configuration faulty: host : You need to provide a hostname/IP!

Later on it looks like you have two connections defined (’ broker’ and ‘openhabian’)
I guess the first one is some demo/placeholder and the latter is the actual one.

2019-08-01 09:35:01.619 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection '<broker>'
2019-08-01 09:35:01.685 [ERROR] [penhab.io.transport.mqtt.MqttService] - Error starting broker connection
java.lang.IllegalArgumentException: openhabianpi-mqtt.url=tcp://localhost:1883
	[snap]
2019-08-01 09:35:01.688 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'openhabian'

I would suspect there is something wrong with your MQTT configuration in either paperUI, in textual config or both.

I would recommend to read:


(i think this would help you a lot with the example provided)


(lacks real world demo’s, but is still good to read)

I reinstall everything from scratch??

Correcting the MQTT configuration would be much easier.

Did you read the links i provided and checked your MQTT bridge configuration from the .things file?

yes I read but I didn’t understand much to be honest
where I find this .thing file?

Are you sure you are using textual configuration? Because if you are, you would have altered the .things file and if you did, you would have known where it is.

So could you post a screenshot of paperUI showing the MQTT bridge configuration (Configuration -> Things -> MQTT Broker -> edit and click show more.)

At the second screenshot, it is visible that you have enabled 1.x and 2.4 MQTT binding.
That is probably the cause of two related messages in the openhab.log one about the ‘broker’ (error) and ‘openhabian’ (no error)

I would advise to uninstall the 1.x binding. And only use the 2.4 binding. From the log and what i can see it looks like the openhabian broker is the 2.4.0 version and that is working as expected. the Sonoff MQTT thing is listed and all are marked online.

ok i uninstalled the 1x I turned off and restarted here is the log file

You can drag and drop the log file in this post a reply window (if its not to big, er zip it) a full log would give a lot more to look at.
Could you double check there is only one broker under Configuration -> things ? and check if there is a .things file in /opt/openhab2/ (i think that is the userdata fodler for openhabian, not sure)

You could check https://www.openhab.org/docs/installation/linux.html#file-locations

which one of these



the forum blocked the answers I can no longer answer

this is event.log

You have to send the openhab.log (contains information about the system) not the events.log (contains information about data changes)

I really suggest you to read the documentation. Because you find it hard to provide the right files and find them on your system, i would suggest to do a clean install (if you haven’t done much yet) and start with some basic howto’s.

I don’t think i can fix this for you at the moment.

done installed everything from scratch but now I have problems with mqtt 2.4 before I had mqtt 1 now with 2.4 I don’t see the sonoff

I have a backup of the folders etc_openhab2 and var_lib_openhab2 so then I just need to be able to connect mqtt and everything would go back to work, only I don’t remember the procedure