I've been using my Pi4 to to run home automation's via a Node Red instance and have had much success for the last two years or so. The Pi in combination with Node red has performed pretty much flawlessly during that time. I update it regularly and have had to replace the SD card a couple of times but apart from that it's been great until recently. On five occasions within the last few weeks the Dashboard in Node red has been unreachable with the error below:
Error: EIO: i/o error, stat '/usr/lib/node_modules/node-red/node_modules/@node-red/editor-client/public/ui/index.html'
Examining the Raspberry Pi desktop shows it as unresponsive. The only way to recover is to unplug the power and reboot. I'm unsure if this is a Raspberry Pi issue or Node Red messing up. I was wondering if anyone here may have suggestions as to how I could proceed to identify and eliminate this problem. I've already posted this issue on the Raspberry Pi forums but have had no response. I know a lot of you chaps on here use Raspberry Pi's so may be able to shed some light on this matter.
It should be extremely rare not to be able connect via ssh.
Are you using a decent quality power supply. Particularly for the Pi4 which needs a beefy supply. If you are getting regular lockups and card corruption then the power supply could be the cause.
Have you considered running on a much more reliable and faster SSD? All 3 of my RPi 4 are running on them for over a year and it was really easy to change the settings to boot off a USB instead of SD. If I remember correctly. You can download a boot file for a SD card that changes the settings so that it can then boot off the SSD.
It will load the PSU more, but provided it is a good one that should not be a problem. I run a pi 3 and a 4 with usb hard discs (not SSD) and the standard supplies with no problems. So unless SSD take more power than hdd it should not be a problem.