Skip to content

Client keep_alive must be non-zero to connect to default mosquitto 2.0.13  #904

@DavidAntliff

Description

@DavidAntliff

Hi, I've been happily using this library with mosquitto 2.0.11 for a few months.
I've recently attempted to update to mosquitto 2.0.12 & 2.0.13 and run into a connection problem. The server is rejecting client connections with error 2 (identifier_rejected).

I'm using commit 29f93bc (and was previously using 70e45c2, which has the same issue).

Mosquitto broker log:

mosquitto  | 1636940175: New client connected from 172.18.0.1:42770 as MyMQTTClient (p2, c1, k0).
mosquitto  | 1636940175: No will message specified.
mosquitto  | 1636939846: Sending CONNACK to MyMQTTClient (0, 2)
mosquitto  | 1636939846: Bad socket read/write on client MyMQTTClient: Invalid arguments provided.

In my client->set_connack_handler(bool sp, mqtt::connect_return_code connack_return_code) callback I'm getting sp is false, and connack_return_code is 2, or identifier_rejected.

I don't personally understand the exact issue, so I'm bringing it to your attention because some other client implementations have had the same issue lately, and you might better understand the implications:

telegraf: https://community.influxdata.com/t/get-identifier-rejected-error-while-using-outputs-mqtt-mosquitto-version-is-2-0-12/21702
micropython: https://forum.micropython.org/viewtopic.php?t=11076&p=60836

Perhaps this is also relevant? A breaking change in mosquitto for a zero keepalive value sent by a client?
eclipse-mosquitto/mosquitto#2117

For now I can remain with mosquitto 2.0.11 but if you'd like me to test any changes against 2.0.12 or 2.0.13 I can do this fairly easily at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions