caddyserver / caddy

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

v2.8 is a major breaking change: update to CertMagic breaks LegoDeprecated #6351

Closed coolaj86 closed 4 months ago

coolaj86 commented 4 months ago

There's a bunch more to the stack trace, but I believe that what's given here is sufficient to understand and identify the problem.

CGO_ENABLED=0 xcaddy build 'v2.8.1' --with github.com/caddy-dns/lego-deprecated
caddy run --envfile ./.env --config ./Caddyfile
2024/05/30 18:33:34.256INFOtls.cache.maintenancestarted background certificate maintenance{"cache": "0x140004c8b80"}
panic: interface conversion: *legodeprecated.LegoDeprecated is not certmagic.DNSProvider: missing method AppendRecords

goroutine 1 [running]:
github.com/caddyserver/caddy/v2@v2.8.1/modules/caddytls/acmeissuer.go:148 +0x774
github.com/caddyserver/caddy/v2@v2.8.1/context.go:369 +0x5f8
github.com/caddyserver/caddy/v2@v2.8.1/context.go:419 +0x12c
./caddy run --config Caddyfile.development --envfile ./.env
2024/05/30 18:33:34.247INFOusing config from file{"file": "Caddyfile.development"}
2024/05/30 18:33:34.251INFOadapted config to JSON{"adapter": "caddyfile"}
2024/05/30 18:33:34.255INFOadminadmin endpoint started{"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}
2024/05/30 18:33:34.256INFOtls.cache.maintenancestarted background certificate maintenance{"cache": "0x140004c8b80"}
panic: interface conversion: *legodeprecated.LegoDeprecated is not certmagic.DNSProvider: missing method AppendRecords

I imagine that there's some rationale as to why this isn't technically a breaking change because it of "Core" vs "Community" API guarantees or some such.

That doesn't matter as much to me as that a deploy failed unexpectedly, so it looks like we should assume that minor versions can be major breaking changes from now on.

francislavoie commented 4 months ago

See the release notes, it's intentional. https://github.com/caddyserver/caddy/releases/tag/v2.8.0

Caddy does not follow semver. Think of v2 as the product version, and .8 as the major version, if you prefer to think of it that way.