Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Errno 98] Address in use with IPv6 enabled #1360

Open
TA2k opened this issue Feb 10, 2024 · 0 comments
Open

[Errno 98] Address in use with IPv6 enabled #1360

TA2k opened this issue Feb 10, 2024 · 0 comments

Comments

@TA2k
Copy link

TA2k commented Feb 10, 2024

I have the issue when I have a TrueNAS Scale host with mDNS active and install HomeAssistent as a docker container in host network mode.
The zeroconf cannot use the address.
With other implementation for example in nodejs the issue happens only in IPv4 mode but in IPv6 the binding works when the host the host is already binding the mDNS port.

Why python-zeroconf fails here to bind ?

 File "/usr/src/homeassistant/homeassistant/setup.py", line 333, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zeroconf/__init__.py", line 216, in async_setup
    aio_zc = await _async_get_instance(hass, **zc_args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zeroconf/__init__.py", line 157, in _async_get_instance
    zeroconf = HaZeroconf(**zcargs)
               ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zeroconf/_core.py", line 176, in __init__
    listen_socket, respond_sockets = create_sockets(interfaces, unicast, ip_version, apple_p2p=apple_p2p)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zeroconf/_utils/net.py", line 358, in create_sockets
    listen_socket = new_socket(ip_version=ip_version, apple_p2p=apple_p2p, bind_addr=('',))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/zeroconf/_utils/net.py", line 248, in new_socket
    s.bind(bind_tup)
OSError: [Errno 98] Address in use
2024-02-10 22:09:38.791 INFO (MainThread) [homeassistant.setup] Setting up zeroconf
2024-02-10 22:09:38.791 DEBUG (MainThread) [zeroconf] Creating new socket with port 5353, ip_version IPVersion.V6Only, apple_p2p False and bind_addr ('',)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant