Failed Config, but I didn't change anything

It appears Home Assistant got restarted and now I can’t connect to the GUI. The web Connection is refused. In the Home Assistant CLI I check the config and get a fatal error (BUT I didn’t change anything). Unfortunately the error doesn’t mention the line in the configuration file where it’s encountering the error. The error occurs right after the line:

INFO: homeassistant.util.package:Attempting install of alexapy== ~=1.24.2
INFO: homeassistant.util.package:Attempting install of packaging ~=20.3
INFO: homeassistant.util.package:Attempting install of wrapt ~=1.12.1
Fatal error while loading config: function() argument 'code' must be code, not str
Failed Config
   General Errors:
       - function() argument 'code' must be code, not str

Under the premise that the line immediately before the error is causing the error I did some digging and found lout that “wrapt” is required by the alexa_media custom component. I went so far as to comment out the line:

# alexa_media: !include components/alexa_media.yaml

But - it still finds the alexa_media stuff and tries to install those components.

Two questions:

  1. How do I easily prevent the loading of the alexa_media stuff so I can see if that lets the configuration test successfully and so that I can easily put it back if that doesn’t fix the problem.

  2. If that’s not the problem, how do I find what’s calling function() with a str argument and not code?

This is an inherited HASSIO configuration and I’m still learning my way around, so be gentle. :wink:

Under storage folder, there is config_entry file, you can remove Alexa from there and restart ha

Unfortunately, I don’t have a Storage folder

It’s .storage

That said, you probably also need to remove the custom_components/alexa_media_player (or whatever it’s called) folder.

thanks @Tinkerer , you are right. I am using WinSCP to access file system and they are by default hidden as in linux folders starting with dot are assumed hidden.

But…

Users aren’t supposed to edit those files. Especially new users who can break things further if they don’t know what they are doing when editing them.

Be cautious.

I haven’t been able to avoid to edit this manually, i tried too much :slight_smile: this should be included inside onboarding to HA, you will so it soon or later, just a matter of time

I don’t disagree. I was just pointing out the potential dangers of doing this without some knowledge of the process and making things worse.

I’ve pointed out this very catch-22 a long time ago in the “future of yaml” thread and was flatly ignored.

1 Like

jmcdermon what was the resolve in the end I have the same issue after updating

1 Like

Same issue, what was the fix?

same problem for me after update

EDIT:

Hi, you did it in another sequence, right?
1.core 2.AMP and 3.OS the host restarts automatically then, right?