opni: Panic in Alertmanager API

2023/09/19 02:46:43 http: panic serving 10.42.53.174:45502: write tcp 10.42.53.185:9093->10.42.53.174:45502: write: broken pipe
goroutine 60488 [running]:
net/http.(*conn).serve.func1()
	net/http/server.go:1868 +0xb9
panic({0x4584640?, 0xc0046e3e50?})
	runtime/panic.go:920 +0x270
[github.com/prometheus/alertmanager/api/v2/restapi/operations/alertgroup.(*GetAlertGroupsOK).WriteResponse(0xc003486270](http://github.com/prometheus/alertmanager/api/v2/restapi/operations/alertgroup.(*GetAlertGroupsOK).WriteResponse(0xc003486270), {0x63ecd00, 0xc0029c2000}, {0x63d0f20, 0x5c645b0})
	[github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/restapi/operations/alertgroup/get_alert_groups_responses.go:74](http://github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/restapi/operations/alertgroup/get_alert_groups_responses.go:74) +0xc5
[github.com/go-openapi/runtime/middleware.(*Context).Respond(0xc001957b30](http://github.com/go-openapi/runtime/middleware.(*Context).Respond(0xc001957b30), {0x63ecd00?, 0xc0029c2000}, 0xc002984e00, {0xc001f7fd70?, 0x1, 0x1}, 0xc002984d00, {0x4504760, 0xc003486270})
	[github.com/go-openapi/runtime@v0.25.0/middleware/context.go:523](http://github.com/go-openapi/runtime@v0.25.0/middleware/context.go:523) +0x6f6
[github.com/prometheus/alertmanager/api/v2/restapi/operations/alertgroup.(*GetAlertGroups).ServeHTTP(0xc001914e88](http://github.com/prometheus/alertmanager/api/v2/restapi/operations/alertgroup.(*GetAlertGroups).ServeHTTP(0xc001914e88), {0x63ecd00, 0xc0029c2000}, 0xc002984e00)
	[github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/restapi/operations/alertgroup/get_alert_groups.go:68](http://github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/restapi/operations/alertgroup/get_alert_groups.go:68) +0x286
[github.com/go-openapi/runtime/middleware.(*Context).RoutesHandler.NewOperationExecutor.func1({0x63ecd00](http://github.com/go-openapi/runtime/middleware.(*Context).RoutesHandler.NewOperationExecutor.func1(%7B0x63ecd00), 0xc0029c2000}, 0xc002984e00)
	[github.com/go-openapi/runtime@v0.25.0/middleware/operation.go:28](http://github.com/go-openapi/runtime@v0.25.0/middleware/operation.go:28) +0x53
net/http.HandlerFunc.ServeHTTP(0x15?, {0x63ecd00?, 0xc0029c2000?}, 0x4ececf?)
	net/http/server.go:2136 +0x29
[github.com/go-openapi/runtime/middleware.NewRouter.func1({0x63ecd00](http://github.com/go-openapi/runtime/middleware.NewRouter.func1(%7B0x63ecd00), 0xc0029c2000}, 0xc002984c00)
	[github.com/go-openapi/runtime@v0.25.0/middleware/router.go:78](http://github.com/go-openapi/runtime@v0.25.0/middleware/router.go:78) +0x257
net/http.HandlerFunc.ServeHTTP(0x7f87a5667f18?, {0x63ecd00?, 0xc0029c2000?}, 0x6786f53877ffefe4?)
	net/http/server.go:2136 +0x29
[github.com/go-openapi/runtime/middleware.Spec.func1({0x63ecd00](http://github.com/go-openapi/runtime/middleware.Spec.func1(%7B0x63ecd00), 0xc0029c2000}, 0xc001116240?)
	[github.com/go-openapi/runtime@v0.25.0/middleware/spec.go:46](http://github.com/go-openapi/runtime@v0.25.0/middleware/spec.go:46) +0x182
net/http.HandlerFunc.ServeHTTP(0xc003e3f938?, {0x63ecd00?, 0xc0029c2000?}, 0x4c3ae5f?)
	net/http/server.go:2136 +0x29
[github.com/prometheus/alertmanager/api/v2.NewAPI.setResponseHeaders.func2({0x63ecd00](http://github.com/prometheus/alertmanager/api/v2.NewAPI.setResponseHeaders.func2(%7B0x63ecd00), 0xc0029c2000}, 0xc00471f688?)
	[github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/api.go:147](http://github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/api.go:147) +0x11e
net/http.HandlerFunc.ServeHTTP(0xc0012b7680?, {0x63ecd00?, 0xc0029c2000?}, 0xc002984c00?)
	net/http/server.go:2136 +0x29
[github.com/rs/cors.(*Cors).Handler-fm.(*Cors).Handler.func1({0x63ecd00](http://github.com/rs/cors.(*Cors).Handler-fm.(*Cors).Handler.func1(%7B0x63ecd00), 0xc0029c2000}, 0xc002984c00)
	[github.com/rs/cors@v1.9.0/cors.go:236](http://github.com/rs/cors@v1.9.0/cors.go:236) +0x184
net/http.HandlerFunc.ServeHTTP(0xc000166940?, {0x63ecd00?, 0xc0029c2000?}, 0x0?)
	net/http/server.go:2136 +0x29
[github.com/prometheus/alertmanager/api.(*API).limitHandler.func1({0x63ecd00](http://github.com/prometheus/alertmanager/api.(*API).limitHandler.func1(%7B0x63ecd00)?, 0xc0029c2000?}, 0xc002984c00?)
	[github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/api.go:221](http://github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/api.go:221) +0x1d2
net/http.HandlerFunc.ServeHTTP(0x447300?, {0x63ecd00?, 0xc0029c2000?}, 0x70917a?)
	net/http/server.go:2136 +0x29
net/http.(*ServeMux).ServeHTTP(0x92266c0?, {0x63ecd00, 0xc0029c2000}, 0xc002984c00)
	net/http/server.go:2514 +0x142
net/http.serverHandler.ServeHTTP({0xc003e12810?}, {0x63ecd00?, 0xc0029c2000?}, 0x6?)
	net/http/server.go:2938 +0x8e
net/http.(*conn).serve(0xc001da5680, {0x640a1c0, 0xc00086dc50})
	net/http/server.go:2009 +0x5f4
created by net/http.(*Server).Serve in goroutine 401
	net/http/server.go:3086 +0x5cb
2023/09/19 02:46:43 http: panic serving 10.42.53.174:38706: write tcp 10.42.53.185:9093->10.42.53.174:38706: write: broken pipe
goroutine 60993 [running]:
net/http.(*conn).serve.func1()
	net/http/server.go:1868 +0xb9
panic({0x4584640?, 0xc002b177c0?})
	runtime/panic.go:920 +0x270
[github.com/prometheus/alertmanager/api/v2/restapi/operations/alertgroup.(*GetAlertGroupsOK).WriteResponse(0xc00344dfe0](http://github.com/prometheus/alertmanager/api/v2/restapi/operations/alertgroup.(*GetAlertGroupsOK).WriteResponse(0xc00344dfe0), {0x63ecd00, 0xc00452ac40}, {0x63d0f20, 0x5c645b0})
	[github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/restapi/operations/alertgroup/get_alert_groups_responses.go:74](http://github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/restapi/operations/alertgroup/get_alert_groups_responses.go:74) +0xc5
[github.com/go-openapi/runtime/middleware.(*Context).Respond(0xc001957b30](http://github.com/go-openapi/runtime/middleware.(*Context).Respond(0xc001957b30), {0x63ecd00?, 0xc00452ac40}, 0xc0046e1500, {0xc001f7fd70?, 0x1, 0x1}, 0xc0046e1400, {0x4504760, 0xc00344dfe0})
	[github.com/go-openapi/runtime@v0.25.0/middleware/context.go:523](http://github.com/go-openapi/runtime@v0.25.0/middleware/context.go:523) +0x6f6
[github.com/prometheus/alertmanager/api/v2/restapi/operations/alertgroup.(*GetAlertGroups).ServeHTTP(0xc001914e88](http://github.com/prometheus/alertmanager/api/v2/restapi/operations/alertgroup.(*GetAlertGroups).ServeHTTP(0xc001914e88), {0x63ecd00, 0xc00452ac40}, 0xc0046e1500)
	[github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/restapi/operations/alertgroup/get_alert_groups.go:68](http://github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/restapi/operations/alertgroup/get_alert_groups.go:68) +0x286
[github.com/go-openapi/runtime/middleware.(*Context).RoutesHandler.NewOperationExecutor.func1({0x63ecd00](http://github.com/go-openapi/runtime/middleware.(*Context).RoutesHandler.NewOperationExecutor.func1(%7B0x63ecd00), 0xc00452ac40}, 0xc0046e1500)
	[github.com/go-openapi/runtime@v0.25.0/middleware/operation.go:28](http://github.com/go-openapi/runtime@v0.25.0/middleware/operation.go:28) +0x53
net/http.HandlerFunc.ServeHTTP(0x15?, {0x63ecd00?, 0xc00452ac40?}, 0x4ececf?)
	net/http/server.go:2136 +0x29
[github.com/go-openapi/runtime/middleware.NewRouter.func1({0x63ecd00](http://github.com/go-openapi/runtime/middleware.NewRouter.func1(%7B0x63ecd00), 0xc00452ac40}, 0xc0046e1300)
	[github.com/go-openapi/runtime@v0.25.0/middleware/router.go:78](http://github.com/go-openapi/runtime@v0.25.0/middleware/router.go:78) +0x257
net/http.HandlerFunc.ServeHTTP(0x7f87a5669688?, {0x63ecd00?, 0xc00452ac40?}, 0xb6e604d5b17578e?)
	net/http/server.go:2136 +0x29
[github.com/go-openapi/runtime/middleware.Spec.func1({0x63ecd00](http://github.com/go-openapi/runtime/middleware.Spec.func1(%7B0x63ecd00), 0xc00452ac40}, 0xc001116240?)
	[github.com/go-openapi/runtime@v0.25.0/middleware/spec.go:46](http://github.com/go-openapi/runtime@v0.25.0/middleware/spec.go:46) +0x182
net/http.HandlerFunc.ServeHTTP(0xc002891938?, {0x63ecd00?, 0xc00452ac40?}, 0x4c3ae5f?)
	net/http/server.go:2136 +0x29
[github.com/prometheus/alertmanager/api/v2.NewAPI.setResponseHeaders.func2({0x63ecd00](http://github.com/prometheus/alertmanager/api/v2.NewAPI.setResponseHeaders.func2(%7B0x63ecd00), 0xc00452ac40}, 0xc004519108?)
	[github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/api.go:147](http://github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/v2/api.go:147) +0x11e
net/http.HandlerFunc.ServeHTTP(0xc0012b7680?, {0x63ecd00?, 0xc00452ac40?}, 0xc0046e1300?)
	net/http/server.go:2136 +0x29
[github.com/rs/cors.(*Cors).Handler-fm.(*Cors).Handler.func1({0x63ecd00](http://github.com/rs/cors.(*Cors).Handler-fm.(*Cors).Handler.func1(%7B0x63ecd00), 0xc00452ac40}, 0xc0046e1300)
	[github.com/rs/cors@v1.9.0/cors.go:236](http://github.com/rs/cors@v1.9.0/cors.go:236) +0x184
net/http.HandlerFunc.ServeHTTP(0xc000166940?, {0x63ecd00?, 0xc00452ac40?}, 0x0?)
	net/http/server.go:2136 +0x29
[github.com/prometheus/alertmanager/api.(*API).limitHandler.func1({0x63ecd00](http://github.com/prometheus/alertmanager/api.(*API).limitHandler.func1(%7B0x63ecd00)?, 0xc00452ac40?}, 0xc0046e1300?)
	[github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/api.go:221](http://github.com/prometheus/alertmanager@v0.25.1-0.20230505130626-263ca5c9438e/api/api.go:221) +0x1d2
net/http.HandlerFunc.ServeHTTP(0x447300?, {0x63ecd00?, 0xc00452ac40?}, 0x70917a?)
	net/http/server.go:2136 +0x29
net/http.(*ServeMux).ServeHTTP(0x92266c0?, {0x63ecd00, 0xc00452ac40}, 0xc0046e1300)
	net/http/server.go:2514 +0x142
net/http.serverHandler.ServeHTTP({0xc003b11ad0?}, {0x63ecd00?, 0xc00452ac40?}, 0x6?)
	net/http/server.go:2938 +0x8e
net/http.(*conn).serve(0xc0018dcab0, {0x640a1c0, 0xc00086dc50})
	net/http/server.go:2009 +0x5f4
created by net/http.(*Server).Serve in goroutine 401
	net/http/server.go:3086 +0x5cb
{"caller":"coordinator.go:113","component":"configuration","file":"/var/lib/alertmanager.yaml","level":"info","msg":"Loading configuration file","ts":"2023-09-19T02:47:43.292Z"}
{"caller":"coordinator.go:126","component":"configuration","file":"/var/lib/alertmanager.yaml","level":"info","msg":"Completed loading of configuration file","ts":"2023-09-19T02:47:43.293Z"}

About this issue

  • Original URL
  • State: open
  • Created 9 months ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

I’m happy to open such a feature request if you agree.

Also, once you have a proposed fix for this issue, feel free to push a patched image to the registry for me to verify.