You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setup.
Mosquitto broker v2.0.19 built/running on Pi Zero W .
Operating system is Dietpi (Raspbian variant of Debian Bookworm).
2 clients running on the same device are connected , one is based on the Paho Java Client (keepalive 60s) , the other is mqtt.js based (also keepalive 60s).
Broker also acting as bridge to a remote cloud based broker.
No persistence.
Issue.
Intermittently (after several hours or so, although it can take longer) the Paho client gets suddenly disconnected by the broker which logs a keepalive timeout as the reason for disconnection.
In each case the last pub and sub to Mosquitto have been within the most recent keepalive period (i.e. much less then the 1.5 * keepalive timeout).
Log excerpt:
1728664952: Received PINGREQ from 180645f5
1728664952: Sending PINGRESP to 180645f5
1728664953: Received PUBLISH from 180645f5 (d0, q1, r0, m422, 'gateway2/00000000180645F5/bridge/request/health_check', ... (0 bytes))
1728664953: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/request/health_check', ... (0 bytes))
1728664953: Sending PUBACK to 180645f5 (m422, rc0)
1728664953: Received PUBLISH from mqttjs_625841e0 (d0, q0, r1, m0, 'gateway2/00000000180645F5/bridge/devices', ... (22060 bytes))
1728664953: Sending PUBLISH to 180645f5 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/devices', ... (22060 bytes))
1728664953: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/devices', ... (22060 bytes))
1728664953: Received PUBLISH from mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/logging', ... (174 bytes))
1728664953: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/logging', ... (174 bytes))
1728664953: Received PUBLISH from mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/response/health_check', ... (39 bytes))
1728664953: Sending PUBLISH to 180645f5 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/response/health_check', ... (39 bytes))
1728664953: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/response/health_check', ... (39 bytes))
1728664956: Received PINGREQ from mqttjs_625841e0
1728664956: Sending PINGRESP to mqttjs_625841e0
1728664956: Received PUBLISH from mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/logging', ... (608 bytes))
1728664956: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/logging', ... (608 bytes))
1728664956: Sending PINGREQ to local.00000000180645F5
1728664956: Received PUBLISH from mqttjs_625841e0 (d0, q1, r0, m2109, 'gateway2/00000000180645F5/device/XXXXXXX', ... (426 bytes))
1728664956: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/device/XXXXXXXX', ... (426 bytes))
1728664956: Sending PUBLISH to local.00000000180645F5 (d0, q1, r0, m806, 'gateway2/00000000180645F5/device/XXXXXXX', ... (426 bytes))
1728664956: Sending PUBACK to mqttjs_625841e0 (m2109, rc0)
1728664956: Received PINGRESP from local.00000000180645F5
1728664956: Received PUBACK from local.00000000180645F5 (Mid: 806, RC:0)
1728664956: Received PUBLISH from mqttjs_625841e0 (d0, q1, r0, m2110, 'gateway2/00000000180645F5/device/XXXXXXX', ... (426 bytes))
1728664956: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/device/XXXXXX', ... (426 bytes))
1728664956: Sending PUBLISH to local.00000000180645F5 (d0, q1, r0, m807, 'gateway2/00000000180645F5/device/XXXXXX', ... (426 bytes))
1728664956: Sending PUBACK to mqttjs_625841e0 (m2110, rc0)
1728664956: Received PUBACK from local.00000000180645F5 (Mid: 807, RC:0)
1728664956: Received PINGREQ from mqttjs_625841e0
1728664956: Sending PINGRESP to mqttjs_625841e0
1728664956: Client 180645f5 has exceeded timeout, disconnecting.
1728665091: mosquitto version 2.0.19 terminating
As this log excerpt shows, the timeout is about 4s after the previous PINGREQ from the client...?
This happens with no warnings or anything else seemingly as the cause.
The text was updated successfully, but these errors were encountered:
Just to add, it's occurred with every version I have used - 2.0.11, 2.0.12. 2.0.18 - whether installed through APT or built on the device.
RobLeighton67
changed the title
Mosquitto broker disconnects local client prematurely - assuming keep a;ive timeout
Mosquitto broker disconnects local client prematurely - claiming keepalive timeout has occurred.
Oct 16, 2024
Setup.
Mosquitto broker v2.0.19 built/running on Pi Zero W .
Operating system is Dietpi (Raspbian variant of Debian Bookworm).
2 clients running on the same device are connected , one is based on the Paho Java Client (keepalive 60s) , the other is mqtt.js based (also keepalive 60s).
Broker also acting as bridge to a remote cloud based broker.
No persistence.
Issue.
Intermittently (after several hours or so, although it can take longer) the Paho client gets suddenly disconnected by the broker which logs a keepalive timeout as the reason for disconnection.
In each case the last pub and sub to Mosquitto have been within the most recent keepalive period (i.e. much less then the 1.5 * keepalive timeout).
Log excerpt:
1728664952: Received PINGREQ from 180645f5
1728664952: Sending PINGRESP to 180645f5
1728664953: Received PUBLISH from 180645f5 (d0, q1, r0, m422, 'gateway2/00000000180645F5/bridge/request/health_check', ... (0 bytes))
1728664953: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/request/health_check', ... (0 bytes))
1728664953: Sending PUBACK to 180645f5 (m422, rc0)
1728664953: Received PUBLISH from mqttjs_625841e0 (d0, q0, r1, m0, 'gateway2/00000000180645F5/bridge/devices', ... (22060 bytes))
1728664953: Sending PUBLISH to 180645f5 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/devices', ... (22060 bytes))
1728664953: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/devices', ... (22060 bytes))
1728664953: Received PUBLISH from mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/logging', ... (174 bytes))
1728664953: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/logging', ... (174 bytes))
1728664953: Received PUBLISH from mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/response/health_check', ... (39 bytes))
1728664953: Sending PUBLISH to 180645f5 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/response/health_check', ... (39 bytes))
1728664953: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/response/health_check', ... (39 bytes))
1728664956: Received PINGREQ from mqttjs_625841e0
1728664956: Sending PINGRESP to mqttjs_625841e0
1728664956: Received PUBLISH from mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/logging', ... (608 bytes))
1728664956: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/bridge/logging', ... (608 bytes))
1728664956: Sending PINGREQ to local.00000000180645F5
1728664956: Received PUBLISH from mqttjs_625841e0 (d0, q1, r0, m2109, 'gateway2/00000000180645F5/device/XXXXXXX', ... (426 bytes))
1728664956: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/device/XXXXXXXX', ... (426 bytes))
1728664956: Sending PUBLISH to local.00000000180645F5 (d0, q1, r0, m806, 'gateway2/00000000180645F5/device/XXXXXXX', ... (426 bytes))
1728664956: Sending PUBACK to mqttjs_625841e0 (m2109, rc0)
1728664956: Received PINGRESP from local.00000000180645F5
1728664956: Received PUBACK from local.00000000180645F5 (Mid: 806, RC:0)
1728664956: Received PUBLISH from mqttjs_625841e0 (d0, q1, r0, m2110, 'gateway2/00000000180645F5/device/XXXXXXX', ... (426 bytes))
1728664956: Sending PUBLISH to mqttjs_625841e0 (d0, q0, r0, m0, 'gateway2/00000000180645F5/device/XXXXXX', ... (426 bytes))
1728664956: Sending PUBLISH to local.00000000180645F5 (d0, q1, r0, m807, 'gateway2/00000000180645F5/device/XXXXXX', ... (426 bytes))
1728664956: Sending PUBACK to mqttjs_625841e0 (m2110, rc0)
1728664956: Received PUBACK from local.00000000180645F5 (Mid: 807, RC:0)
1728664956: Received PINGREQ from mqttjs_625841e0
1728664956: Sending PINGRESP to mqttjs_625841e0
1728664956: Client 180645f5 has exceeded timeout, disconnecting.
1728665091: mosquitto version 2.0.19 terminating
As this log excerpt shows, the timeout is about 4s after the previous PINGREQ from the client...?
This happens with no warnings or anything else seemingly as the cause.
The text was updated successfully, but these errors were encountered: