PYTHONASYNCIODEBUG in env?: YesNot sure if this is an issue downstream with aiocoap, or uvloop. Looking for some information/direction.
Traceback (most recent call last):
File "/usr/src/app/homeassistant/components/tradfri.py", line 98, in gateway_discovered
allow_tradfri_groups)
File "/usr/src/app/homeassistant/components/tradfri.py", line 118, in _setup_gateway
api = yield from api_factory(host, key, loop=hass.loop)
File "/usr/local/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 135, in api_factory
yield from request(Command('get', ['status']))
File "/usr/local/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 97, in request
result = yield from _execute(api_commands[0])
File "/usr/local/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 84, in _execute
protocol = yield from _get_protocol()
File "/usr/local/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 53, in _get_protocol
protocol = yield from Context.create_client_context(loop=loop)
File "/usr/local/lib/python3.6/site-packages/aiocoap/protocol.py", line 524, in create_client_context
self.transport_endpoints.append((yield from TransportEndpointUDP6.create_client_transport_endpoint(new_message_callback=self._dispatch_message, new_error_callback=self._dispatch_error, log=self.log, loop=loop, dump_to=dump_to)))
File "/usr/local/lib/python3.6/site-packages/aiocoap/transports/udp6.py", line 179, in create_client_transport_endpoint
return (yield from cls._create_transport_endpoint(new_message_callback, new_error_callback, log, loop, dump_to, None, multicast=False))
File "/usr/local/lib/python3.6/site-packages/aiocoap/transports/udp6.py", line 140, in _create_transport_endpoint
transport, protocol = yield from loop.create_datagram_endpoint(protofact, family=socket.AF_INET6)
File "uvloop/loop.pyx", line 2436, in create_datagram_endpoint (uvloop/loop.c:44170)
socket.gaierror: [Errno -9] Address family for hostname not supported
Ref: home-assistant/home-assistant#7815
any updates on this? blocking progress up stream willing to work to get it fixed.
Sorry, no update as of yet. I'm a bit behind on releasing a new uvloop version with fixes to all open issues. Will try to dedicate a few days closer to the end of the week. If you are willing to make a PR fixing this go ahead!
@1st1 can you tell where the issue is? how you would go about fixing it, I can dive in. Thanks for responding so quick.
I believe I know what the issue is, but not familiar enough to setup and test this - feel free to give this a try @myusuf3.
Looking at the trace, the issue is here while aiocoap called with family=socket.AF_INET6.
https://github.com/MagicStack/uvloop/blob/490c41032172b1a7d365ea83642aff7696ef9fc1/uvloop/loop.pyx#L2421-L2436
It's an IPv6 socket binding to an IPv4 address. 0.0.0.0 is not a valid IPv6 address, hence the _Address family for hostname not supported_ error.
Should check if family is AF_INET6 and bind to :: or ::/0 instead, which is the IPv6 equivalent of 0.0.0.0.
@myusuf3 is this something you could take a look at? If not I can probably set some time aside in a 3-4 days.
I'll fix this on Monday.
@1st1 you da man, let us know if you need us to test bud :+1:
For those interested, I just tested a quick fix for this;
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 191, in _async_setup_component
result = yield from component.async_setup(hass, processed_config)
File "/usr/lib/python3.6/site-packages/homeassistant/components/tradfri.py", line 107, in async_setup
allow_tradfri_groups))
File "/usr/lib/python3.6/site-packages/homeassistant/components/tradfri.py", line 121, in _setup_gateway
api = yield from api_factory(host, key, loop=hass.loop)
File "/config/deps/lib/python3.6/site-packages/pytradfri/api/aiocoap_api.py", line 46, in api_factory
_protocol = yield from Context.create_client_context(loop=loop)
File "/usr/lib/python3.6/site-packages/aiocoap/protocol.py", line 524, in create_client_context
self.transport_endpoints.append((yield from TransportEndpointUDP6.create_client_transport_endpoint(new_message_callback=self._dispatch_message, new_error_callback=s$
lf._dispatch_error, log=self.log, loop=loop, dump_to=dump_to)))
File "/usr/lib/python3.6/site-packages/aiocoap/transports/udp6.py", line 179, in create_client_transport_endpoint
return (yield from cls._create_transport_endpoint(new_message_callback, new_error_callback, log, loop, dump_to, None, multicast=False))
File "/usr/lib/python3.6/site-packages/aiocoap/transports/udp6.py", line 142, in _create_transport_endpoint
sock = transport._sock
AttributeError: 'uvloop.loop.UDPTransport' object has no attribute '_sock'
@1st1 huzzah!!
Just pushed a commit to master that should fix this. Could someone please try it out?
I am also hitting this problem. Thank you for this package!
I'll wait till tomorrow if someone tries the master branch out and confirms that the problem is fixed. If not, I'll issue a minor uvloop release tomorrow morning.
@1st1 feel free to release, I believe the issue is resolved from your end and the incompatibility now resides downstream in aiocoap. Thanks!
I'd be happy to try this but I don't think I have the time or skill to build it.
I've just released 0.8.1 which should fix the issue. Please test. Sorry it took so long, I was completely blocked with working on PEP 550.
Closing this now.
Most helpful comment
I'll fix this on Monday.