core: Zeroconf chokes: "zeroconf._exceptions.IncomingDecodeError: Bad domain name (circular)"
The problem
See error snippet below. Error comes back after HA restart.
What is version of Home Assistant Core has the issue?
core-2021.8.0
What was the last working version of Home Assistant Core?
core-2021.7.4
What type of installation are you running?
Home Assistant Container
Integration causing the issue
zeroconf
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zeroconf/
Example YAML snippet
No response
Anything in the logs that might be useful for us?
2021-08-04 13:21:55 WARNING (MainThread) [zeroconf] Choked at offset 121 while unpacking b'\x00\x00\x84\x00\x00\x00\x00\x05\x00\x00\x00\x00\x05_miio\x04_udp\x05local\x00\x00\x0c\x00\x01\x00\x00\x00x\x00$!roborock-vacuum-s5e_miio416112328\xc0\x0c!roborock-vacuum-s5e_miio416112328\x00\x00/\x80\x01\x00\x00\x00x\x00\t\xc0y\x00\x05@\x00\x00\x00\x00\xc0L\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8X\xd4\xc0(\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd41\xc0L\xc0(\x00\x10\x80\x01\x00\x00\x00x\x00\x0f\x0epath=/mydevice'
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/zeroconf/_protocol.py", line 101, in __init__
self.read_others()
File "/usr/local/lib/python3.9/site-packages/zeroconf/_protocol.py", line 206, in read_others
name = self.read_name()
File "/usr/local/lib/python3.9/site-packages/zeroconf/_protocol.py", line 261, in read_name
raise IncomingDecodeError(f"Bad domain name (circular) at {off}")
zeroconf._exceptions.IncomingDecodeError: Bad domain name (circular) at 121
Additional information
The vacuum is a Roborock S5 and seems to work fine otherwise.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 33 (26 by maintainers)
Commits related to this issue
- Add support for forward dns compression pointers (#934) - nslookup supports these and some implementations (likely avahi) will generate them - Careful attention was given to make sure we detect... — committed to python-zeroconf/python-zeroconf by bdraco 3 years ago
- Bump zeroconf to 0.33.3 Fixes home-assistant/core#53937 Fixes home-assistant/core#46985 Fixes home-assistant/core#53668 — committed to bdraco/home-assistant by bdraco 3 years ago
Looks like it can handle the garbage in the NSEC next name now
Works like a charm, no more errors and all seems fine.
I know it’s been merged already, but just confirming it again that it worked for me. I manually updated my instance with the latest code, error is gone. Thank you @bdraco!
I’ve noticed that my Sonos Speakers on a different VLAN are now unavailable. Moving them over to the same subnet as Home Assistant brings them back in. The errors may be more than just informational?
The packets definitely have name compression pointers that are pointing forward instead of backwards.
nslookup does support this
dnspython disallows this Net::DNS disallows this zeroconf disallows this
If we were to allow name compression pointers that point forward we would have to be very careful not to create this vuln: https://www.kb.cert.org/vuls/id/23495/ aka https://nvd.nist.gov/vuln/detail/CVE-2000-0333
Deciphering what is actually supposed to happen is left as an exercise to the reader since there are places that conflict and contradict each other.
I’d prefer not to sweep the issue under the rug as its unlikely to get fixed at the source if we silence it. Its a real problem since the packet will get dropped and something may be relying on the data in the packet.