caddyserver / caddy

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
https://caddyserver.com
Apache License 2.0
55.48k stars 3.91k forks source link

`Error: ambiguous config file format; please specify adapter (use --adapter)` since 2.8.2 #6363

Closed foux closed 1 month ago

foux commented 1 month ago

Hello, Since 2.8.2 my Caddy doesn't starts with the error Error: ambiguous config file format; please specify adapter (use --adapter)

I get the meaning of the error and why I get it (Caddy couldn't detect the language without ambiguities). What I'm not getting is how I can pass the Adapter option. I'm running Caddy on debian through systemd, and is there a way to pass this adatper without having to override the systemd unit file (for exemple an entry in the Caddyfile itself) ?

Thanks for your help. Here is my current very simple Caddyfile :

my.fdn.site {
        reverse_proxy 127.0.0.1:8080
}
encbladexp commented 1 month ago

I have the same issue, but creating a system override file "fixed" it as a workaround for now:

# /etc/systemd/system/caddy.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/caddy run --adapter caddyfile --environ --config /etc/caddy/Caddyfile
ExecReload=
ExecReload=/usr/bin/caddy reload --adapter caddyfile --config /etc/caddy/Caddyfile --force
foux commented 1 month ago

I though about it, but I would prefer not creating an override, because it would also override any future way of starting Caddy. I'll go that way if there's no alternative, but I'd like to be sure there isn't one before ;)

francislavoie commented 1 month ago

This will be fixed by https://github.com/caddyserver/caddy/pull/6362

foux commented 1 month ago

This will be fixed by https://github.com/caddyserver/caddy/pull/6362

Thanks! I'll do the override in the meantime. Keeping the issue open for others till it's fixed

33b5e5 commented 1 month ago

This just hit me on Ubuntu 24.04 LTS. I noticed Caddy was no longer running after the (automated) update of the pkg.

crazyuploader commented 1 month ago

Affected here as well, Caddy stopped starting suddenly after package updates

TillW99 commented 1 month ago

Same Problem here, dont want to override so ich will stay at 2.7.6 - hope it get fixed as soon as possible

xxf185 commented 1 month ago

2.8.2 Same startup failure

mohammed90 commented 1 month ago

Those of you experiencing it, you can test the fix by downloading the CI artifacts from here: https://github.com/caddyserver/caddy/actions/runs/9337830397

bsinou commented 1 month ago

I observed the same yesterday on Debian 12, after simple apt update / upgrade. I could workaround using the tip from @encbladexp (thx!)

This morning,"apt upgrade" brought the 2.8.4:

Thanks for the quick fix (and the overall nice work)!!