1. The problem I’m having:
I’m using Ubuntu Server v22.04 on an rpi, with Caddy installed through apt using the https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main repo.
It did two updates recently, the latest one to v2.8.2, after this Caddy stopped working for me. I’ve not touched nor done any changes to the Caddyfile config.
2. Error messages and/or full log output:
jun 02 11:34:48 redacted caddy[19331]: caddy.AppDataDir=/var/lib/caddy/.local/share/caddy
jun 02 11:34:48 redacted caddy[19331]: caddy.AppConfigDir=/var/lib/caddy/.config/caddy
jun 02 11:34:48 redacted caddy[19331]: caddy.ConfigAutosavePath=/var/lib/caddy/.config/caddy/autosave.json
jun 02 11:34:48 redacted caddy[19331]: caddy.Version=v2.8.2 h1:81rawJP54kba4pEdl7Pglv6lIUa9RqdY1tY2UDFXUWc=
jun 02 11:34:48 redacted caddy[19331]: runtime.GOOS=linux
jun 02 11:34:48 redacted caddy[19331]: runtime.GOARCH=arm64
jun 02 11:34:48 redacted caddy[19331]: runtime.Compiler=gc
jun 02 11:34:48 redacted caddy[19331]: runtime.NumCPU=4
jun 02 11:34:48 redacted caddy[19331]: runtime.GOMAXPROCS=4
jun 02 11:34:48 redacted caddy[19331]: runtime.Version=go1.22.3
jun 02 11:34:48 redacted caddy[19331]: os.Getwd=/
jun 02 11:34:48 redacted caddy[19331]: LANG=sv_SE.UTF-8
jun 02 11:34:48 redacted caddy[19331]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
jun 02 11:34:48 redacted caddy[19331]: _WSREP_START_POSITION=
jun 02 11:34:48 redacted caddy[19331]: NOTIFY_SOCKET=/run/systemd/notify
jun 02 11:34:48 redacted caddy[19331]: HOME=/var/lib/caddy
jun 02 11:34:48 redacted caddy[19331]: LOGNAME=caddy
jun 02 11:34:48 redacted caddy[19331]: USER=caddy
jun 02 11:34:48 redacted caddy[19331]: INVOCATION_ID=476ac08803ec43be868a044bc1d61997
jun 02 11:34:48 redacted caddy[19331]: JOURNAL_STREAM=8:58232
jun 02 11:34:48 redacted caddy[19331]: SYSTEMD_EXEC_PID=19331
jun 02 11:34:48 redacted caddy[19331]: {"level":"info","ts":1717320888.0560284,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
jun 02 11:34:48 redacted caddy[19331]: Error: ambiguous config file format; please specify adapter (use --adapter)
jun 02 11:34:48 redacted systemd[1]: caddy.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit caddy.service has entered the 'failed' state with result 'exit-code'.
3. Caddy version:
v2.8.2 h1:81rawJP54kba4pEdl7Pglv6lIUa9RqdY1tY2UDFXUWc=
4. How I installed and ran Caddy:
Through apt using the https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main repo.
a. System environment:
Ubuntu Server v22.04 aarch64 with the 5.15.0-1055-raspi kernel
b. Command:
systemctl start caddy
or
caddy run --config /etc/caddy/Caddyfile
Both produce the same error: Error: ambiguous config file format; please specify adapter (use --adapter)
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 --force
TimeoutStopSec=5s
LimitNOFILE=1048576
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddy config:
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.
redacted.local {
# Set this path to your site's directory.
root * /var/www/
# Enable the static file server.
file_server browse
# Another common task is to set up a reverse proxy:
#reverse_proxy localhost:8080
# Or serve a PHP site through php-fpm:
php_fastcgi unix//run/php/php-fpm.sock
}
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile