Why would a media_player suddenly have a Link local IP address?

Trying to resolve this issue

Basically one of my media_players that’s worked for years now has a link local address that has persisted through various reboots and upgrades but appeared

Uses the Apple TV integration (it’s an airport express speaker).

It’s occurred since probably 2023.09.1 but definitely since 2023.09.2.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 655, in async_trigger
    await self.action_script.async_run(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1578, in async_run
    return await asyncio.shield(run.async_run())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tts/legacy.py", line 147, in async_say_handle
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/media_player.py", line 300, in async_play_media
    await self.atv.stream.stream_file(media_id)
  File "/usr/local/lib/python3.11/site-packages/pyatv/core/facade.py", line 370, in stream_file
    await self.relay("stream_file")(
  File "/usr/local/lib/python3.11/site-packages/pyatv/protocols/raop/__init__.py", line 349, in stream_file
    client, context = await self.playback_manager.setup(self.core.service)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyatv/protocols/raop/__init__.py", line 147, in setup
    self._connection = await http_connect(self._address, self._port)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyatv/support/http.py", line 653, in http_connect
    _, connection = await loop.create_connection(HttpConnection, address, port)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 628, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 668, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
TimeoutError: [Errno 110] Connect call failed ('169.254.42.171', 5000)

Thanks!

Oh! Seems there’s an open issue

If it’s a is IPv6 address then it is probably supposed to have that and it gets generated automatically.
It is probably an addition caused by the implementation of a matter service that require IPv6.

Nope not ipv6

Ahh, that is probably your DHCP server that have gone belly up.
Try restarting your router.

This is not really a HA issue, unless you have installed a DHCP service addon in HA.

Did you not see the post a few messages above where I demonstrated it is a HA issue?
(I don’t mean this snarkily)

Sorry, but HA have nothing to do with your Apple TV not getting a DHCP address.
The IP address have to be solved before HA can connect to it.
There may still be a HA problem, but you need to solve the IP address issue first and HA is not a part of it, unless it is running your DHCP service, instead of your router.

I don’t have an Apple TV and the issue is identified. Thanks for your help :ok_hand:

Ok. let us hope that solves it. :slight_smile: