HA 0.103.0 update broke HACS (Requirements for hacs not found: ['aiofiles==0.4.0'].)

Just updated to the latest build of HA and i now have a couple of integrations that dont work anymore

The following components and platforms could not be set up:

Please check your config.

The main one missing is HACS, when i check the log files i see the following.

2019-12-13 17:47:56 ERROR (MainThread) [homeassistant.setup] Setup failed for hacs: Requirements for hacs not found: [‘aiofiles==0.4.0’].
2019-12-13 17:47:56 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following components and platforms could not be set up:

Please check your config., notification_id=invalid_config>

I have made no changes to the configuration other than the update of HASS.IO.

Has anynone else seen this and if so is there a resolution ?

I have rebooted the Pi at least four times now and its the same on each power cycle.

thanks in advance

some info from the check config button

Platform error notify.alexa_media - Requirements for alexa_media not found: [‘alexapy==1.3.2’].
Component error: alexa_media - Requirements for alexa_media not found: [‘alexapy==1.3.2’].
Component error: hacs - Requirements for hacs not found: [‘aiofiles==0.4.0’].
Platform error sensor.unifigateway - Requirements for unifigateway not found: [‘pyunifi==2.16’].
Component error: garbage_collection - Requirements for garbage_collection not found: [‘integrationhelper’].

I have some of the same custom components. No errors in check config in version .102.3. .103 will not load Lovelace after the install.

I don’t use those components, but HACS is working fine for me after updating.

maybe some random thing then to do with the aiofiles not loading.

Really dont want to flatten the SD card and start again if i can help it

have you tried restarting, it may need to pull the requirements

Yes those are PyPi packages that are dependencies of the integrations that are not working. They are (or should be) pulled in by pip when you start HA. When you went from 0.102 to 0.103 some dependencies will have changed. Often on first restart after an upgrade it seems to me that HA can have trouble dragging in new dependencies. Maybe it is too busy doing other upgrade stuff or pypi is busy or the cat has asthma.

TL;DR, restart HA, keep an eye on logs for dependencies not downloading.

FWIW HACS and garbage collection work here on 0.103, I don’t have alexa or switch.make_on_lan configured.

looks like they are going to try and fix issues like this in the future. https://github.com/home-assistant/home-assistant/issues/29913

I often get a lot of errors after an upgrade and I’m just in the habit now of restarting again after an update and they then pretty much disappear.

That’s an interesting issue… I actually just switched to using default_config but also running docker (with generic linux install of hass.io) Switched against my better judgement as I don’t use cloud but oh well… it’s loaded and unconfigured and doesn’t seem to be an issue. I switched mainly because they keep adding stuff to it and it seems simpler to just go with the flow. They were also making cloud a dependency for mobile_app in 0.102 so it was loaded then and didn’t seem to be an issue… anyway, interesting issue.

I must admit, I do just find it better to keep up-to-date and make changes even if the ‘old way’ works as ultimately, you will have less issues.

Ended up just restoring a back up from a week ago, restarted and all good.

Then upgraded again and all good … working howver i have no idea what was going on.

I’m trying to install HACS for the first time but seeing these docker log entries after: Configuration, Integrations, click orange plus sign, Set Up a new integration, scrolling & clicking “HACS”, waiting for the spinning blue circle for 7 seconds, which just returns to Set Up a new integration:

2019-12-24 01:13:12 ERROR (SyncWorker_15) [homeassistant.util.package] Unable to install package aiofiles==0.4.0: ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.7/site-packages/aiofiles'
Consider using the `--user` option or check the permissions.
2019-12-24 01:13:12 ERROR (MainThread) [aiohttp.server] Error handling request

The perms of the config/custom_components/hacs subfolder & all files therein match that of my working docker instance of Home Assistant 0.103.4

The symptoms persist after upgrading my Home Assistant to Docker image 0.103.5 and trying a fresh install of the latest HACS, https://github.com/hacs/integration/releases/tag/0.20.4

I created a folder under my working Home Assistant’s config folder, /custom_components/hacs
I unzipped the latest release of hacs into that folder.
I changed ownership of the whole folder tree to the same user:group as all of the other working home assistant folders and files under config.
I restarted my home assistant container. I confirmed Home Assistant sees hacs:
2020-01-01 14:20:39 INFO (SyncWorker_4) [homeassistant.loader] Loaded hacs from custom_components.hacs

In the HA GUI, I went to Configuration, Integrations, clicked the orange plus sign, Set Up a new integration, scrolled & clicked “HACS”, waited for the spinning blue circle, and it just returns to Set Up a new integration.

I examined the Home Assistant logs:

2020-01-01 14:24:50 INFO (SyncWorker_14) [homeassistant.util.package] Attempting install of aiofiles==0.4.0
2020-01-01 14:24:58 ERROR (SyncWorker_14) [homeassistant.util.package] Unable to install package aiofiles==0.4.0: ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.7/site-packages/aiofiles'
Consider using the '--user' option or check the permissions.
2020-01-01 14:24:58 ERROR (MainThread) [aiohttp.server] Error handling request

I restarted the container & waited, but it persists.

I don’t understand what, exactly, is being denied permission, and what permission is required? And how do I grant it? Thanks for any help.

aiofiles==0.4.0 is a dependency of hacs. https://github.com/hacs/integration/blob/d1b6b7b1e88a1223d986567396f86be1d3f74818/requirements.txt

Please post an issue on the hacs issues system as ludeeus requests.

Will do, thanks.

I figured it out. Because my Docker image of home assistant is running as a different user, it can’t install the dependencies that hacs requires. I changed my “docker run” command line to exclude “—user” and was able to install hacs successfully.

Hi Walt.

Can you show me how your docker run command looks like, with the exclude “–user” extension?

I am using the following command:

docker run -d --name="home-assistant" -v /home/root/homeassistant/config:/config -v /etc/localtime:/etc/localtime:ro --net=host --restart=always homeassistant/home-assistant:stable

And having the same issues, that hacs won’t install on docker with the same error in the log file.


docker run -d --init --network host --name ha -v /mnt/ha/config:/config -v /etc/localtime:/etc/localtime:ro --restart unless-stopped homeassistant/home-assistant

That will cause docker to run the ha container as root, which is required for hacs to be able to install packages. If you were previously running the docker image as a different user, make sure all folders and files at the mount point and below are owned by root.root
In my example, that mount point is /mnt/ha/config

1 Like

not quite sure which project were sharing here