Problem Statement
What failed
The browser showed a Cloudflare Tunnel error and reported that the origin service could not be reached. The site recovered only after physical Raspberry Pi reboots, which made the failure operationally disruptive and worth converting into a formal SOP.
01
Cloudflare symptom
The public error was Cloudflare Error 1033, which means Cloudflare could not reach the configured tunnel origin.
02
Service impact
The website and contact path were unavailable, so the incident affected both portfolio visibility and communication.
03
Recurring trigger
The pattern was periodic and aligned with Apache log rotation behavior rather than a random network outage.
Root Cause Analysis
How the failing layer was isolated
The investigation checked the tunnel, Apache, memory state, Apache logs, and logrotate configuration. This separated the Cloudflare-facing symptom from the actual origin-service failure.
01
Tunnel status checked
cloudflared was active with registered tunnel connections, so the tunnel process itself was not the primary fault.
sudo systemctl status cloudflared
02
Apache status checked
Apache was stopped at the time of the error. Restarting Apache restored the website.
sudo systemctl status apache2
03
Memory ruled out
Available memory and kernel logs did not show an out-of-memory kill, so memory pressure was not the immediate cause.
free -h
dmesg | grep -i 'killed'
04
Apache log signal found
Apache logs showed a graceful shutdown signal, which pointed toward reload behavior during maintenance tasks.
sudo grep -i 'caught signal' /var/log/apache2/error.log
05
Logrotate source identified
The Apache logrotate postrotate action used reload, which was sending the signal that caused Apache to shut down without recovering cleanly.
sudo cat /etc/logrotate.d/apache2
Rollback Plan
Safe reversal path
The SOP also documents how to reverse the changes if needed: revert Apache logrotate to its previous reload behavior, remove the Apache systemd override, reload systemd, disable swap, remove the fstab entry, and delete the swap file.
sudo systemctl revert apache2
sudo systemctl daemon-reload
sudo swapoff /swapfile
# remove /swapfile line from /etc/fstab
sudo rm /swapfile