Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish a message on MQTT-SN to a short topic with QOS=-1 #716

Open
marcoratto opened this issue Dec 18, 2024 · 0 comments
Open

Publish a message on MQTT-SN to a short topic with QOS=-1 #716

marcoratto opened this issue Dec 18, 2024 · 0 comments

Comments

@marcoratto
Copy link

Expected behavior

Publish a message via MQTT-SN on a short topic using QOS=-1

Actual behavior

Dump on the Edge and there is a Java Exception

To Reproduce

I used the following tools:
Docker-desktop
HiveMQ Edge installed with the following docker command:

docker run --name hivemq-edge -d -p 1883:1883 -p 8080:8080 -p 2442:2442/udp hivemq/hivemq-edge

Steps

Step 1: MQTT subscribe
mosquitto_sub -h 127.0.0.1 -p 1883 -t tt

Step 2: MQTT-SN publish
mqtt-sn-pub -h 127.0.0.1 -p 2442 -t tt -q -1 -m "Hello World"

Reproducer code

Details

Wireshark

12 0c 62 74 74 00 00 48 65 6c 6c 6f 20 57 6f 72 6c 64

Frame 24962: 50 bytes on wire (400 bits), 50 bytes captured (400 bits) on interface lo0, id 0
Null/Loopback
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
User Datagram Protocol, Src Port: 58496, Dst Port: 2442
MQ Telemetry Transport Protocol for Sensor Networks
Message
Message Type: Publish Message (0x0c)
Message Length: 18
0... .... = DUP: No
.11. .... = QoS: No Connection required (0x3)
...0 .... = Retain: No
.... ..10 = Topic ID Type: Short Topic Name (0x2)
Topic ID: 29812
Message ID: 0
Message: Hello World

Stacktrace

2024-12-18 10:27:40 2024-12-18 09:27:40,324 INFO - creating initial client connection in channel for UdpChannel{518561227, remote=/172.17.0.1:59836} -> oid 518561227
2024-12-18 10:27:40 2024-12-18 09:27:40,336 WARN - Error encountered during transcoding - null
2024-12-18 10:27:40 java.lang.NullPointerException: null
2024-12-18 10:27:40 at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:903)
2024-12-18 10:27:40 at com.hivemq.mqttsn.MqttsnTopicRegistry.readTopicName(MqttsnTopicRegistry.java:57)
2024-12-18 10:27:40 at com.hivemq.codec.transcoder.MqttsnToMqtt5Transcoder.transcode(MqttsnToMqtt5Transcoder.java:131)
2024-12-18 10:27:40 at com.hivemq.codec.transcoder.MqttsnToMqtt5Transcoder.transcode(MqttsnToMqtt5Transcoder.java:61)
2024-12-18 10:27:40 at com.hivemq.codec.decoder.mqttsn.MqttSnDecoder.decode(MqttSnDecoder.java:106)
2024-12-18 10:27:40 at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530)
2024-12-18 10:27:40 at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469)
2024-12-18 10:27:40 at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-12-18 10:27:40 at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-12-18 10:27:40 at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
2024-12-18 10:27:40 at com.hivemq.bootstrap.netty.udp.UdpChannel.doBeginRead(UdpChannel.java:95)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannel$AbstractUnsafe.beginRead(AbstractChannel.java:834)
2024-12-18 10:27:40 at io.netty.channel.DefaultChannelPipeline$HeadContext.read(DefaultChannelPipeline.java:1362)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.invokeRead(AbstractChannelHandlerContext.java:845)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.read(AbstractChannelHandlerContext.java:824)
2024-12-18 10:27:40 at io.netty.channel.DefaultChannelPipeline.read(DefaultChannelPipeline.java:1004)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannel.read(AbstractChannel.java:290)
2024-12-18 10:27:40 at io.netty.channel.DefaultChannelPipeline$HeadContext.readIfIsAutoRead(DefaultChannelPipeline.java:1422)
2024-12-18 10:27:40 at io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1400)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:258)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:238)
2024-12-18 10:27:40 at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:522)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannel$AbstractUnsafe.register(AbstractChannel.java:480)
2024-12-18 10:27:40 at io.netty.channel.SingleThreadEventLoop.register(SingleThreadEventLoop.java:89)
2024-12-18 10:27:40 at io.netty.channel.SingleThreadEventLoop.register(SingleThreadEventLoop.java:83)
2024-12-18 10:27:40 at io.netty.channel.MultithreadEventLoopGroup.register(MultithreadEventLoopGroup.java:86)
2024-12-18 10:27:40 at io.netty.bootstrap.ServerBootstrap$ServerBootstrapAcceptor.channelRead(ServerBootstrap.java:241)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
2024-12-18 10:27:40 at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61)
2024-12-18 10:27:40 at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:425)
2024-12-18 10:27:40 at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
2024-12-18 10:27:40 at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
2024-12-18 10:27:40 at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
2024-12-18 10:27:40 at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
2024-12-18 10:27:40 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
2024-12-18 10:27:40 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
2024-12-18 10:27:40 at java.base/java.lang.Thread.run(Unknown Source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant