Stuck after losting mqtt connection #1

Closed
opened 2026-02-13 06:56:48 +00:00 by juandragop · 1 comment
Owner
ERROR:root:[code:4] The client is not currently connected.
aiomqtt.exceptions.MqttCodeError: [code:128] Unspecified error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/meshtastic/lib/python3.13/site-packages/deltachat_rpc_client/client.py", line 136, in _on_event
    hook(event)
    ~~~~^^^^^^^
  File "/root/meshtastic/bot.py", line 210, in new_message
    asyncio.run(mqtt_client.publish(config.publish_topic(channel_id), bytes(message)))
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 112, in decorated
    return await method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 504, in publish
    raise MqttCodeError(
        info.rc, "Could not publish message"
    ) from self._disconnected.exception()
aiomqtt.exceptions.MqttCodeError: [code:4] The client is not currently connected.
ERROR:root:[code:4] The client is not currently connected.
aiomqtt.exceptions.MqttCodeError: [code:128] Unspecified error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/meshtastic/lib/python3.13/site-packages/deltachat_rpc_client/client.py", line 136, in _on_event
    hook(event)
    ~~~~^^^^^^^
  File "/root/meshtastic/bot.py", line 210, in new_message
    asyncio.run(mqtt_client.publish(config.publish_topic(channel_id), bytes(message)))
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 112, in decorated
    return await method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 504, in publish
    raise MqttCodeError(
        info.rc, "Could not publish message"
    ) from self._disconnected.exception()
aiomqtt.exceptions.MqttCodeError: [code:4] The client is not currently connected.
ERROR:root:[code:4] The client is not currently connected.
aiomqtt.exceptions.MqttCodeError: [code:128] Unspecified error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/meshtastic/lib/python3.13/site-packages/deltachat_rpc_client/client.py", line 136, in _on_event
    hook(event)
    ~~~~^^^^^^^
  File "/root/meshtastic/bot.py", line 210, in new_message
    asyncio.run(mqtt_client.publish(config.publish_topic(channel_id), bytes(message)))
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 112, in decorated
    return await method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 504, in publish
    raise MqttCodeError(
        info.rc, "Could not publish message"
    ) from self._disconnected.exception()
aiomqtt.exceptions.MqttCodeError: [code:4] The client is not currently connected.
``` ERROR:root:[code:4] The client is not currently connected. aiomqtt.exceptions.MqttCodeError: [code:128] Unspecified error The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/root/meshtastic/lib/python3.13/site-packages/deltachat_rpc_client/client.py", line 136, in _on_event hook(event) ~~~~^^^^^^^ File "/root/meshtastic/bot.py", line 210, in new_message asyncio.run(mqtt_client.publish(config.publish_topic(channel_id), bytes(message))) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run return runner.run(main) ~~~~~~~~~~^^^^^^ File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete return future.result() ~~~~~~~~~~~~~^^ File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 112, in decorated return await method(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 504, in publish raise MqttCodeError( info.rc, "Could not publish message" ) from self._disconnected.exception() aiomqtt.exceptions.MqttCodeError: [code:4] The client is not currently connected. ERROR:root:[code:4] The client is not currently connected. aiomqtt.exceptions.MqttCodeError: [code:128] Unspecified error The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/root/meshtastic/lib/python3.13/site-packages/deltachat_rpc_client/client.py", line 136, in _on_event hook(event) ~~~~^^^^^^^ File "/root/meshtastic/bot.py", line 210, in new_message asyncio.run(mqtt_client.publish(config.publish_topic(channel_id), bytes(message))) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run return runner.run(main) ~~~~~~~~~~^^^^^^ File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete return future.result() ~~~~~~~~~~~~~^^ File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 112, in decorated return await method(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 504, in publish raise MqttCodeError( info.rc, "Could not publish message" ) from self._disconnected.exception() aiomqtt.exceptions.MqttCodeError: [code:4] The client is not currently connected. ERROR:root:[code:4] The client is not currently connected. aiomqtt.exceptions.MqttCodeError: [code:128] Unspecified error The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/root/meshtastic/lib/python3.13/site-packages/deltachat_rpc_client/client.py", line 136, in _on_event hook(event) ~~~~^^^^^^^ File "/root/meshtastic/bot.py", line 210, in new_message asyncio.run(mqtt_client.publish(config.publish_topic(channel_id), bytes(message))) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run return runner.run(main) ~~~~~~~~~~^^^^^^ File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete return future.result() ~~~~~~~~~~~~~^^ File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 112, in decorated return await method(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/meshtastic/lib/python3.13/site-packages/aiomqtt/client.py", line 504, in publish raise MqttCodeError( info.rc, "Could not publish message" ) from self._disconnected.exception() aiomqtt.exceptions.MqttCodeError: [code:4] The client is not currently connected. ```
Author
Owner

aiomqtt doesn't have solution without hacks: https://github.com/empicano/aiomqtt/issues/334

aiomqtt doesn't have solution without hacks: https://github.com/empicano/aiomqtt/issues/334
juandragop referenced this issue from a commit 2026-03-05 19:55:10 +00:00
juandragop referenced this issue from a commit 2026-03-28 14:13:46 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
project26/meshdelta#1
No description provided.