question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

asyncio Warning: BrokerProtocolHandler Unhandled exception in reader coro: IncompleteReadError

See original GitHub issue

I get a lot of warning on Ubuntu 17.10 like this

[2018-03-30 13:05:45,416] :: WARNING - BrokerProtocolHandler Unhandled exception in reader coro: IncompleteReadError('0 bytes read on a total of 1 expected bytes',)

here’s the version

 python3 --version
Python 3.6.3
 pip3 freeze | grep hbmqtt
hbmqtt==0.9.2
hbmqtt
[2018-03-30 13:05:35,165] :: INFO - Exited state new
[2018-03-30 13:05:35,165] :: INFO - Entered state starting
[2018-03-30 13:05:35,166] :: INFO - Listener 'default' bind to 0.0.0.0:1883 (max_connections=-1)
[2018-03-30 13:05:35,166] :: INFO - Exited state starting
[2018-03-30 13:05:35,166] :: INFO - Entered state started
[2018-03-30 13:05:45,413] :: INFO - Listener 'default': 1 connections acquired
[2018-03-30 13:05:45,413] :: INFO - Connection from 127.0.0.1:49098 on listener 'default'
[2018-03-30 13:05:45,414] :: INFO - Exited state new
[2018-03-30 13:05:45,414] :: INFO - Entered state connected
[2018-03-30 13:05:45,416] :: WARNING - BrokerProtocolHandler Unhandled exception in reader coro: IncompleteReadError('0 bytes read on a total of 1 expected bytes',)
[2018-03-30 13:05:45,416] :: INFO - Exited state connected
[2018-03-30 13:05:45,417] :: INFO - Entered state disconnected
[2018-03-30 13:05:45,417] :: INFO - Listener 'default': 0 connections acquired

hbmqtt_pub --url "mqtt://localhost:1883" -t "test/sensor1" -m "ciao"
[2018-03-30 13:05:45,409] :: INFO - hbmqtt_pub/13323-nicklang-laptop Connecting to broker
[2018-03-30 13:05:45,415] :: INFO - Exited state new
[2018-03-30 13:05:45,415] :: INFO - Entered state connected
[2018-03-30 13:05:45,415] :: INFO - hbmqtt_pub/13323-nicklang-laptop Publishing to 'test/sensor1'
[2018-03-30 13:05:45,416] :: INFO - Exited state connected
[2018-03-30 13:05:45,416] :: INFO - Entered state disconnected
[2018-03-30 13:05:45,416] :: INFO - hbmqtt_pub/13323-nicklang-laptop Disconnected from broker

the broker work fine but I get warning for every sent message

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:20 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
joopycommented, Sep 9, 2018

I ‘fixed’ it by not useing hbmqtt anymore. Now using mosquitto.

5reactions
ramonpocacommented, Oct 16, 2018

Ok, think I’ve found out:

  • Client is running in a mixed async/sync environment.
  • A reload process lasting more than 10 seconds was blocking processing, and so hbmqtt wasn’t able to send the keepalive PING on time.
  • Solution/hotfix: Increase the client keepalive to a larger value from the default 10 seconds.
Read more comments on GitHub >

github_iconTop Results From Across the Web

IncompleteReadError('0 bytes read on a total of 1 expected ...
Hi everyone, I updated ha to the last version0.86.4 and looking at the log file I'm still having this issue: 2019-01-29 21:26:09 WARNING...
Read more >
Tidying up after unhandled exception in Python asyncio task
At present, this code will trigger the exception within its task, and that task will abort. Without the custom exception handler the other...
Read more >
Exceptions — Python 3.11.1 documentation
This exception can be caught to perform custom operations when asyncio Tasks are cancelled. In almost all situations the exception must be re-raised....
Read more >
How to Handle Asyncio Task Exceptions - Super Fast Python
Wrap the coro coroutine into a Task and schedule its execution. ... When a coroutine awaits a task that raises an unhandled exception, ......
Read more >
Async IO in Python: A Complete Walkthrough
The async / await Syntax and Native Coroutines. A Word of Caution: Be careful what you read out there on the Internet. Python's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found