I'm building a traefik provider plugin, it's failing to load with an immediate runtime panic. I'm at a loss on the best way to debug, I've installed yaegi locally hoping I could reproduce there but not sure how to simulate loading the plugin?
Any help would be appreciated!
Thanks, Dan
Here's some logs with the error:
raefik-test | time="2024-11-12T19:19:57Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
traefik-test | time="2024-11-12T19:19:57Z" level=info msg="Traefik version 2.10.7 built on 2023-12-06T15:54:59Z"
traefik-test | time="2024-11-12T19:19:57Z" level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"traefik\":{\"address\":\":8080\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\":{\"timeout\":\"3s\"}},\"web\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\":{\"timeout\":\"3s\"}}},\"providers\":{\"providersThrottleDuration\":\"2s\",\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmModeRefreshSeconds\":\"15s\"}},\"api\":{\"insecure\":true,\"dashboard\":true},\"metrics\":{\"prometheus\":{\"buckets\":[0.1,0.3,1.2,5],\"addEntryPointsLabels\":true,\"addServicesLabels\":true,\"entryPoint\":\"traefik\"}},\"log\":{\"level\":\"DEBUG\",\"format\":\"common\"},\"experimental\":{\"localPlugins\":{\"traefik_cloud_saver\":{\"moduleName\":\"github.com/danbiagini/traefik-cloud-saver\"}}}}"
traefik-test | time="2024-11-12T19:19:57Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://doc.traefik.io/traefik/contributing/data-collection/\n"
traefik-test | time="2024-11-12T19:19:57Z" level=error msg="plugins-local/src/github.com/danbiagini/traefik-cloud-saver/vendor/google.golang.org/grpc/grpclog/loggerv2.go:36:17: panic" module=github.com/danbiagini/traefik-cloud-saver plugin=plugin-traefik_cloud_saver
traefik-test | time="2024-11-12T19:19:57Z" level=error msg="plugins-local/src/github.com/danbiagini/traefik-cloud-saver/vendor/google.golang.org/grpc/grpclog/grpclog.go:33:14: panic" module=github.com/danbiagini/traefik-cloud-saver plugin=plugin-traefik_cloud_saver
traefik-test | panic: runtime error: invalid memory address or nil pointer dereference [recovered]
traefik-test | panic: runtime error: invalid memory address or nil pointer dereference [recovered]
traefik-test | panic: runtime error: invalid memory address or nil pointer dereference
traefik-test | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x44b068]
traefik-test |
traefik-test | goroutine 1 [running]:
traefik-test | github.com/traefik/yaegi/interp.runCfg.func1()
traefik-test | github.com/traefik/yaegi@v0.15.1/interp/run.go:205 +0x16c
traefik-test | panic({0x3c26ec0?, 0x8491c80?})
traefik-test | runtime/panic.go:914 +0x218
traefik-test | github.com/traefik/yaegi/interp.runCfg.func1()