hbmqtt icon indicating copy to clipboard operation
hbmqtt copied to clipboard

"'NoneType' object has no attribute 'delivered_message_queue'" when losing connection

Open hongquan opened this issue 7 years ago • 3 comments

Steps to reproduce

  1. Run a script which use hbmqtt, connecting to Mosquitto broker.
  2. Restart the broker, to cause a temporary disconnection.

What happened:

hbmqtt failed:

2018-02-01 14:22:46 INFO:__main__: MQTT payload from daothanh/r2/ds/02: bytearray(b'1')
Disconnected from broker
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/quan/Works/AgriConnect/PlantingHouse/controlview/collector/__main__.py", line 228, in <module>
    loop.run_until_complete(asyncio.gather(*coroutines))
  File "uvloop/loop.pyx", line 1364, in uvloop.loop.Loop.run_until_complete
  File "/home/quan/Works/AgriConnect/PlantingHouse/controlview/collector/__main__.py", line 199, in collect_mqtt
    message = await mqtt_client.deliver_message(MQTT_TIMEOUT)
  File "/home/quan/Works/Envs/agri/lib/python3.6/site-packages/hbmqtt/client.py", line 335, in deliver_message
    return deliver_task.result()
  File "/home/quan/Works/Envs/agri/lib/python3.6/site-packages/hbmqtt/mqtt/protocol/handler.py", line 466, in mqtt_deliver_next_message
    message = yield from self.session.delivered_message_queue.get()
AttributeError: 'NoneType' object has no attribute 'delivered_message_queue'

What is expected

hbmqtt should not fail, because it can reconnect the MQTT.

hongquan avatar Feb 01 '18 07:02 hongquan

I have also seen this issue. I'm looking into another issue (#119), and will see if I can figure anything out for this issue as well.

caseybrichardson avatar Jan 24 '20 17:01 caseybrichardson

We are seeing this issue as well with hbmqtt 0.9.6

adm78 avatar May 05 '20 18:05 adm78

We are seeing this issue as well with hbmqtt 0.9.6

Same problem, same 0.9.6 version

MikeMint avatar Jul 14 '20 19:07 MikeMint