HA config check via CLI takes very long time

Would like to run a CLI config check before doing a git commit on my config files. When I run the check via the UI (Configuration > Server Controls > Configuration validation) it only takes a few seconds and passes.

However, when I run from the CLI (via Terminal Add on) it says “Processing” for 1-2 minutes before returning success.

Screen Shot 2020-09-25 at 2.58.11 PM

Doc isn’t entirely clear but maybe it’s running a more extensive check via the CLI?

With Home Assistant OS and Supervised you can use the ha command: ha core check .

1 Like

FWIW, I’ve noticed the same behavior (with Home Assistant OS on an RPI3):

  • UI-based config check is very fast
  • CLI-based config check is very slow.

I have no idea why there’s such a dramatic difference.

Interesting. Sure makes the feedback loop painfully slow when I’m checking config status before committing my changes to my repo. Hopefully we can find out if this is expected (though I imagine not) before I submit a bug for it. Would probably be really low priority anyway even if it is a true bug.

Guess it forces me to step away for a bit while it runs instead of constantly plugging away. :smiley:

I have seen the same problem. I have further debugged this and found following:

1. Using 'ha config check' CLI takes 30+ seconds
2. Logging into homeassistant container using portainer and using 'python -m homeassistant --script check_config --config /config; takes 30 seconds
3. Clicking on "CHECK CONFIGURATION" in UI takes less than five seconds...

Further, I have determined that

"Nest" integration adds 12+ seconds in the first two methods above
"Influxdb" integration - actually I am using external influxdb adds 3+ seconds
"zha" integration adds 4+ seconds
Unsupported "ha-wyzesense" - integration (thru HACS) used to add 2+ minute plus (I removed it)

I am using RPI3 hassio OS and 0.118.5 HA version

Jatin

Hello all,

Same problem on my configuration : more than 3 minutes to run
ha core check

Whereas w/ UI it is almost instantaneous…

I analysed addons logs but nothing interesting… (ha addons logs core_git_pull).

But… i remarked that the check config use a lot of memory :

Anybody has an explanation ?

P.S. my config :
Core : core-2021.1.5
supervisor : supervisor-2021.04.3

1 Like

Hi,

I suffered this as well, not that I have an answer as to why it takes so long, but as a work around if you have a supervised install you can run:

docker exec homeassistant python -m homeassistant --config /config --script check_config | ( ! grep ERROR )

and it will do the check quickly. I use the pipe to (! grep ERROR) to get the exit code out of the command for my devops pipeline, so if there is an error in the yaml in the pipeline copy it will terminate the pipeline. So just remove that bit after the check_config if you dont want it. Hope this helps someone.