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

Mosquitto clients 2.0.2 fails to communicate with Mosquitto broker 1.6.12 #1957

Closed
Peoh opened this issue Dec 16, 2020 · 2 comments
Closed
Milestone

Comments

@Peoh
Copy link

Peoh commented Dec 16, 2020

Hello,

We work with mosquitto since 2 years, and it works like a charm. We update to last versions as soon as possible to fix the possible issues, but this time I think I encountered one :)

Setup to reproduce the error:

  • Broker on ARM board, version 1.6.12, with a simple configuration (see below)
  • Clients (mosquitto_sub was used) version 2.0.2, on Ubuntu 16.04, on x64 machine.

This is what I tested

  • On the ARM board, applications using libmosquitto (1.6.12) works fine
  • On the ARM board, mosquitto_sub works fine
  • On the x64 machine, mosquitto_sub c'ant connect

This is the what I got from the broker (1.6.12)

mosquitto -c /etc/mosquitto/mosquitto.conf -v
1608125082: mosquitto version 1.6.12 starting
1608125082: Config loaded from /etc/mosquitto/mosquitto.conf.
1608125082: Opening ipv4 listen socket on port 8883.
1608125082: Opening ipv6 listen socket on port 8883.
1608125082: Warning: Address family not supported by protocol
1608125082: mosquitto version 1.6.12 running
1608125389: New connection from 192.168.1.44 on port 8883.
1608125389: Client <unknown> disconnected due to protocol error.
1608125449: New connection from 192.168.1.44 on port 8883.
1608125449: Client <unknown> disconnected due to protocol error.

And this is what I got from mosquitto_sub on the x64 (2.0.2)

mosquitto_sub -h 192.168.1.90 -p 8883 -t "#" -d -v                         
Client (null) sending CONNECT
Client (null) sending CONNECT

mosquitto_sub is unresponsive and I have to kill it with a SIGKILL (or wait some time).

The configuration on the broker is the following (really minimal):

user mosquitto
set_tcp_nodelay true
port 8883

I would like to note that the mosquitto_sub worked with a previous version on my x64 machine. After update to 2.0.2 it does not work.

If you want more tests or details, feel free to ask.

@ralight ralight added this to the 2.0.3 milestone Dec 17, 2020
@ralight
Copy link
Contributor

ralight commented Dec 17, 2020

Thanks for the report. There are two things to address:

First mosquitto_sub not responding to ctrl-c. This occurred because it was assuming a successful connection would be made, and then try to disconnect gracefully. If the connection wasn't made, as in this case, it couldn't disconnect gracefully but wouldn't quit any other way.

Second, the client not connecting. This is because the behaviour of the mosquitto clients has changed if you use port 8883. Port 8883 is reserved for TLS encrypted MQTT connections, and the clients will now load the system CA certificates and use TLS mode if you use port 8883 and don't specify your own certificates. So I'd suggest either changing to use port 1883, or adding TLS encryption to your listener.

@Peoh
Copy link
Author

Peoh commented Dec 17, 2020

Thank you for the update, I was using 8883 port because I will use TLS encryption later in the project. I will come back to 1883 for the development phase.
Thanks a lot!

fAuernigg pushed a commit to fAuernigg/mosquitto that referenced this issue Jan 4, 2021
This occured if a successful connection was not made.

Closes eclipse#1957. Thanks to Peoh.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants