[WARN] Home Assistant CLI not starting! Jump into emergency cconsole

[WARN] Home Assistant CLI not starting! Jump into emergency cconsole

I was doing Zigbee2Mqtt update in Home Assistant, and part of this update is always reboot of whole HA VM, because my Conbee II which is passed-trough in XCP-NG can't survive this update. I need to shutdown VM, reattach USB to it and start it again.

Normally this takes couple of minutes, and HA starts normally. But today instead of normal start I was greeted with this message

[WARN] Home Assistant CLI not starting! Jump into emergency cconsole

I panicked little bit, but quick search revealed that this message is when not all docker images started. Now what could caused this? Timeout maybe? But what slowed down so much whole VM that timeout ocuured?

Quick look at my XCP-NG host and bingo. I made restart during checking my whole SR in MDRAID...

# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda[1] sdb[0]
      9766304768 blocks super 1.2 [2/2] [UU]
      [======>..............]  check = 31.9% (3124137152/9766304768) finish=1098                                                                                                           .3min speed=100791K/sec
      bitmap: 6/73 pages [24KB], 65536KB chunk

This process is very I/O intensive and VM couldn't end it tasks in given time.

Of course I can't wait until it ends, but there is a way to pause it:

echo idle > /sys/block/md0/md/sync_action

And now it looks like normal operations:

# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda[1] sdb[0]
      9766304768 blocks super 1.2 [2/2] [UU]
      bitmap: 7/73 pages [28KB], 65536KB chunk

unused devices: <none>

Then I could start HA VM, and after it booted properly this time I could resume raid check operation again:

echo check > /sys/block/md0/md/sync_action

It will continue from previous interrupted moment which is good

# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda[1] sdb[0]
      9766304768 blocks super 1.2 [2/2] [UU]
      [======>..............]  check = 31.9% (3124861824/9766304768) finish=4398.0min speed=25152K/sec
      bitmap: 9/73 pages [36KB], 65536KB chunk

unused devices: <none>