I've got a Raspberry Pi 3B+ running Raspbian Stretch that I've been using successfully for months to run my Home Assistant instance. I've been connecting to it using SSH and it's always worked fine. A few weeks ago it started acting up though, for no apparent reason, first my Home Assistant Docker instance went down, then it started to become unresponsive to SSH. I've restarted it multiple times and it's always responding to ping (the IP is reserved in the router) but most of the time I can't access it.
The respons I get is first
Connection refused (maybe this is while its booting up), then after a while it works fine, then all of a sudden (after a few minutes) it freezes and I get
Connection reset by peer. Once this happens the only way to get another response seems to be to restart it.
Sometimes it actually doesn't freeze, I can use it for long periods of time, but I've noticed that I can never have multiple console windows open with ssh (used to work before though), the first one might succeed but the second one will always get denied. Also closing the connection with
exit and trying to reopen it doesn't work either.
Are there any logs I can check to investigate this further?
EDIT: I've also noticed that a lot of the basic commands I run seems to fail and throw errors like:
Failed to read server status: Connection timed out for something as simple as
Failed to list units: Failed to activate service 'org.freedesktop.systemd1': timed out for various commands.
error during connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.38/containers/json: read unix @->/var/run/docker.sock: read: connection reset by peer sometimes for
EDIT 3: I've also noticed that the shell Zsh never remembers my previous commands when I log in (seems to only remember the commands from a few days ago) and the plugin Oh-My-Zsh always needs to be updated, even if I updated it just minutes before. Groundhog day, anyone :/