As does anything on the command line .e.g caddy -h
Full Error list:
caddy -t
panic: duplicate metrics collector registration attempted
goroutine 1 [running]:
github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0xc0000a65f0, 0xc0007fcf90, 0x1, 0x1)
github.com/prometheus/client_golang@v1.7.1/prometheus/registry.go:401 +0xad
github.com/prometheus/client_golang/prometheus.MustRegister(...)
github.com/prometheus/client_golang@v1.7.1/prometheus/registry.go:178
github.com/caddyserver/caddy/vHEAD.init.1()
github.com/caddyserver/caddy/vHEAD@v0.0.0-00010101000000-000000000000/metrics.go:14 +0xb2```
#### a. System environment:
Mac Catalina 10.15.7 (19H2)
Homebrew 2.5.2
#### a. Caddy File same as my one in this post:
https://caddy.community/t/caddy-v2-file-for-kirby-2-kirby-3-on-local-sites/8109
### 3. The problem I'm having:
Previously working Caddy, upgraded via Brew (Mac) throws error when running. Cannot troubleshoot as any thing crashes it.
### 4. Error messages and/or full log output:
See above:
### 5. What I already tried:
Rebooted, same error.
### 6. Links to relevant resources:
Yeah… based on that stack trace which is identifying the module version in a super-weird way ( github.com/caddyserver/caddy/vHEAD@v0.0.0-00010101000000-000000000000), I think init() is being called twice (which is totally not OK) - this is the line that’s panicing - caddy/metrics.go at master · caddyserver/caddy · GitHub - and it will panic if init() is called twice.
Many thanks @hairyhenderson and @francislavoie for your speedy replies. Read the thread over on Homebrew, sadly I’m no expert on brew, so I guess I will have to wait until the changes have been released.
I much appreciate all your help. I will advise when it has been updated and working again so it can be closed here.
@WoofDog there’s a PR in for the changes, but I’m not sure when or if they’ll accept it.
As convenient as Homebrew is, the Caddy formula is not an official distribution, and we do sometimes see issues there that aren’t present with the official macOS binaries (like here).
So unless and until the Homeberw PR is merged I would recommend using the officially-built binary instead. It’s not as convenient, to be sure, but it does work