~sircmpwn/chartsrv-discuss

Panic on simple query, built on macOS Mojave

Details
Message ID
<ece33e0fa67049c309e46716e9f19618@leaversmith.com>
DKIM signature
missing
Download raw message
Hello

I love the look of this application and want to start using it for some projects at work, but I've hit an issue when making any sort of query against the endpoint. *Not* passing in the query param gives me a UI error, so I know the forwarding is working OK. The output from the application at the time of the panic is below and includes the request:

2020/10/16 08:47:14 "GET http://localhost:8142/chart.svg?query=kubelet_volume_stats_available_bytes HTTP/1.1" from 127.0.0.1:49381 - 000 0B in 40.057658ms
2020/10/16 08:47:14 http: panic serving 127.0.0.1:49381: runtime error: index out of range [1] with length 1
goroutine 182 [running]:
net/http.(*conn).serve.func1(0xc00030c780)
	/usr/local/Cellar/go/1.13.1/libexec/src/net/http/server.go:1767 +0x139
panic(0x15cd640, 0xc000452640)
	/usr/local/Cellar/go/1.13.1/libexec/src/runtime/panic.go:679 +0x1b2
main.main.func1(0x2719fd8, 0xc000034b80, 0xc000156d00)
	/Users/ole09/repos/chartsrv/app/main.go:232 +0x1a48
net/http.HandlerFunc.ServeHTTP(0x163f520, 0x2719fd8, 0xc000034b80, 0xc000156d00)
	/usr/local/Cellar/go/1.13.1/libexec/src/net/http/server.go:2007 +0x44
github.com/go-chi/chi.(*Mux).routeHTTP(0xc0000b84e0, 0x2719fd8, 0xc000034b80, 0xc000156d00)
	/Users/ole09/repos/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/mux.go:431 +0x278
net/http.HandlerFunc.ServeHTTP(0xc0000bbeb0, 0x2719fd8, 0xc000034b80, 0xc000156d00)
	/usr/local/Cellar/go/1.13.1/libexec/src/net/http/server.go:2007 +0x44
github.com/go-chi/chi/middleware.RequestLogger.func1.1(0x16e7560, 0xc0003287e0, 0xc000156c00)
	/Users/ole09/repos/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/middleware/logger.go:46 +0x2be
net/http.HandlerFunc.ServeHTTP(0xc000178630, 0x16e7560, 0xc0003287e0, 0xc000156c00)
	/usr/local/Cellar/go/1.13.1/libexec/src/net/http/server.go:2007 +0x44
github.com/go-chi/chi/middleware.RealIP.func1(0x16e7560, 0xc0003287e0, 0xc000156c00)
	/Users/ole09/repos/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/middleware/realip.go:34 +0x99
net/http.HandlerFunc.ServeHTTP(0xc0000ccf00, 0x16e7560, 0xc0003287e0, 0xc000156c00)
	/usr/local/Cellar/go/1.13.1/libexec/src/net/http/server.go:2007 +0x44
github.com/go-chi/chi.(*Mux).ServeHTTP(0xc0000b84e0, 0x16e7560, 0xc0003287e0, 0xc000124800)
	/Users/ole09/repos/pkg/mod/github.com/go-chi/chi@v4.1.2+incompatible/mux.go:86 +0x2b2
net/http.serverHandler.ServeHTTP(0xc0001b6000, 0x16e7560, 0xc0003287e0, 0xc000124800)
	/usr/local/Cellar/go/1.13.1/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc00030c780, 0x16e8b20, 0xc0004d3440)
	/usr/local/Cellar/go/1.13.1/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.13.1/libexec/src/net/http/server.go:2927 +0x38e

I'm very open to the possibility that this is something I am doing incorrectly, but as far as I can tell I have followed the docs

Many thanks,

ols
Reply to thread Export thread (mbox)