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

MQTTv5 Publish Returns "No Matching Subscribers" Even When Subscribers are Subscribed on 2.0.19 #3128

Open
kent-bowling-bytetrail opened this issue Oct 8, 2024 · 1 comment
Labels
Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Milestone

Comments

@kent-bowling-bytetrail
Copy link

kent-bowling-bytetrail commented Oct 8, 2024

I'm running Mosquitto via Docker on Ubuntu 22.04 using the eclipse-mosquitto image tagged 2.0.19-openssl. Our software pays attention to see if clients are subscribed when doing a PUBLISH, and doesn't PUBLISH additional extra information if nobody is subscribed and listening. Starting with 2.0.19, all PUBLISH's via MQTTv5 are returning 16 (AKA 0x10), which indicates nobody is subscribed (even when other clients are).

This does not happen on the 2.0.18 image and seems to have started for me because I was using "latest".

I have attached a zip file with a Python script (and requirements.txt) and a mosquitto.conf file that together will run the test to show the problem. This does use docker (via Python Docker SDK) and outputs the following. Notice how on 2.0.18 the Published message callback returns a 0 and on 2.0.19 it's a 16 (No matching subscribers). The output also captures all of mosquitto's logging which also shows the same thing via "rc 0" and "rc 16".

*********** 2.0.18-openssl ***********
Subscriber connected with result code Success
test b'Hello World'
Publisher connected with result code Success
Published message with id 1 - rc: 0 (Success)
chown: /mosquitto/config/mosquitto.conf: Read-only file system
1728355348: mosquitto version 2.0.18 starting
1728355348: Config loaded from /mosquitto/config/mosquitto.conf.
1728355348: Opening ipv4 listen socket on port 1883.
1728355348: Opening ipv6 listen socket on port 1883.
1728355348: mosquitto version 2.0.18 running
1728355353: New connection from 172.17.0.1:34966 on port 1883.
1728355353: New client connected from 172.17.0.1:34966 as sub_client (p5, c1, k30).
1728355353: No will message specified.
1728355353: Sending CONNACK to sub_client (0, 0)
1728355353: Received SUBSCRIBE from sub_client
1728355353:     test (QoS 1)
1728355353: sub_client 1 test
1728355353: Sending SUBACK to sub_client
1728355358: New connection from 172.17.0.1:34982 on port 1883.
1728355358: New client connected from 172.17.0.1:34982 as pub_client (p5, c1, k30).
1728355358: No will message specified.
1728355358: Sending CONNACK to pub_client (0, 0)
1728355358: Received PUBLISH from pub_client (d0, q1, r0, m1, 'test', ... (11 bytes))
1728355358: Sending PUBLISH to sub_client (d0, q1, r0, m1, 'test', ... (11 bytes))
1728355358: Sending PUBACK to pub_client (m1, rc0)
1728355358: Received PUBACK from sub_client (Mid: 1, RC:0)
1728355364: Client sub_client closed its connection.
1728355364: Client pub_client closed its connection.

*********** 2.0.19-openssl ***********
Subscriber connected with result code Success
test b'Hello World'
Publisher connected with result code Success
Published message with id 1 - rc: 16 (No matching subscribers)
chown: /mosquitto/config/mosquitto.conf: Read-only file system
1728355365: mosquitto version 2.0.19 starting
1728355365: Config loaded from /mosquitto/config/mosquitto.conf.
1728355365: Opening ipv4 listen socket on port 1883.
1728355365: Opening ipv6 listen socket on port 1883.
1728355365: mosquitto version 2.0.19 running
1728355370: New connection from 172.17.0.1:41458 on port 1883.
1728355370: New client connected from 172.17.0.1:41458 as sub_client (p5, c1, k30).
1728355370: No will message specified.
1728355370: Sending CONNACK to sub_client (0, 0)
1728355370: Received SUBSCRIBE from sub_client
1728355370:     test (QoS 1)
1728355370: sub_client 1 test
1728355370: Sending SUBACK to sub_client
1728355375: New connection from 172.17.0.1:42628 on port 1883.
1728355375: New client connected from 172.17.0.1:42628 as pub_client (p5, c1, k30).
1728355375: No will message specified.
1728355375: Sending CONNACK to pub_client (0, 0)
1728355375: Received PUBLISH from pub_client (d0, q1, r0, m1, 'test', ... (11 bytes))
1728355375: Sending PUBLISH to sub_client (d0, q1, r0, m1, 'test', ... (11 bytes))
1728355375: Sending PUBACK to pub_client (m1, rc16)
1728355375: Received PUBACK from sub_client (Mid: 1, RC:0)
1728355381: Client sub_client closed its connection.
1728355381: Client pub_client closed its connection.

test.zip

@ralight
Copy link
Contributor

ralight commented Oct 8, 2024

Thanks for the report and the script, I've got a fix for it and will be releasing 2.0.20 soon.

@ralight ralight added Type: Bug Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. labels Oct 8, 2024
@ralight ralight added this to the 2.0.20 milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants