I have a Raspberry Pi 3B+ as a NextCloud server with Raspbian Stretch Lite. At least once or twice a month the server stops responding completely. I can see how the LEDs of the RJ-45 port and the board itself are lit and blink occasionally. However, when accessing https, the error ERR_ADDRESS_UNREACHABLE
appears, the same when I enter port 4443. SSH doesn’t respond and no response is received from the pings. When I do a forced restart by removing and putting on the AC cable, everything returns to normal but I would like an effective solution if I am away from home for a long time. The raspberry has heatsinks and it is connected to a monitor, when everything goes well I can see how Raspbian Lite asks me for a username and password but when it does not respond the screen is black.
Unable to access the monitor or SSH I can not get any log or information. If it helps you I will force the restart and put all the logs that ask me