Problem shutting down / restarting HA

What platform are you using for HA? Windows? Docker? Pi?

It’s a pi2, latest image, jessie lite.

I ask because I’ve been noticing the same thing on occasion with my Pi3 that I set up with the AIO installer. Just curious; do you have a lot of sensor templates in use?

Not too many, about 3, speedtest, yr and a temp sensor doing updates via mqtt.

Well that rules out that idea. I just started using a number of sensor templates as a result of implementing this:

and was wondering if all the template sensors are causing a worker pool traffic jam. Have you grepped your log for worker pool tasks? Seeing any lineups in the queue?

I am seeing this too on a Pi3 + AIO -

I had tracked the issue down to the MQTT Event Feed - that prevented shutdown 100% of the time, but now I am no longer using it, I still get a failure to shutdown cleanly perhaps 50% or so of the time.

I do have a large number of sensors and templates.

Hmm, I’m barely using MQTT at the moment; I’m using CloudMQTT with Owntracks. But I do have a large number of sensors and templates like yourself.

Not sure what this is but there’s something stopping HA from shuting down elegantly I believe.

Still no resolution - I tried a fresh install but no luck. Seems like the database just doesn’t want to close when I tell it to. Any other tips ?

Apparently a Hot fix was pushed out for issues with the front end - did you upgrade?

Upgraded, problem still there, I hit CTRL-C and it says…

^CINFO:homeassistant.core:Stopping
INFO:homeassistant.core:Bus:Handling <Event homeassistant_stop[L]>
INFO:homeassistant.components.wemo:Shutting down subscriptions.
INFO:homeassistant.components.recorder:Closing database
INFO:netdisco.service:Scanning

But it doesn’t stop, unless I Ctrl-C again when it quits inelegantly.

problem still persists in latest version - is it just the RPI2 is sloooooooowww.
Hangs at closing db duroing shutdown.

I have seen an improvement over the last few days - not 100% but it seems to shutdown more reliably on my Pi3.

I ddi some testing to try and isolate the problem and I think I have !

So I tried a fresh install on a Pi with default config and without any items auto dsicovered - shutdown is fine.
I took my own install and deleted the config and restarted - only thing discovered was hue lights - shutdown stalls.
I took my own install and editted the default config to disable device discovery and restarted - nothing discovered predictably, shutdown is instant!

So it’s the hue lights / hub somehow stopping the shutdown, no message in the log though - that’s my reading anyway.

Anyone further ideas people ?

It may not be the Hue specifically - the system will be a heck of a lot less busy with no device state to worry about. I have Hue and ZWave, so I’ll run a test to see if disabling the hue but leaving the ZWave running helps, although as I previously observed things are alot better for me on the latest release.

It seems to be the discovery component in my case. I disable that and it shuts down immediately!

Just wanted to observe that without any particular changes my system has been a lot more stable and a LOT better about shutting down since the new web piece went in a couple of releases ago. It is now the exception rather than the rule that it fails so shutdown.

I agree; I have had one or two times when it wouldn’t restart lately but not as bad as before.

Hi to everyone,

Yesterday after rebooting Raspi (i think so) i have more or less the same problem…

here you can see the topic that i opened: https://community.home-assistant.io/t/problem-to-start-ha-from-today-yesterday-worked-well/5102/2

Someone knows the reason about this?

thanks

Any update on this ?

Keep getting

WARNING:homeassistant.core:Error inside async loop: Exception in callback EventBus.async_fire(‘service_executed’, {‘service_call_id’: ‘1975804272-5’}, <EventOrigin.local: ‘LOCAL’>)

And stuck there trying to restart everytime