Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: grr server with AlertRuleGroup does not work #572

Open
onutu opened this issue Jan 23, 2025 · 0 comments · May be fixed by #576
Open

[Bug]: grr server with AlertRuleGroup does not work #572

onutu opened this issue Jan 23, 2025 · 0 comments · May be fixed by #576
Assignees

Comments

@onutu
Copy link

onutu commented Jan 23, 2025

Grizzly Version

0.7.1 (latest)

Expected Behavior

I'm trying to use one of the latest feature : "Support previewing AlertRuleGroup resources in grr serve"
I'm launching grr server and targeting the folder which has my latest grafana objects (json format). The alert rules are correctly displayed in the grizzly UI browser, but I'm getting an error when I click on anyone of them.

Actual Behavior

Here are the errors, happy to provide you with more info, if needed :

Image

INFO Listening on http://localhost:8080/
2025/01/23 08:25:36 http: panic serving [::1]:49998: interface conversion: interface {} is float64, not int
goroutine 29 [running]:
net/http.(*conn).serve.func1()
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:1947 +0xbe
panic({0x11a1a40?, 0xc000420e10?})
/opt/hostedtoolcache/go/1.23.4/x64/src/runtime/panic.go:785 +0x132
github.com/grafana/grizzly/pkg/grafana.(*alertRuleProxyConfigurator).Endpoints.(*alertRuleProxyConfigurator).alertRuleJSONGetHandler.func2({0x7f7ba24958b8, 0xc0003fd580}, 0xc0004340f0?)
/home/runner/work/grizzly/grizzly/pkg/grafana/alertgroup-proxy.go:118 +0x2dd
net/http.HandlerFunc.ServeHTTP(0x117a240?, {0x7f7ba24958b8?, 0xc0003fd580?}, 0xc0003d41e4?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2220 +0x29
github.com/go-chi/chi.(*Mux).routeHTTP(0xc000123380, {0x7f7ba24958b8, 0xc0003fd580}, 0xc000343a40)
/home/runner/go/pkg/mod/github.com/go-chi/[email protected]/mux.go:436 +0x1f2
net/http.HandlerFunc.ServeHTTP(0x20e4bd0?, {0x7f7ba24958b8?, 0xc0003fd580?}, 0x7f7ba27e5ff8?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2220 +0x29
github.com/grafana/grizzly/pkg/grizzly.(*Server).Start.RequestLogger.func1.1({0x159e490, 0xc0001c4d20}, 0xc000343900)
/home/runner/go/pkg/mod/github.com/go-chi/[email protected]/middleware/logger.go:57 +0x154
net/http.HandlerFunc.ServeHTTP(0x15a15b8?, {0x159e490?, 0xc0001c4d20?}, 0x20ccd30?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2220 +0x29
github.com/go-chi/chi.(*Mux).ServeHTTP(0xc000123380, {0x159e490, 0xc0001c4d20}, 0xc0003437c0)
/home/runner/go/pkg/mod/github.com/go-chi/[email protected]/mux.go:87 +0x2ef
net/http.serverHandler.ServeHTTP({0xc0004206c0?}, {0x159e490?, 0xc0001c4d20?}, 0x6?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:3210 +0x8e
net/http.(*conn).serve(0xc0004301b0, {0x15a1580, 0xc000524ed0})
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2092 +0x5d0
created by net/http.(*Server).Serve in goroutine 1
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:3360 +0x485
2025/01/23 08:25:36 http: panic serving [::1]:49984: interface conversion: interface {} is float64, not int
goroutine 12 [running]:
net/http.(*conn).serve.func1()
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:1947 +0xbe
panic({0x11a1a40?, 0xc000420f90?})
/opt/hostedtoolcache/go/1.23.4/x64/src/runtime/panic.go:785 +0x132
github.com/grafana/grizzly/pkg/grafana.(*alertRuleProxyConfigurator).Endpoints.(*alertRuleProxyConfigurator).alertRuleJSONGetHandler.func2({0x7f7ba24958b8, 0xc0003fd640}, 0xc00041ee10?)
/home/runner/work/grizzly/grizzly/pkg/grafana/alertgroup-proxy.go:118 +0x2dd
net/http.HandlerFunc.ServeHTTP(0x117a240?, {0x7f7ba24958b8?, 0xc0003fd640?}, 0xc0003d42a4?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2220 +0x29
github.com/go-chi/chi.(*Mux).routeHTTP(0xc000123380, {0x7f7ba24958b8, 0xc0003fd640}, 0xc000343e00)
/home/runner/go/pkg/mod/github.com/go-chi/[email protected]/mux.go:436 +0x1f2
net/http.HandlerFunc.ServeHTTP(0x20e4bd0?, {0x7f7ba24958b8?, 0xc0003fd640?}, 0x7f7ba27e5ff8?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2220 +0x29
github.com/grafana/grizzly/pkg/grizzly.(*Server).Start.RequestLogger.func1.1({0x159e490, 0xc0001c4ee0}, 0xc000343cc0)
/home/runner/go/pkg/mod/github.com/go-chi/[email protected]/middleware/logger.go:57 +0x154
net/http.HandlerFunc.ServeHTTP(0x15a15b8?, {0x159e490?, 0xc0001c4ee0?}, 0x20ccd30?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2220 +0x29
github.com/go-chi/chi.(*Mux).ServeHTTP(0xc000123380, {0x159e490, 0xc0001c4ee0}, 0xc000343b80)
/home/runner/go/pkg/mod/github.com/go-chi/[email protected]/mux.go:87 +0x2ef
net/http.serverHandler.ServeHTTP({0xc0005251d0?}, {0x159e490?, 0xc0001c4ee0?}, 0x6?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:3210 +0x8e
net/http.(*conn).serve(0xc0001ff710, {0x15a1580, 0xc000524ed0})
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2092 +0x5d0
created by net/http.(*Server).Serve in goroutine 1
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:3360 +0x485
2025/01/23 08:25:36 http: panic serving [::1]:54404: interface conversion: interface {} is float64, not int
goroutine 42 [running]:
net/http.(*conn).serve.func1()
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:1947 +0xbe
panic({0x11a1a40?, 0xc00049c7b0?})
/opt/hostedtoolcache/go/1.23.4/x64/src/runtime/panic.go:785 +0x132
github.com/grafana/grizzly/pkg/grafana.(*alertRuleProxyConfigurator).Endpoints.(*alertRuleProxyConfigurator).alertRuleJSONGetHandler.func2({0x7f7ba24958b8, 0xc0000d1140}, 0xc00065f430?)
/home/runner/work/grizzly/grizzly/pkg/grafana/alertgroup-proxy.go:118 +0x2dd
net/http.HandlerFunc.ServeHTTP(0x117a240?, {0x7f7ba24958b8?, 0xc0000d1140?}, 0xc0001b8604?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2220 +0x29
github.com/go-chi/chi.(*Mux).routeHTTP(0xc000123380, {0x7f7ba24958b8, 0xc0000d1140}, 0xc00020d900)
/home/runner/go/pkg/mod/github.com/go-chi/[email protected]/mux.go:436 +0x1f2
net/http.HandlerFunc.ServeHTTP(0x20e4bd0?, {0x7f7ba24958b8?, 0xc0000d1140?}, 0x7f7ba27fa278?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2220 +0x29
github.com/grafana/grizzly/pkg/grizzly.(*Server).Start.RequestLogger.func1.1({0x159e490, 0xc0005fe8c0}, 0xc00020d7c0)
/home/runner/go/pkg/mod/github.com/go-chi/[email protected]/middleware/logger.go:57 +0x154
net/http.HandlerFunc.ServeHTTP(0x15a15b8?, {0x159e490?, 0xc0005fe8c0?}, 0x20ccd30?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2220 +0x29
github.com/go-chi/chi.(*Mux).ServeHTTP(0xc000123380, {0x159e490, 0xc0005fe8c0}, 0xc00020d680)
/home/runner/go/pkg/mod/github.com/go-chi/[email protected]/mux.go:87 +0x2ef
net/http.serverHandler.ServeHTTP({0xc00049c600?}, {0x159e490?, 0xc0005fe8c0?}, 0x6?)
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:3210 +0x8e
net/http.(*conn).serve(0xc0003b2630, {0x15a1580, 0xc000524ed0})
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:2092 +0x5d0
created by net/http.(*Server).Serve in goroutine 1
/opt/hostedtoolcache/go/1.23.4/x64/src/net/http/server.go:3360 +0x485
^C

Steps to Reproduce

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants