My Pi stopped responding yesterday. It normally serves an html page with sensor data using apache. When I browsed to the IP I got 403. When I tried to SSH I got

kex_exchange_identification: read: Connection reset by peer

Connection reset by port 22

I cycled the power and it is back and appears to be functioning normally. The Python script collecting data from a sensor and logging it every 5 minutes using cron stopped about 36 hrs ago so it seems like a full system crash. Can anyone suggest where I should look for logs on RasPiOS Buster that might indicate what went wrong, or how I can get the Pi to create such logs, if they're not enabled by default?


Login via ssh or console and look at /var/log/syslog using more, less, grep or your favourite editor.

Connection reset by peer is an error generated when the remote side drops the connection. It implies that networking was up and that it established the connection but was dropped by USER software.


  • Thanks for the response. The card is 32GB and I've used 6GB so far so probably not an issue. I used journalctl as described in this post: raspberrypi.stackexchange.com/questions/79525/… I didn't try this earlier because I misinterpreted the post as stating that a bunch of file creation was a needed before you could begin logging. I think that only applies to journald. – Ninja Chris Feb 15 at 9:48
  • So if its not disk then its possible its memory.. The only issue is once a box runs out of disk or memory it possible that won't be any logs.. ;-) – Simon Banks Feb 15 at 10:36
  • So I suggest you monitor your system over hours, days etc and see if you have a memory leak.. e.g. Is your python script slowing devouring all of your memory? – Simon Banks Feb 15 at 10:37
  • you can even setup a script to top the contents of "top" into a log file on some interval (30 minutes maybe). This way you dont have to keep checking, and you will get a better picture of how the memory usage changes over time. It may reveal you have a memory leak, but maybe not in the application you were expecting. – Chad G Feb 15 at 16:36
  • You could also setup rsyslog to forward the logs to different server. That has some-chance of working even if your memory runs out.. – Simon Banks Feb 15 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.