jacksontj / promxy

An aggregating proxy to enable HA prometheus
MIT License
1.17k stars 131 forks source link

/classic/status endpoint get panic on v0.0.67 #391

Closed Wing924 closed 3 years ago

Wing924 commented 3 years ago

got error message when access /classic/status page.

Error running handler: goroutine 2173 [running]:
runtime/debug.Stack(0xc00064af50, 0x25958a0, 0x421e490)
    /usr/local/go/src/runtime/debug/stack.go:24 +0x9f
github.com/jacksontj/promxy/pkg/logging.(*ApacheLoggingHandler).runHandler.func1(0xc00064bb48)
    /go/src/github.com/jacksontj/promxy/pkg/logging/logging.go:135 +0x46
panic(0x25958a0, 0x421e490)
    /usr/local/go/src/runtime/panic.go:969 +0x1b9
github.com/prometheus/prometheus/web.(*Handler).status(0xc00090d200, 0x7f5735935b78, 0xc0008fe900, 0xc001268600)
    /go/src/github.com/jacksontj/promxy/vendor/github.com/prometheus/prometheus/web/web.go:769 +0x2d6
github.com/prometheus/prometheus/web.(*Handler).testReady.func1(0x7f5735935b78, 0xc0008fe900, 0xc001268600)
    /go/src/github.com/jacksontj/promxy/vendor/github.com/prometheus/prometheus/web/web.go:518 +0x55
net/http.HandlerFunc.ServeHTTP(0xc0009013e0, 0x7f5735935b78, 0xc0008fe900, 0xc001268600)
    /usr/local/go/src/net/http/server.go:2042 +0x44
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerResponseSize.func1(0x7f5735935b78, 0xc0008fe8d0, 0xc001268600)
    /go/src/github.com/jacksontj/promxy/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go:198 +0xe9
net/http.HandlerFunc.ServeHTTP(0xc0009967b0, 0x7f5735935b78, 0xc0008fe8d0, 0xc001268600)
    /usr/local/go/src/net/http/server.go:2042 +0x44
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func2(0x7f5735935b78, 0xc0008fe8d0, 0xc001268600)
    /go/src/github.com/jacksontj/promxy/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go:76 +0xb2
net/http.HandlerFunc.ServeHTTP(0xc000996960, 0x7f5735935b78, 0xc0008fe8d0, 0xc001268600)
    /usr/local/go/src/net/http/server.go:2042 +0x44
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1(0x3117ea0, 0xc0011a23f0, 0xc001268600)
    /go/src/github.com/jacksontj/promxy/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go:101 +0xda
github.com/prometheus/prometheus/web.setPathWithPrefix.func1.1(0x3117ea0, 0xc0011a23f0, 0xc001268500)
    /go/src/github.com/jacksontj/promxy/vendor/github.com/prometheus/prometheus/web/web.go:1140 +0x1dc
github.com/prometheus/common/route.(*Router).handle.func1(0x3117ea0, 0xc0011a23f0, 0xc001268400, 0x0, 0x0, 0x0)
    /go/src/github.com/jacksontj/promxy/vendor/github.com/prometheus/common/route/route.go:83 +0x283
github.com/julienschmidt/httprouter.(*Router).ServeHTTP(0xc000485e60, 0x3117ea0, 0xc0011a23f0, 0xc001268400)
    /go/src/github.com/jacksontj/promxy/vendor/github.com/julienschmidt/httprouter/router.go:387 +0xc7e
github.com/prometheus/common/route.(*Router).ServeHTTP(...)
    /go/src/github.com/jacksontj/promxy/vendor/github.com/prometheus/common/route/route.go:121
main.main.func5(0x3117ea0, 0xc0011a23f0, 0xc001268400)
    /go/src/github.com/jacksontj/promxy/cmd/promxy/main.go:381 +0x2aa
net/http.HandlerFunc.ServeHTTP(0xc000507590, 0x3117ea0, 0xc0011a23f0, 0xc001268400)
    /usr/local/go/src/net/http/server.go:2042 +0x44
github.com/julienschmidt/httprouter.(*Router).ServeHTTP(0xc0003be7e0, 0x3117ea0, 0xc0011a23f0, 0xc001268400)
    /go/src/github.com/jacksontj/promxy/vendor/github.com/julienschmidt/httprouter/router.go:448 +0x1d2
github.com/jacksontj/promxy/pkg/logging.(*ApacheLoggingHandler).runHandler(0xc0008b89c0, 0x3117ea0, 0xc0011a23f0, 0xc001268400, 0x0, 0x0)
    /go/src/github.com/jacksontj/promxy/pkg/logging/logging.go:138 +0x85
github.com/jacksontj/promxy/pkg/logging.(*ApacheLoggingHandler).ServeHTTP(0xc0008b89c0, 0x31255a0, 0xc0010262a0, 0xc001268400)
    /go/src/github.com/jacksontj/promxy/pkg/logging/logging.go:161 +0x225
net/http.serverHandler.ServeHTTP(0xc00091c0e0, 0x31255a0, 0xc0010262a0, 0xc001268400)
    /usr/local/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc0003cedc0, 0x312eda0, 0xc000988240)
    /usr/local/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2969 +0x36c
Wing924 commented 3 years ago

I confirmed master branch, it has been fixed! thank you!