I’ve just installed the embedded MQTT browser in OH2.4
I’ve got this message. I tried the installation sometimes without success.
What is needed, too?
I’m using a Pi3
2019-01-04 21:55:19.289 [ERROR] [ipse.smarthome.io.mqttembeddedbroker] - bundle org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240 (255)[org.eclipse.smarthome.io.mqttembeddedbroker.internal.EmbeddedBrokerServiceImpl(309)] : The activate method has thrown an exception
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
at sun.nio.ch.Net.bind(Net.java:433) ~[?:?]
at sun.nio.ch.Net.bind(Net.java:425) ~[?:?]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:?]
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128) ~[?:?]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:558) ~[?:?]
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1283) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[?:?]
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:989) ~[?:?]
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:254) ~[?:?]
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:364) ~[?:?]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[?:?]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[?:?]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[?:?]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) ~[?:?]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
==> /var/log/openhab2/events.log <==
2019-01-04 21:55:19.602 [thome.event.ExtensionEvent] - Extension 'misc-mqttbroker' has been installed.
OH2.4 Embedded MQTT Broker is waiting for something… but what?
bundle:list|grep -i mq
254 x Active x 80 x 1.2.0 x Paho MQTT Client
255 x Waiting x 80 x 0.10.0.oh240 x Eclipse SmartHome Embedded MQTT Broker
256 x Active x 80 x 0.10.0.oh240 x Eclipse SmartHome MQTT Transport Bundle
See the log file. Another process is blocking the standard MQTT port. There is definitely another broker running. Or for some bizarre reasons the embedded broker started twice. But I really doubt that.
Check the command output of netstat -tulpen | grep 1883.
You were right. There was Mosquitto installed from previously tests some weeks / month ago.
I’ve removed all old packages.
pi@pi3:/etc/openhab2 $ netstat -tulpen | grep 1883
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 0 10742 -
tcp6 0 0 :::1883 :::* LISTEN 0 10743 -
pi@pi3:/etc/openhab2 $ dpkg -l | grep mosq
ii libmosquitto1:armhf 1.4.10-3+deb9u2 armhf MQTT version 3.1/3.1.1 client library
ii mosquitto 1.4.10-3+deb9u2 armhf MQTT version 3.1/3.1.1 compatible message broker
ii mosquitto-clients 1.4.10-3+deb9u2 armhf Mosquitto command line MQTT clients
pi@pi3:/etc/openhab2 $
I’ve removed OH2.4 broker and reinstalled. Now I have this message.
But something is there at IPv6 1883
It must be OH2.4 because after removing Mosquitto there was nothing.
$ netstat -tulpen | grep 1883
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::1883 :::* LISTEN 109 8339522 -
2019-01-05 12:14:51.518 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-misc-mqttbroker'
2019-01-05 12:17:26.103 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'localhost' with clientid paho954884091350266 and file store '/var/lib/openhab2/mqtt/localhost'
2019-01-05 12:17:28.219 [WARN ] [r.internal.EmbeddedBrokerServiceImpl] - Embedded broker offline - Reason unknown
2019-01-05 12:17:28.238 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '127.0.0.1' with clientid embedded-mqtt-broker and file store '/var/lib/openhab2/mqtt/127.0.0.1'
2019-01-05 12:17:28.665 [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=embedded-mqtt-broker
2019-01-05 12:17:28.690 [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=embedded-mqtt-broker
2019-01-05 12:18:26.175 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to 'localhost'. Next attempt in 10000ms
2019-01-05 12:18:26.200 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'localhost' with clientid paho954884091350266 and file store '/var/lib/openhab2/mqtt/localhost'
2019-01-05 12:18:36.220 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to 'localhost'. Next attempt in 10000ms
2019-01-05 12:18:36.232 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'localhost' with clientid paho954884091350266 and file store '/var/lib/openhab2/mqtt/localhost'
2019-01-05 12:18:46.235 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to 'localhost'. Next attempt in 10000ms
2019-01-05 12:18:46.247 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'localhost' with clientid paho954884091350266 and file store '/var/lib/openhab2/mqtt/localhost'
And of course netstat before and after re-installing.
pi@pi3:/etc/openhab2 $ netstat -tulpen | grep 1883
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
pi@pi3:/etc/openhab2 $ netstat -tulpen | grep 1883
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::1883 :::* LISTEN 109 8346307 -
Is 127.0.0.1 configured to be localhost on your system? That is required. Otherwise I don’t see a problem. The internal mqttconnection can’t establish a connection to the broker. That’s strange.
Try mosquitto_sub or any another mqtt client to connect to the broker.
But only at IPv6 address the broker seems to accept connections. How can I setup to accept on IPv4, too?
$ netstat -tulpen | grep 1883
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::1883 :::* LISTEN 109 8346307 -
That’s normal. Coming from the broker, I have no influence on that. Will probably change with a broker update at some point (there is a new release already available).
IPv6… ok. The brokerconnection class should be IP agnostic. Apparently it isn’t. And the reason is simple: It doesn’t connect to “localhost”, it connects to “127.0.0.1”… Sigh. Could you please create a bug report on github on the eclipse smarthome project? Thanks.
The workaround is: Disable IPv6 interfaces while booting up openHAB and re-enable them after. IPv6 is the future so shouldn’t permanently be disabled.