Open klingtnet opened 7 years ago
Hi @klingtnet,
It seems the problem is there's another plugin that uses grpc
and https://github.com/grpc/grpc-go/blob/master/trace.go imports golang.org/x/net/trace
which in turn registers /debug/requests
and /debug/events
handlers in it's init()
function to the Go default http muxer.
(https://github.com/golang/net/blob/master/trace/trace.go#L112-L117)
I'm not sure yet if it will be possible to fix it from within my plugin as the problem is deeply entrenched in the grpc package.
I've established that it's the dns
server type that's also using grpc
, so a temporary solution would be to exclude the other plugin if you want to use one of them(exclude dns
if you want to use grpc
or vice versa ). Obviously this is not ideal if you want to use both plugins.
I have tested it by excluding dns
plugin as follows:
curl -Lsf 'https://caddyserver.com/download/linux/amd64?plugins=http.authz,http.awslambda,http.cgi,http.cors,http.datadog,http.expires,http.filemanager,http.filter,http.git,http.gopkg,http.grpc,http.hugo,http.ipfilter,http.jwt,http.login,http.mailout,http.minify,http.prometheus,http.proxyprotocol,http.ratelimit,http.realip,http.reauth,http.upload,net,tls.dns.cloudflare,tls.dns.digitalocean,tls.dns.dnsimple,tls.dns.dnspod,tls.dns.dyn,tls.dns.exoscale,tls.dns.gandi,tls.dns.googlecloud,tls.dns.linode,tls.dns.namecheap,tls.dns.ovh,tls.dns.rackspace,tls.dns.rfc2136,tls.dns.route53,tls.dns.vultr' | tar -xvz caddy && ./caddy
Pieter
If I add all the plugins as well as github.com/pieterlouw/caddy-grpc
,
panic: /debug/requests is already registered. You may have two independent copies of golang.org/x/net/trace in your binary, trying to maintain separate state. This may involve a vendored copy of golang.org/x/net/trace.
Caddy 0.10.4 fails to start because there are
multiple registrations for /debug/requests
. A build without this plugin runs fine.Steps to reproduce the issue:
Caddy starts fine without this plugin :