I am a heavy Home Assistant user and use it for almost everything in my house and sometime it happens that I restart HA by pulling it from the plug, which skips the YAML validation check at shutdown, which then at startup leads to a dead HA, if something in the YAML is invalid.
This has happened to me multiple times now and sometimes I wait almost half an hour before realising it got stuck and that I must check the logs via SSH.
It would be more than nice to include a feature that HA skip the entire YAML section that is invalid and proceeds to start anyways, and possibly display a message on successful startup that something was invalid and was not loaded.
Another nice thing would be starting the 8123 server before anything else, so it can stream any logs directly to the broser while starting, letting the user know what is happening and if it got stuck. I was thinking something like a normal loading screen without much information, but if something fails, it would display a exclamation and display the error(s). (Because staring at a “connection refused” screen for 10 minutes+ doesn’t let you know much)
Very bad idea, you are begging for system corruption.
Why not just use the config check tool before pulling the plug if you insist on restarting that way. I am pretty confident in my ability to create a correct config file yet I check the config before every restart, even if I only change 1 line. Its quick and avoids the issue you are describing.
Edit:
Sometimes what you describe can happen. Othertimes due to the incorrect YAML it is making a huge chunk of the config file unreadable by the system to to a configuration error. An errant quote or incorrect indent can really change how the config file is read. This isn’t as simple as skipping a few lines of config.
Yes, I know it’s not the right thing to do, but sometimes it happens. Sometimes we have power outtages too and such, which then lead to the same problem.
It also does, but the main focus here is that HA should start up anyways, because the only thing we see is “Connection refused” for an eternity and we never know if it’s going to start up or not.
Tjat’s just now how it works. The configuration is loaded as a whole, and if there’s something invalid in there, everything is invalid.
That’s actually a personal choice of yours. You should validate your config whenever you make a change. If you start something and want to continue some other time, leave the yaml commented out until you’re done.
The problem is, that starting HA anyways is problematic if the yaml is invalid, because that’s where required information is. The next best thing would be to have some sort of default-fallback configuration. But depending on the type of setup that could actually be a huge security problem.
Another idea would be to always save a backup of the last known valid configuration and replace that on every successful start. Then in case something goes wrong there would be a valid configuration to fall back to. But that’s really a separate topic.