1. Output of caddy version
:
v2.6.1 h1:EDqo59TyYWhXQnfde93Mmv4FJfYe00dO60zMiEt+pzo=
2. How I run Caddy:
a. System environment:
|Distributor ID:|Debian|
|Description:|Debian GNU/Linux 10 (buster)|
|Release:|10|
|Codename:|buster|
b. Command:
sudo systemctl restart caddy.service
c. Service/unit/compose file:
# caddy.service
#
# For using Caddy with a config file.
#
# Make sure the ExecStart and ExecReload commands are correct
# for your installation.
#
# See https://caddyserver.com/docs/install for instructions.
#
# WARNING: This service does not use the --resume flag, so if you
# use the API to make changes, they will be overwritten by the
# Caddyfile next time the service is restarted. If you intend to
# use Caddy's API to configure it, add the --resume flag to the
# `caddy run` command or use the caddy-api.service file instead.
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
#Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddy config:
{
on_demand_tls {
ask http://builder.mp-app.com/php/caddyAsk.php
interval 2m
burst 5
}
}
https://
tls {
on_demand
}
reverse_proxy 198.58.122.179
3. The problem I’m having:
Caddy has been stable for weeks and today it is starting to crash often.
4. Error messages and/or full log output:
jimcook@mpaproxy:~$ sudo systemctl status caddy.service
sudo: unable to resolve host mpaproxy: Name or service not known
[sudo] password for jimcook:
● caddy.service - Caddy
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2022-10-10 16:51:46 EDT; 25min ago
Docs: https://caddyserver.com/docs/
Process: 14010 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=exited, status=2)
Main PID: 14010 (code=exited, status=2)
Oct 10 16:51:46 mpaproxy caddy[14010]: github.com/caddyserver/certmagic.(*Config).renewCert(0xc00068ed10, {0x1e1c6a0, 0xc0001d4ea0}, {0xc000138a20, 0x11}, 0x0, 0x0)
Oct 10 16:51:46 mpaproxy caddy[14010]: github.com/caddyserver/certmagic@v0.17.1/config.go:860 +0x58b
Oct 10 16:51:46 mpaproxy caddy[14010]: github.com/caddyserver/certmagic.(*Config).RenewCertAsync(...)
Oct 10 16:51:46 mpaproxy caddy[14010]: github.com/caddyserver/certmagic@v0.17.1/config.go:690
Oct 10 16:51:46 mpaproxy caddy[14010]: github.com/caddyserver/certmagic.(*Config).renewDynamicCertificate.func3({0x1e1c6a0, 0xc0001d4ea0}, 0xc0008526f0?)
Oct 10 16:51:46 mpaproxy caddy[14010]: github.com/caddyserver/certmagic@v0.17.1/handshake.go:664 +0x2ac
Oct 10 16:51:46 mpaproxy caddy[14010]: created by github.com/caddyserver/certmagic.(*Config).renewDynamicCertificate
Oct 10 16:51:46 mpaproxy caddy[14010]: github.com/caddyserver/certmagic@v0.17.1/handshake.go:699 +0x1293
Oct 10 16:51:46 mpaproxy systemd[1]: caddy.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Oct 10 16:51:46 mpaproxy systemd[1]: caddy.service: Failed with result 'exit-code'.
5. What I already tried:
I have restarted caddy several times