2.4 Embedded MQTT topic max topic level?

Hi,

I’m not sure if this is an MQTT topic length problem, or a node-red issue or I am doing something wrong. Please help me directing the right way.

I have a running OH 2.4 setup with node-red. I tried a very simple scenario in node-red where I have an MQTT input and a debug output. I set the MQTT input’s topic to home/sensors/config/# then I send a message with MQTT explorer (or with a node-red inject object) to the home/config/sensors/config/get topic. Everything is fine I can see my test message in the debug window.
But if I set the MQTT input’s topic to home/sensors/config/get and I want to send the same message with the same way as before I will get an OH java.lang.IllegalStateException error in the log and the mqtt stops working for the sender client until I fully restart OH. In this case even if I update the MQTT input object to home/sensors/config/# I will receive the same exception in OH whatever message I’m sending with whatever topic. In the meanwhile other clients can communicate with the broker fine.

Is this also a known issue or limitation regarding the embedded MQTT? Can I only have 3 ‘tags’ in the topic?

Oh, the exact exception is:

2019-11-06 18:38:52.151 [WARN ] [netty.channel.DefaultChannelPipeline] - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.

java.lang.IllegalStateException: Target session RPi-Node-Red is connected but doesn't anymore subscribed to [filter:home/sensors/config/get, cliID: RPi-Node-Red, qos: null, active: true]

	at io.moquette.spi.impl.subscriptions.CTrieSubscriptionDirectory.match(CTrieSubscriptionDirectory.java:116) ~[228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.moquette.spi.impl.subscriptions.CTrieSubscriptionDirectory.matches(CTrieSubscriptionDirectory.java:89) ~[228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.moquette.spi.impl.MessagesPublisher.publish2Subscribers(MessagesPublisher.java:76) ~[228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.moquette.spi.impl.Qos0PublishHandler.receivedPublishQos0(Qos0PublishHandler.java:59) ~[228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.moquette.spi.impl.ProtocolProcessor.processPublish(ProtocolProcessor.java:457) ~[228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.moquette.server.netty.NettyMQTTHandler.channelRead(NettyMQTTHandler.java:58) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.moquette.server.netty.metrics.MQTTMessageLogger.channelRead(MQTTMessageLogger.java:45) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.moquette.server.netty.metrics.MessageMetricsHandler.channelRead(MessageMetricsHandler.java:50) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.moquette.server.netty.metrics.BytesMetricsHandler.channelRead(BytesMetricsHandler.java:51) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:141) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [228:org.eclipse.smarthome.io.mqttembeddedbroker:0.10.0.oh240]

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

Ok, now I would delete this post, but in that case nobody would learnt from my mistake.
It seems the topic cannot ended to “get”. Maybe it is a reserve word?!
If I edit my topic to home/sensors/config/getcnfg then it works fine.

Guys, just ignore my post please. :slight_smile:

I‘m not aware of any such restriction. I‘ll look that up.

Thanks! I’m looking forward to hear your results.

There are no reserved words in the spec, so if it behaves like that, it‘s a bug. I‘m not sure if it is in the embedded broker or the client implementation. I‘ll try to add a test for that when I fix the integrations tests.

Sidenote: Since 2.4 a lot of changes have been made to both components, so it is possible that this is already fixed.

Thanks for checking!

I’m not sure if I will have time today but probably at the weekend I can try to upgrade to 2.5 M4 to see if the behavior is the same if that helps.

I have updated to 2.5.0.M4 and the problem disappeared.
Now I can send messages to */get - */set topics

Edit: Iaccidently installed OH snapshot then downgraded and it seems I have some snapshot left behing. See my other post.
Now I’m not sure is this get/set issue is solved by OH 2.5.0.M4 or by the snapshot build. For details, please check the other topic.

1 Like

Whatever version did solve it: it‘s working with latest version.