Supervisor not restarting core on 502 bad gateway


My environment looks as follows:

  • Hassio installed on VM on synology NAS
  • Hassio exposed on wan
  • Node-red installed on same synology NAS

Home assistant core becomes unresponsive and throws a 502-bad gateway error. Even with log level info i cant seem to locate root cause. Core can be running flawless for days on end but then suddenly crash, manual reboot (SSH and CLI) can bring the insance back up but can crash can occur again at any moment.

Solution?: Supervisor should detect unresponsive core (http response != 200) and then restart core?

Comment: Solution dose not occur, always has to manualy restart.

Alt solution?: Node-red with status check on internal URL of home assistant with bigSSH-node to restart core on http != 200.

Comment: Works some times but most occations not (bigSSH thows error). Is there any waty to communicate with supervisor api to call supervisor/supervisor/core/restart to restart core? No idea how to communicate with that part of the API!

Thanks for any help at this moment!

I boot my core every other day. I have a vm on Ubuntu 20.04. I use HACS garbage collection and automations. The hardest part was to find a time that did not interrupt an automation.

How do you detect the need for reboot of core and how do you implement it?

Solved it myself:

Another update: Located the root cause of the unresponsive core. Out of memory, seems weird that no system logs flags this issue though? Bumped VM memory from 2gb to 6 and been working flawlessly since. History shows drops from 6 to 3,5 gb avail at some points but recovers quickly.