Statamic website down? What to check first
Posted by Stephen Meehan in Statamic, Maintenance Services. Published .
A Statamic website down for a minute or two at a time, then back before I could open a terminal, is one of the more frustrating problems I've worked on. The uptime monitor logged every outage. Finding the cause took longer.
Most outages are simpler than that. The site stops loading, someone emails to say so, and the quickest way back is to work out which part has failed before touching anything. Statamic is a content management system (CMS) built on Laravel, so the checks below work through the domain, the server and the site itself, in that order.
Is the Statamic website down for everyone?
Check it isn't only you. Open the site on your phone with Wi-Fi turned off. If it loads there, the problem is more likely your office network or browser than the site.
Then narrow it down. Is the whole site down, or one page? Does the Control Panel (CP) at /cp still load? A site with static caching turned on can keep serving saved copies of its pages while everything behind them is broken, so a working home page doesn't prove the site is healthy.
What the error page tells you
The error page is the best clue you have. Each one points somewhere different.
Read the error before you change anything. A restart can make the symptom go away without telling you why it happened.
Check the log, then what changed
These checks need access to the server, so they're for whoever looks after your hosting. Laravel writes errors to a log file in the site's storage/logs folder, and the last few lines usually name the problem. If the site keeps one log per day, read the newest dated file instead. A full disk can stop the site and the log at the same time, so check free space too.
tail -n 50 storage/logs/laravel.log
df -hThen ask what changed in the last day or two. A deploy, a Composer update (Composer installs Statamic and its add-ons), a new PHP version on the server, or a content file edited by hand can all take a site down. Statamic keeps content in files rather than a database, so one broken file can stop the pages that use it from loading.
If the site is stuck in maintenance mode after a failed update, php artisan up brings it back. Fix whatever stopped the update first, or visitors will land on a half-updated site.
When to stop and call for help
If the log doesn't make sense, or the server isn't yours to touch, stop there and call your developer or host. Guessing at fixes on a live site can turn one problem into two.
The bigger change is hearing about an outage before your visitors do. Every Statamic maintenance plan I run includes 24/7 uptime monitoring, so the alert comes to me rather than from a customer. Monitoring won't prevent every outage, but someone who knows the site finds out the moment it goes down.
Written by
Stephen Meehan – Designer & Developer
Stephen has been making websites since 1999 (gulp). He started D3 Creative in 2005, and now builds and looks after Statamic sites. Clients stay because he actually gives a damn, and he makes them look good doing it.