GaragePi
GaragePi copied to clipboard
webserver becomes non-responsive over time.
What's Wrong
Have noticed after running garage_pi for several weeks it will eventually stop loading the webpage.
Environment Info
RPi Model: rpi2
OS Release: jessie
Service Status:
Attach Logs
I have attempted the following:
- checked for full filesystems, everything was within tolerance (nothing full or close to full)
- remove all logs in the garage_pi/instance directory, then reboot.... still no webserver working.
- removed the history.db, still not webserver working
The only thing that worked was to restore a previous backup that is known to be good.... then reboot and my webserver works.
So there must be something else, perhaps a caching tolerance that reaches a limit? Not sure where to check this.
You mentioned purging the logs. Was the sd card full when you did? I didn't have the magnetic reed switch wired up yet. So the input was "dangling" randomly switching the status between open and closed. This was generating log files very quickly. I could see that filling up the storage after a few days or a week or two depending on size.
I have seen similar behaviour as well, but I find that I can't ssh into the device either when it is happening so I need to do a hard reset. When I log back in, I notice that the history has continued to be populated with open/close events even when it seemed unresponsive. I am thinking it could also be network/wifi related as it doesn't appear in my router's DHCP client list. Are you having any network issues @fireheadman?
The SD card is nowhere near full in my case.
pi@garagepi:~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 7.0G 2.3G 4.4G 35% /
devtmpfs 87M 0 87M 0% /dev
tmpfs 215M 0 215M 0% /dev/shm
tmpfs 86M 696K 86M 1% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
/dev/mmcblk0p1 253M 49M 204M 20% /boot
tmpfs 43M 0 43M 0% /run/user/1000
I've had this running successfully for over two weeks now, the cause for my issue was that wifi was dropping and not reconnecting automatically. I applied the following fix to /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
from this article: https://unix.stackexchange.com/questions/566992/embedded-device-wpa-supplicant-reconnect
# Enable WiFi scanning on network disconnect.
ap_scan=1
# Make wpa_supplicant do the scan instead of relying on the driver.
disable_scan_offload=1