core icon indicating copy to clipboard operation
core copied to clipboard

Some integration not load after update 2025.1.1

Open ch155260 opened this issue 11 months ago • 28 comments

The problem

I had try reboot Home assistant still has same issue and these integration from HACS.

Try below command in Home assistant via terminal to install python-ipmi is workable. 螢幕擷取畫面 2025-01-08 102844

What version of Home Assistant Core has the issue?

core-2025.1.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config
Source: config.py:942
First occurrence: 10:09:42 AM (1 event)
Last recorded: 10:09:42 AM
Platform error: tts - Requirements for edge_tts not found: ['edge-tts==6.1.16'].

Logger: homeassistant.setup
Source: setup.py:269
First occurrence: 10:09:53 AM (6 events)
Last recorded: 10:11:05 AM

Setup failed for custom integration 'icloud3': Requirements for icloud3 not found: ['srp'].
Setup failed for custom integration 'dreame_vacuum': Requirements for dreame_vacuum not found: ['py-mini-racer'].
Setup failed for custom integration 'ipmi': Requirements for ipmi not found: ['python-ipmi'].
Setup failed for custom integration 'home_connect_alt': Requirements for home_connect_alt not found: ['home-connect-async==0.8.0'].
Setup failed for custom integration 'frigate': Requirements for frigate not found: ['hass-web-proxy-lib==0.0.7'].

Logger: homeassistant.util.package
Source: util/package.py:159
First occurrence: 10:09:34 AM (21 events)
Last recorded: 10:11:05 AM
Unable to install package srp: error: Failed to fetch: `https://files.pythonhosted.org/packages/89/75/5352c3ebd26e7d119042ae8de07354435a19c77fa2b44058fa97a1416783/srp-1.0.22-py3-none-any.whl.metadata` Caused by: Could not connect, are you offline? Caused by: Request failed after 3 retries Caused by: error sending request for url (https://files.pythonhosted.org/packages/89/75/5352c3ebd26e7d119042ae8de07354435a19c77fa2b44058fa97a1416783/srp-1.0.22-py3-none-any.whl.metadata) Caused by: client error (Connect) Caused by: dns error: failed to lookup address information: Name does not resolve Caused by: failed to lookup address information: Name does not resolve
Unable to install package py-mini-racer: error: Failed to fetch: `https://files.pythonhosted.org/packages/13/13/058240c7fd1fbf29a24bda048d93346c2a56275736b76b56afe64050a161/py_mini_racer-0.6.0-py2.py3-none-macosx_10_10_x86_64.whl.metadata` Caused by: Could not connect, are you offline? Caused by: Request failed after 3 retries Caused by: error sending request for url (https://files.pythonhosted.org/packages/13/13/058240c7fd1fbf29a24bda048d93346c2a56275736b76b56afe64050a161/py_mini_racer-0.6.0-py2.py3-none-macosx_10_10_x86_64.whl.metadata) Caused by: client error (Connect) Caused by: dns error: failed to lookup address information: Name does not resolve Caused by: failed to lookup address information: Name does not resolve
Unable to install package python-ipmi: error: Failed to fetch: `https://files.pythonhosted.org/packages/38/7d/7e950b1f22d1aef4f51d34eceab9a8a1d71b8bb479101c3eab6865735820/python_ipmi-0.5.7-py3-none-any.whl.metadata` Caused by: Could not connect, are you offline? Caused by: Request failed after 3 retries Caused by: error sending request for url (https://files.pythonhosted.org/packages/38/7d/7e950b1f22d1aef4f51d34eceab9a8a1d71b8bb479101c3eab6865735820/python_ipmi-0.5.7-py3-none-any.whl.metadata) Caused by: client error (Connect) Caused by: dns error: failed to lookup address information: Name does not resolve Caused by: failed to lookup address information: Name does not resolve
Unable to install package home-connect-async==0.8.0: error: Failed to fetch: `https://files.pythonhosted.org/packages/f4/65/ee21531463acd4192d4e2eeefdc60e50c3b5704325ecfd7a184423366b3e/home_connect_async-0.8.0-py3-none-any.whl.metadata` Caused by: Could not connect, are you offline? Caused by: Request failed after 3 retries Caused by: error sending request for url (https://files.pythonhosted.org/packages/f4/65/ee21531463acd4192d4e2eeefdc60e50c3b5704325ecfd7a184423366b3e/home_connect_async-0.8.0-py3-none-any.whl.metadata) Caused by: client error (Connect) Caused by: dns error: failed to lookup address information: Name does not resolve Caused by: failed to lookup address information: Name does not resolve
Unable to install package hass-web-proxy-lib==0.0.7: error: Failed to fetch: `https://files.pythonhosted.org/packages/e0/01/2512288bb73820fa93e119449ee9dfa1a74921db56e238448b7d171cb67b/hass_web_proxy_lib-0.0.7-py3-none-any.whl.metadata` Caused by: Could not connect, are you offline? Caused by: Request failed after 3 retries Caused by: error sending request for url (https://files.pythonhosted.org/packages/e0/01/2512288bb73820fa93e119449ee9dfa1a74921db56e238448b7d171cb67b/hass_web_proxy_lib-0.0.7-py3-none-any.whl.metadata) Caused by: client error (Connect) Caused by: dns error: failed to lookup address information: Name does not resolve Caused by: failed to lookup address information: Name does not resolve

Additional information

No response

ch155260 avatar Jan 08 '25 02:01 ch155260

Hello, I have the same issue, but with 2 integrations on HA 2025.1.1 (but I see it from 2024.12.4):

  • ocpp (https://github.com/lbbrhzn/ocpp)
  • sunspec (https://github.com/cjne/ha-sunspec)
2025-01-07 23:06:48.342 ERROR (SyncWorker_0) [homeassistant.util.package] Unable to install package ocpp>=2.0.0: error: Failed to fetch: `https://files.pythonhosted.org/packages/74/11/3d1b26392641b88554e1e781f801c1307a10752fd989616774848e23453d/ocpp-2.0.0-py3-none-any.whl.metadata`
  Caused by: Could not connect, are you offline?
  Caused by: Request failed after 3 retries
  Caused by: error sending request for url (https://files.pythonhosted.org/packages/74/11/3d1b26392641b88554e1e781f801c1307a10752fd989616774848e23453d/ocpp-2.0.0-py3-none-any.whl.metadata)
  Caused by: client error (Connect)
  Caused by: dns error: failed to lookup address information: Name does not resolve
  Caused by: failed to lookup address information: Name does not resolve
2025-01-07 23:06:48.343 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'ocpp': Requirements for ocpp not found: ['ocpp>=2.0.0'].
2025-01-07 23:06:54.241 ERROR (SyncWorker_2) [homeassistant.util.package] Unable to install package pysunspec2==1.1.5: error: Failed to fetch: `https://files.pythonhosted.org/packages/5a/71/163ad2ce084f2f1d523b196a3b7c7a97fab30996d7d4a03fefac4339f8c4/pysunspec2-1.1.5-py3-none-any.whl.metadata`
  Caused by: Could not connect, are you offline?
  Caused by: Request failed after 3 retries
  Caused by: error sending request for url (https://files.pythonhosted.org/packages/5a/71/163ad2ce084f2f1d523b196a3b7c7a97fab30996d7d4a03fefac4339f8c4/pysunspec2-1.1.5-py3-none-any.whl.metadata)
  Caused by: client error (Connect)
  Caused by: dns error: failed to lookup address information: Name does not resolve
  Caused by: failed to lookup address information: Name does not resolve

So I think the issue is not limited to ocpp, but maybe it is a HA bug (or python).

I tried to investigate the bug with Wireshark, and I saw this:

1

You can see that my DNS resolver is answering correctly to the queries made by home assistant, but it seems to be stuck inside a loop. Below you will find some informations about the answer provided by my resolver:

2

The only troubling thing I see may be the very short TTL, but everything else seem fine to me.

So, I tried something to fix the low TTL, by adding a static entry to my DNS resolver for files.pythonhosted.org, thus also removing the CNAME part. Something like this (in my Mikrotik router):

3

And it made the loop to end:

4

I added the static entries between packets 698 and 699. You can see that the next answers (packets 701 and 702) are slightly different, and without the CNAME part. And the loop ends.

Here are the details of one of the answers:

5

So, I don't know what is causing this. I will continue to investigate, but I don't find a lot of people having this issue. So it might be link to a specific configuration (IPv6 maybe ?).

See you later

lechercheur123 avatar Jan 08 '25 11:01 lechercheur123

@lechercheur123 I have workaround to fix the issue as below procudure for reference.

1.Enter the contatiner of home assistant core. docker exec -it $(docker ps |grep qemux86|awk '{print $1}') bash 2. Install lost package of python(You can check the lost package name from log of Home assistant core) pip install "type package name of python" 4. Exit the contatiner. exit 6. Kill the contatiner of home assistant core than system restart the contatiner of home assistant core that all integration will reload. docker kill $(docker ps |grep qemux86|awk '{print $1}')

ch155260 avatar Jan 08 '25 14:01 ch155260

Thanks @ch155260, but I find my workaround with the DNS easier to do 😅 (adding static entries to my DNS resolver)

lechercheur123 avatar Jan 08 '25 18:01 lechercheur123

I do have similar problem after hahomematic component update: My setup: Core: 2025.1.2 Supervisor: 2024.12.3 Operating System: 14.1 Frontend: 20250109.0

2025-01-14 19:49:37.072 ERROR (SyncWorker_0) [homeassistant.util.package] Unable to install package hahomematic==2025.1.5: error: Failed to fetch: https://files.pythonhosted.org/packages/38/2f/18dd8d2845c4441a5cc056606221638db905f714b0d9b7b7dc1316d0ddb6/hahomematic-2025.1.5-py3-none-any.whl.metadata

Caused by: Could not connect, are you offline? Caused by: Request failed after 3 retries Caused by: error sending request for url (https://files.pythonhosted.org/packages/38/2f/18dd8d2845c4441a5cc056606221638db905f714b0d9b7b7dc1316d0ddb6/hahomematic-2025.1.5-py3-none-any.whl.metadata) Caused by: client error (Connect) Caused by: dns error: failed to lookup address information: Name does not resolve Caused by: failed to lookup address information: Name does not resolve

I've started already a post at developer github space: https://github.com/SukramJ/hahomematic/discussions/1983

My wireshark recording of communication between my HA and pythonhosted.org (151.101.128.223)

Image give me this kind of error. I've already tried:

  • disabled IPv6 in HA
  • add addition cloudfare public DNS 1.1.1.1
  • wget of file on terminal (works)

Here is also recording of DNS requests:

Image

Attached you can find wireshark recording. Is there anything more I can check or improve to get rid of this problem ?

Update2: After changing order of DNS servers, component could be updated and problem is solved. Really weird ! Before I had this order: 192.168.1.1 / 1.1.1.1 / 1.0.0.1. now I have 1.1.1.1 / 1.0.0.1 / 192.168.1.1

luftdieb avatar Jan 14 '25 20:01 luftdieb

Hello @luftdieb, I don't see any answer to your DNS queries in your Wireshark capture. Is this normal?

lechercheur123 avatar Jan 15 '25 00:01 lechercheur123

@lechercheur123 : This was not intended but clear for me now. I've just configured to record all traffic to Port 53 from HA outgoing. But it's still not clear, why other DNS works... Looks like there is a TTL elapsed problem ?

luftdieb avatar Jan 15 '25 13:01 luftdieb

The issue seems to have vanished for me from 2025.1.3. I will see later if the bug reappears

lechercheur123 avatar Jan 20 '25 23:01 lechercheur123

jFYI https://community.home-assistant.io/t/issues-custom-components-and-2024-12-5/814048 https://community.home-assistant.io/t/dns-resolution-issue-during-boot/833103/9 https://community.home-assistant.io/t/dns-issue-on-ha-if-im-right-but-why/813556/

10der avatar Jan 30 '25 18:01 10der

This seems to have something to do with uv transition. I can reproduce the problem inside the homeassistant container using uv:

Image

Not sure if this is relevant: https://github.com/astral-sh/uv/issues/8450

cuihaoleo avatar Jan 31 '25 06:01 cuihaoleo

I have the same on 2025.1.4! And also change DNS in HA to 1.1.1.1 than 192.1681.1 helps to solve it. btw Router MikroTik with cache dns to 1.1.1.1

M0DDer avatar Feb 03 '25 18:02 M0DDer

There is a clear bug in DNS resolution on HA or in the underlying setup. I have it fail when using my own DNS either of the following fails:

  • Pi.hole
  • Mikrotik Router with DNS caching

If I use it directly with 1.1.1.1 or 8.8.8.8 it works.

Using local dns is useful because local hostnames need to be resolved by local DNS. If I use public DNS my local DNS resolution doesn' t work.

spinza avatar Feb 04 '25 11:02 spinza

I'm afraid it is caused by missing DnsSec / DNS cookie functionality of private DNS server provided in SOHO Infrastruktur. A setting in HA is mostly appreciated to disable this security feature or having a fallback available. A clear error message would be nice either

spin @.***> schrieb am Di., 4. Feb. 2025, 12:03:

There is a clear bug in DNS resolution on HA or in the underlying setup. I have it fail when using my own DNS either of the following fails:

  • Pi.hole
  • Mikrotik Router with DNS caching If I use it directly with 1.1.1.1 or 8.8.8.8 it works.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/135054#issuecomment-2633571769, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4DHAFFU4TJ4VYCIDWWY2R32OCNA7AVCNFSM6AAAAABUY55F3CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZTGU3TCNZWHE . You are receiving this because you were mentioned.Message ID: @.***>

luftdieb avatar Feb 04 '25 11:02 luftdieb

I mean the question I ask is why is the only time the DNS is checked in this way only when custom compenents are updated. This happens to only happen when you rebuild. I.e. to fix the issue is the following:

  1. Replace my internal DNS server with 1.1.1.1 in the Home Assistant network settings.
  2. In the terminal run a rebuild ha core rebuild
  3. Change the DNS server back to my own server.

Everything else in Home Assistant works with my DNS server except ha core rebuild. I assume this step is run when you update or restart Home Assistant too. This would appear to be an inconsistency.

spinza avatar Feb 04 '25 12:02 spinza

I think https://github.com/home-assistant/core/issues/135054#issuecomment-2626392688 has the clue.

If I log into my homeassisant container and try to run the uv install for the failing packages, I am greeted with

homeassistant:/config# docker exec -it homeassistant /bin/bash
# uv pip install aiocomfoconnect==0.1.14
Using Python 3.13.1 environment at: /usr/local
⠴ aiocomfoconnect==0.1.14                                                                                                                                                                                                                                     error: Failed to fetch: `https://files.pythonhosted.org/packages/de/c0/1b2c0599783979048ac8b13072558c1569ae62424843817386f8367bc8e3/aiocomfoconnect-0.1.14-py3-none-any.whl.metadata`
  Caused by: Could not connect, are you offline?
  Caused by: Request failed after 3 retries
  Caused by: error sending request for url (https://files.pythonhosted.org/packages/de/c0/1b2c0599783979048ac8b13072558c1569ae62424843817386f8367bc8e3/aiocomfoconnect-0.1.14-py3-none-any.whl.metadata)
  Caused by: client error (Connect)
  Caused by: dns error: failed to lookup address information: Name does not resolve
  Caused by: failed to lookup address information: Name does not resolve

but then pip3 works like a charm

homeassistant:/config# pip3 install aiocomfoconnect==0.1.14
Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/
Collecting aiocomfoconnect==0.1.14
  Downloading aiocomfoconnect-0.1.14-py3-none-any.whl.metadata (7.5 kB)
Requirement already satisfied: aiohttp<4.0.0,>=3.8.0 in /usr/local/lib/python3.13/site-packages (from aiocomfoconnect==0.1.14) (3.11.11)
Requirement already satisfied: protobuf<6.0,>=5.28 in /usr/local/lib/python3.13/site-packages (from aiocomfoconnect==0.1.14) (5.29.2)
Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /usr/local/lib/python3.13/site-packages (from aiohttp<4.0.0,>=3.8.0->aiocomfoconnect==0.1.14) (2.4.4)
Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.13/site-packages (from aiohttp<4.0.0,>=3.8.0->aiocomfoconnect==0.1.14) (1.3.2)
Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.13/site-packages (from aiohttp<4.0.0,>=3.8.0->aiocomfoconnect==0.1.14) (24.2.0)
Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.13/site-packages (from aiohttp<4.0.0,>=3.8.0->aiocomfoconnect==0.1.14) (1.5.0)
Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.13/site-packages (from aiohttp<4.0.0,>=3.8.0->aiocomfoconnect==0.1.14) (6.1.0)
Requirement already satisfied: propcache>=0.2.0 in /usr/local/lib/python3.13/site-packages (from aiohttp<4.0.0,>=3.8.0->aiocomfoconnect==0.1.14) (0.2.1)
Requirement already satisfied: yarl<2.0,>=1.17.0 in /usr/local/lib/python3.13/site-packages (from aiohttp<4.0.0,>=3.8.0->aiocomfoconnect==0.1.14) (1.18.3)
Requirement already satisfied: idna>=2.0 in /usr/local/lib/python3.13/site-packages (from yarl<2.0,>=1.17.0->aiohttp<4.0.0,>=3.8.0->aiocomfoconnect==0.1.14) (3.10)
Downloading aiocomfoconnect-0.1.14-py3-none-any.whl (32 kB)
Installing collected packages: aiocomfoconnect
Successfully installed aiocomfoconnect-0.1.14

Digging deeping [1][2], I understand that uv uses getaddr_info() which in turn dynamicly loads /usr/lib/libnss* and /usr/lib/libresolv* Guess what, none of these libraries are packaged in the homeassisant image.

homeassistant:/config# ls -l /usr/lib/libnss*
ls: /usr/lib/libnss*: No such file or directory

[1] https://github.com/astral-sh/uv/issues/8450 [2] https://stackoverflow.com/questions/68397898/minimal-docker-for-networking-rust-binary/68409203#68409203

middelink avatar Feb 06 '25 16:02 middelink

The issue seems to have vanished for me from 2025.1.3. I will see later if the bug reappears

Well, the issue reappaered for me after 2025.2.0 upgrade...

lechercheur123 avatar Feb 06 '25 19:02 lechercheur123

What I don't understand is why adding public DNS servers solves the issue. I captured the DNS packets on the router. In either cases UDP DNS was used.

Using local DNS: Image

Using 1.1.1.1: Image

cuihaoleo avatar Feb 07 '25 05:02 cuihaoleo

I start to feel this is a problem of Mikrotik router's DNS (or some interplay between Docker/HA and RouterOS).

First, I found the problem goes away as long as I use a different DNS server -- not necessarily public. I hosted a SmartDNS instance in my home LAN and it also fixes the problem.

Second, I diffed the DNS packets inside the container (not on the router this time). I notice the DNS response contain no answer when using the router's DNS, which is problematic.

Image

Third, I strace-ed uv and found it uses POSIX socket to resolve DNS (instead of getaddrinfo). So I let ChatGPT wrote a simple program that only uses POSIX socket to resolve DNS. Interestingly I am able to reproduce the issue in the HA container with this demo program -- it resolves when I use a different DNS, not when I use the router's DNS.

I also found if you do dig files.pythonhosted.org, you will find it works. And after this, uv and that demo program also start to work -- perhaps Docker's DNS cached the answers.

I'm still diffing dig and uv/the demo program to understand why the latter does not work.

cuihaoleo avatar Feb 07 '25 06:02 cuihaoleo

same problem with frigate integration on HA Core 2025.2.5

almazikv avatar Feb 28 '25 07:02 almazikv

I had the issue with a Mikrotik Router but also other DNS server. So I don't think it was exclusive to Mikrotik. I also have to note that the problem is no longer an issue for me. I stopped experiencing it in the last week or so.

spinza avatar Feb 28 '25 11:02 spinza

I also have Mikrotik router on the site with this issue. Worked around with 1.1.1.1 DNS worked for me. And on my other site with exactly the same version HA and integration but with Keenetic router does not have this problem.

almazikv avatar Feb 28 '25 18:02 almazikv

I also have a Mikrotik router used as my DNS resolver. It is a RB4011 with ROS 7.17.1. So I guess I have to dig up that way

lechercheur123 avatar Feb 28 '25 19:02 lechercheur123

This is definitely a DNS Cookie issue. I have Mikrotik and got the issue. When configuring a bind9 DNS on Linux everything went fine and I had no issues in HA. Unfortunately, Mikrotik DNS isn't capable of offering DNS Cookie.

boriskroeger avatar Mar 09 '25 17:03 boriskroeger

This is definitely a DNS Cookie issue. I have Mikrotik and got the issue. When configuring a bind9 DNS on Linux everything went fine and I had no issues in HA. Unfortunately, Mikrotik DNS isn't capable of offering DNS Cookie.

can you confirm what this article is wrong? https://help.mikrotik.com/docs/spaces/ROS/pages/37748767/DNS

10der avatar Mar 10 '25 11:03 10der

Another question, can we use "DNS Cookie" as optional?

10der avatar Mar 10 '25 11:03 10der

Hi! Thank You Guys, setting dns to 1.1.1.1 in homeassistant and runing ha core rebuild fixed it, changed dns back to normal and is still good. I am running 2025.3.3. Saved my day :D Also using mikrotik.

adefik avatar Mar 20 '25 21:03 adefik

I have had this issue several times myself, with different Home Assistant setups. Common for all of them, is MikroTik. Setting the DNS in Home Assistant to Google or Cloudflare solevs the problem.

mloraas avatar Apr 03 '25 13:04 mloraas

I have had this issue several times myself, with different Home Assistant setups. Common for all of them, is MikroTik. Setting the DNS in Home Assistant to Google or Cloudflare solevs the problem.

sorry. But it's not "solves the problem" it's workaround!

10der avatar Apr 04 '25 12:04 10der

Hi all. Same issue. Mikrotik router and some HACS integrations that can't install python dependencies. Has anyone filed an issue with Mikrotik?

andanders avatar May 12 '25 18:05 andanders

Hey all, not strictly limited to Microtik, I have same issue running DNS-server on a Fritzbox ;(

rinyheuvelman avatar May 29 '25 01:05 rinyheuvelman

Hey, after updating to core 2025.6.1 on HA green I have this issue too. I have Microtik. After changing dns to 8.8.8.8 on HA I am back on. thx.

pmenclik avatar Jun 17 '25 18:06 pmenclik