Debugging Caddy crash

Last night my website hosted through Caddy went down. I was able to restart it by restarting the systemd process. Caddy ran for ~35 days without problem and I’m trying to identify why it crashed. When I run journalctl -u caddy.service there is not anything useful in the log, just the caddy launch message from Feb 23 and March 27. Any thoughts on how I can debug the crash?

I am running Caddy 0.9.5 on Ubuntu 16.04.

What was in Caddy’s process log (specified with -log)? And what do you mean by “went down” - did the process terminate entirely or just stop responding to requests or something else?

systemd isn’t going to capture anything if you didn’t pass a -log option in your Caddy start script. You amend a -log stdout as a minimum to your caddy start script.

@surfearth are you using the suggested systemd service file from here? It properly logs to stdout for journalctl to receive
https://github.com/mholt/caddy/tree/master/dist/init/linux-systemd

@matt on an aside maybe the Caddy logfile null value should be stdout or stderr instead of ioutil.Discard ? Why throw it away when things like journalctl could be capturing any crash output? Just my 2 cents

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.