1. The problem I’m having:
I am using Systemd. Unable to reload Caddy. It was running okay, but I updated the caddyfile and I needed to reload it, so I ran sudo systemctl reload caddy. However, it timed out silently (Timeout in journalctl but it did not hang up).
Afterwards, I ran sudo systemctl stop caddy
. However, there were some dangling processes when I ran ps aux | grep caddy. I kill -9 them.
100032 660950 0.0 0.1 1269804 47680 ? Sl 10:42 0:00 /usr/bin/caddy run --config /Caddyfile
root 661661 0.0 0.0 239916 9984 pts/0 T 10:49 0:00 sudo systemctl reload caddy
root 661663 0.0 0.0 237768 8704 pts/0 T 10:49 0:00 systemctl reload caddy
vestati+ 663504 0.0 0.0 221664 2304 pts/0 S+ 10:58 0:00 grep --color=auto caddy
Even after this, when I ran sudo systemctl start
, I was unable to start Caddy. Journalctl output is listed below. I have already run lsof -i :8443
and it is not in use by any other reverse proxy (I do not even have nginx or apache enabled)
2. Error messages and/or full log output:
This is when it was working, and hung on a reload, then I ran systemctl stop.
Jan 20 09:10:14 etune caddy[400091]: {"level":"info","ts":1737335414.257538,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/
caddy/autosave.json"}
Jan 20 09:10:14 etune caddy[400091]: {"level":"info","ts":1737335414.2575674,"msg":"serving initial configuration"}
Jan 20 09:10:14 etune systemd[1]: Started Caddy.
Jan 20 09:10:14 etune caddy[400091]: {"level":"info","ts":1737335414.2974813,"logger":"tls","msg":"cleaning storage unit","storage":"FileStorage:/var/lib/cadd
y/.local/share/caddy"}
Jan 20 09:10:14 etune caddy[400091]: {"level":"info","ts":1737335414.405895,"logger":"tls","msg":"finished cleaning storage units"}
Jan 20 09:12:37 etune caddy[400091]: {"level":"info","ts":1737335557.9376636,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2
019","uri":"/stop","remote_ip":"127.0.0.1","remote_port":"45662","headers":{"Accept-Encoding":["gzip"],"Content-Length":["0"],"Origin":["http://localhost:2019
"],"User-Agent":["Go-http-client/1.1"]}}
Jan 20 09:12:37 etune caddy[400091]: {"level":"warn","ts":1737335557.9379663,"logger":"admin.api","msg":"exiting; byeee!! 👋"}
Jan 20 09:12:37 etune caddy[400091]: {"level":"info","ts":1737335557.9379766,"logger":"http","msg":"servers shutting down with eternal grace period"}
Jan 20 09:12:37 etune caddy[400091]: {"level":"info","ts":1737335557.9382372,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
Jan 20 09:12:37 etune caddy[400091]: {"level":"info","ts":1737335557.9382453,"logger":"admin.api","msg":"shutdown complete","exit_code":0}
Jan 20 09:12:37 etune systemd[1]: caddy.service: Deactivated successfully.
Jan 20 09:51:23 etune systemd[1]: Starting Caddy...
Jan 20 09:51:23 etune caddy[597523]: caddy.HomeDir=/var/lib/caddy
This is when I try and start again. (I tried for 2 hours).
Jan 20 11:04:52 etune caddy[664101]: > {"level":"info","ts":1737342292.138957,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
Jan 20 11:04:52 etune caddy[664101]: {"level":"info","ts":1737342292.1390014,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
Jan 20 11:04:52 etune caddy[664101]: {"level":"info","ts":1737342292.139086,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 7168 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details."}
Jan 20 11:04:52 etune caddy[664101]: {"level":"info","ts":1737342292.1391923,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
Jan 20 11:04:52 etune caddy[664101]: {"level":"info","ts":1737342292.1392403,"logger":"http","msg":"enabling HTTP/3 listener","addr":":8443"}
Jan 20 11:04:52 etune caddy[664101]: Error: loading initial config: loading new config: http app module: start: starting HTTP/3 QUIC listener: listen udp :8443: bind: permission denied
Jan 20 11:04:52 etune systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Jan 20 11:04:52 etune systemd[1]: caddy.service: Failed with result 'exit-code'.
Jan 20 11:04:52 etune systemd[1]: Failed to start Caddy.
3. Caddy version:
v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=
4. How I installed and ran Caddy:
a. System environment:
systemd, Red Hat Enterprise Linux release 9.5 (Plow)
b. Command:
dnf install 'dnf-command(copr)'
dnf copr enable @caddy/caddy
dnf install caddy
sudo systemctl daemon-reload
sudo systemctl enable --now caddy
c. Service/unit/compose file:
caddy.service
d. My complete Caddy config:
nextcloud.etuneworks.com {
reverse_proxy localhost:11000
}
https://nextcloud.etuneworks.com:8443 {
reverse_proxy localhost:11001 {
transport http {
tls_insecure_skip_verify
}
}
}
5. Links to relevant resources:
I read this and a few other posts already