Intermittent connection issues

Hi HiveMQ team

We are using HiveMQ Community Edition 2023.9 with a relatively old MQTTNet client (3.0.16) with mutual TLS (certificates broker-side and client-side).

The MQTTNet client is running on .NET Framework 4.6.2, and we are investigating whether it will run on .NET Framework 4.8.

This works swimmingly on almost all systems where we have tested it. However, on a single VM running Windows Server 2016 we are encountering issues maintaining a stable connection.

I see this in the event.log:

2024-02-20 09:12:24,178 - Client ID: S1X-13444, IP: 127.0.0.1, Clean Start: true, Session Expiry: 0 connected.

2024-02-20 09:23:28,479 - Client ID: S1X-12880 session has expired at 2024-02-20 15:08:23. All persistent data for this client has been removed.

2024-02-20 09:38:05,699 - Client ID: S1X-13444, IP: 127.0.0.1 disconnected ungracefully from TCP Listener with TLS on port: 8883.

2024-02-20 09:38:53,869 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:39:17,710 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:39:42,222 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:40:06,036 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:40:31,337 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:40:55,521 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:41:19,418 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:41:43,922 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:42:08,221 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:42:32,218 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:42:56,146 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:43:20,259 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:44:03,893 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:44:28,039 - Client ID: UNKNOWN, IP: 127.0.0.1 was disconnected. reason: No CONNECT sent in time.

2024-02-20 09:44:33,051 - Client ID: S1X-13444 session has expired at 2024-02-20 15:38:05. All persistent data for this client has been removed.

So it seems our old MQTTnet client might have issues sending a CONNECT message in time. I am setting up a test run with logging from inside that client, so we can see if there was an exception that killed a CONNECT keepalive thread.

The client and the broker are on the same machine, hence the IP address of 127.0.0.1. The VM is running on a VMWare VM.

Do you have any experience with anything similar?

Thanks!

Hello @EmbeddedHacker

It’s hard to troubleshoot without knowing which type of exception messages are being thrown by the MQTTnet client. Also, if you can capture some network packets (Wireshark) on this Windows Server VM would be great to investigate why the connection is unstable.

Are you using IP address of 127.0.0.1 in your MQTTnet clients as broker hostname?

Is there a specific reason why you’re not using the latest version of HiveMQ CE and MQTTnet?

Kind regards,
Diego from HiveMQ Team

Thanks Diego!

I’m a bit hesitant to post Wireshark captures on a public forum, but I will contact a HiveMQ representative which we’ve had contact with before. I’ll give you all the details via that person.

Regards