Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring remote admin without identity management triggers panic in CertMagic #4478

Closed
yroc92 opened this issue Dec 13, 2021 · 1 comment
Assignees
Labels
bug 🐞 Something isn't working
Milestone

Comments

@yroc92
Copy link
Collaborator

yroc92 commented Dec 13, 2021

As discussed with @mholt: given a config like the one below, Caddy incorrectly calls CertMagic and triggers a panic. See stack trace below.

Config

{
  "logging": {
    "logs": {
      "default": {
        "level": "DEBUG"
      }
    }
  },
  "admin": {
    "remote": {
      "listen": ":2099",
      "access_control": [{
	"public_keys": [<redacted>]
      }]
    }
  }
}

Stack trace

panic: a certificate cache is required

goroutine 1 [running]:
github.com/caddyserver/certmagic.New(...)
        github.com/caddyserver/[email protected]/config.go:169
github.com/caddyserver/caddy/v2.(*IdentityConfig).certmagicConfig(0x0, 0x140002f2cc0, 0x0)
        github.com/caddyserver/caddy/[email protected]/admin.go:536 +0x248
github.com/caddyserver/caddy/v2.replaceRemoteAdminServer({{0x1037fd2d0, 0x1400003a480}, 0x14000879a70, 0x14000052050, {0x0, 0x0, 0x0}}, 0x14000052050)
        github.com/caddyserver/caddy/[email protected]/admin.go:470 +0x328
github.com/caddyserver/caddy/v2.finishSettingUp({{0x1037fd2d0, 0x1400003a480}, 0x14000879a70, 0x14000052050, {0x0, 0x0, 0x0}}, 0x14000052050)
        github.com/caddyserver/caddy/[email protected]/caddy.go:473 +0xd8
github.com/caddyserver/caddy/v2.run(0x14000052050, 0x1)
        github.com/caddyserver/caddy/[email protected]/caddy.go:458 +0x390
github.com/caddyserver/caddy/v2.unsyncedDecodeAndRun({0x1400083b500, 0x658, 0x700}, 0x1)
        github.com/caddyserver/caddy/[email protected]/caddy.go:277 +0x140
github.com/caddyserver/caddy/v2.changeConfig({0x103207bc8, 0x4}, {0x103212800, 0x7}, {0x1400083a700, 0x6be, 0x6bf}, 0x1)
        github.com/caddyserver/caddy/[email protected]/caddy.go:168 +0x4d0
github.com/caddyserver/caddy/v2.Load({0x1400083a700, 0x6be, 0x6bf}, 0x1)
        github.com/caddyserver/caddy/[email protected]/caddy.go:114 +0x88
github.com/caddyserver/caddy/v2/cmd.cmdRun({0x140001b35c0})
        github.com/caddyserver/caddy/[email protected]/cmd/commandfuncs.go:213 +0x7bc
github.com/caddyserver/caddy/v2/cmd.Main()
        github.com/caddyserver/caddy/[email protected]/cmd/main.go:85 +0x4a4
main.main()
        caddy/main.go:11 +0x20
@francislavoie francislavoie added bug 🐞 Something isn't working upstream ⬆️ Relates to some dependency of this project labels Dec 13, 2021
@mholt mholt removed the upstream ⬆️ Relates to some dependency of this project label Dec 13, 2021
@mholt
Copy link
Member

mholt commented Dec 13, 2021

Thanks Cory.

@francislavoie Just FYI I was on the phone with Cory earlier and this is a bug in how Caddy is calling CertMagic. It's a user error, but we should handle it better and improve documentation too.

@mholt mholt self-assigned this Dec 13, 2021
@mholt mholt added this to the v2.5.0 milestone Dec 13, 2021
@mholt mholt closed this as completed in b4bfa29 Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants