[Solved] Exception in callback _SelectorDatagramTransport._read_ready()

Has anyone else run into this error? It occurs once a minute. I have checked the logs and searched for solutions but can’t figure out what is causing the problem.
Here is a chunk of the log that shows the error. I don’t know what I should be looking for:

Home Assistant 2023.4.6
Supervisor 2023.04.1
Operating System 10.1
Frontend 20230411.1 - latest

2023-04-30 17:41:39.915 DEBUG (MainThread) [async_upnp_client.traffic.ssdp] Received packet from (‘10.10.10.1’, 50727): b’NOTIFY * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nCACHE-CONTROL: max-age=60\r\nLOCATION: http://10.10.10.1:5000/rootDesc.xml\r\nSERVER: OpenWRT/15.05 UPnP/1.1 MiniUPnPd/2.1\r\nNT: upnp:rootdevice\r\nUSN: uuid:8c94dec4-ea9d-42aa-b9b4-9e690cb946c4::upnp:rootdevice\r\nNTS: ssdp:alive\r\nOPT: “http://schemas.upnp.org/upnp/1/0/”; ns=01\r\n01-NLS: 1671121525\r\nBOOTID.UPNP.ORG: 1671121525\r\nCONFIGID.UPNP.ORG: 1337\r\n\r\n’
2023-04-30 17:41:39.917 DEBUG (MainThread) [async_upnp_client.traffic.ssdp] Received packet from (‘10.10.10.1’, 50727): b’NOTIFY * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nCACHE-CONTROL: max-age=60\r\nLOCATION: http://10.10.10.1:5000/rootDesc.xml\r\nSERVER: OpenWRT/15.05 UPnP/1.1 MiniUPnPd/2.1\r\nNT: upnp:rootdevice\r\nUSN: uuid:8c94dec4-ea9d-42aa-b9b4-9e690cb946c4::upnp:rootdevice\r\nNTS: ssdp:alive\r\nOPT: “http://schemas.upnp.org/upnp/1/0/”; ns=01\r\n01-NLS: 1671121525\r\nBOOTID.UPNP.ORG: 1671121525\r\nCONFIGID.UPNP.ORG: 1337\r\n\r\n’
2023-04-30 17:41:39.918 DEBUG (MainThread) [async_upnp_client.traffic.ssdp] Received packet from (‘2604:3d08:187f:d470::1’, 46298, 0, 0): b’M-SEARCH * HTTP/1.1\r\nHOST: [FF02::C]:1900\r\nMAN: “ssdp:discover”\r\nMX: 5\r\nST: ssdp:all\r\n\r\n’
2023-04-30 17:41:39.918 DEBUG (MainThread) [async_upnp_client.traffic.ssdp] Sending SSDP packet, target: (‘2604:3d08:187f:d470::1’, 46298, 0, 0), data: b’HTTP/1.1 200 OK\r\nCACHE-CONTROL:max-age=1800\r\nDATE:Mon, 01 May 2023 00:41:39 GMT\r\nSERVER:async-upnp-client/0.33.1 UPnP/2.0 Server/1.0\r\nST:upnp:rootdevice\r\nUSN:UUID:D945B8E9-F2F4-4C71-A023-1C005181F3D4::upnp:rootdevice\r\nEXT:\r\nLOCATION:http://[fe80::acbe:961a:24c2:1aa3]:40000/device.xml\r\nBOOTID.UPNP.ORG:1682901625\r\nCONFIGID.UPNP.ORG:1\r\n\r\n’
2023-04-30 17:41:39.919 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready()
Traceback (most recent call last):
File “/usr/local/lib/python3.10/asyncio/events.py”, line 80, in _run
self._context.run(self._callback, *self._args)
File “/usr/local/lib/python3.10/asyncio/selector_events.py”, line 1035, in _read_ready
self._protocol.datagram_received(data, addr)
File “/usr/local/lib/python3.10/site-packages/async_upnp_client/ssdp.py”, line 264, in datagram_received
self.on_data(request_line, headers)
File “/usr/local/lib/python3.10/site-packages/async_upnp_client/server.py”, line 316, in _on_data
self._send_response_rootdevice(remote_addr)
File “/usr/local/lib/python3.10/site-packages/async_upnp_client/server.py”, line 399, in _send_response_rootdevice
self._send_response(
File “/usr/local/lib/python3.10/site-packages/async_upnp_client/server.py”, line 467, in _send_response
self._response_socket.sendto(packet, remote_addr)
OSError: [Errno 101] Network unreachable
2023-04-30 17:41:39.927 DEBUG (MainThread) [async_upnp_client.traffic.ssdp] Received packet from (‘2604:3d08:187f:d470::1’, 46298, 0, 0): b’M-SEARCH * HTTP/1.1\r\nHOST: [FF02::C]:1900\r\nMAN: “ssdp:discover”\r\nMX: 5\r\nST: ssdp:all\r\n\r\n’

The only thing I can see is that maybe the IP6 URL is an issue?
This line in the log:

LOCATION:http://[fe80::acbe:961a:24c2:1aa3]:40000/device.xml

is not reachable but the IP4 URL above is reachable.

I checked my IP settings in System-Network and the Network Adapter eth0 displays that both the IP4 and IP6 have been detected and the numbers match.

Should I disable IP6 in HomeAssistant?
Is there something that would be blocking the IP6 connection?

Edit: I have a BitDefenderBox acting as the DHCP server and I just realized that its default configuration turns off IP6. I just went in and turned it on to see if that makes a difference.
Hopefully that was the issue and providing the IP6 will get rid of the error.

The IP6 address that was displayed in HA was not the same as the IP6 address that was given to the Pi after I turned on the IP6 DHCP setting in BitDefender. After rebooting the Pi to allow it to use the new IP6 address the error appears to be gone.

1 Like

Thanks for posting this. Switching my IP6 settings in router from “Auto” to “DHCP Server” resolved the issue.