Skip to content

SIGSEGV with mimir.alerts.kubernetes and AlertmanagerConfigs with slack config #4975

@terjesannum

Description

@terjesannum

Component(s)

mimir.alerts.kubernetes

What's wrong?

When adding an AlertmanagerConfig with <slack_config>, alloy crashes:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x7427aab]

goroutine 1277 [running]:
github.com/prometheus-operator/prometheus-operator/pkg/assets.(*StoreBuilder).GetSecretKey(0x0, {0xec23268, 0xc000b1f1f0}, {0xc0055042a0, 0xb}, {{{0xc005803800, 0x1c}}, {0xc005504346, 0x6}, 0x0})
	/go/pkg/mod/github.com/prometheus-operator/[email protected]/pkg/assets/store.go:326 +0xcb
github.com/prometheus-operator/prometheus-operator/pkg/alertmanager.(*ConfigBuilder).getValidURLFromSecret(0xa?, {0xec23268?, 0xc000b1f1f0?}, {0xc0055042a0?, 0x4b2235?}, {{{0xc005803800, 0x1c}}, {0xc005504346, 0x6}, 0x0})
	/go/pkg/mod/github.com/prometheus-operator/[email protected]/pkg/alertmanager/amcfg.go:412 +0x65
github.com/prometheus-operator/prometheus-operator/pkg/alertmanager.(*ConfigBuilder).convertSlackConfig(_, {_, _}, {0xc005504358, 0xc0170ddad0, {0xc0102fb638, 0x13}, {0xc005803880, 0x20}, {0xc005803820, ...}, ...}, ...)
	/go/pkg/mod/github.com/prometheus-operator/[email protected]/pkg/alertmanager/amcfg.go:918 +0x447
github.com/prometheus-operator/prometheus-operator/pkg/alertmanager.(*ConfigBuilder).convertReceiver(0xc000b1f5e0, {0xec23268, 0xc000b1f1f0}, 0xc01bbab168, {{0xc0055042a0?, 0x429636?}, {0xc01544b620?, 0xc01bbab148?}})
	/go/pkg/mod/github.com/prometheus-operator/[email protected]/pkg/alertmanager/amcfg.go:615 +0x72a
github.com/prometheus-operator/prometheus-operator/pkg/alertmanager.(*ConfigBuilder).AddAlertmanagerConfigs(0xc000b1f5e0, {0xec23268, 0xc000b1f1f0}, 0xc01bbabd38)
	/go/pkg/mod/github.com/prometheus-operator/[email protected]/pkg/alertmanager/amcfg.go:386 +0x7d5
github.com/grafana/alloy/internal/component/mimir/alerts/kubernetes.(*eventProcessor).provisionAlertmanagerConfiguration(0xc002ab9040, {0xec23268, 0xc000b1f1f0}, 0xc01bbabd38, 0x0)
	/src/alloy/internal/component/mimir/alerts/kubernetes/events.go:192 +0x365
github.com/grafana/alloy/internal/component/mimir/alerts/kubernetes.(*eventProcessor).desiredStateFromKubernetes(0xc002ab9040, {0xec23268, 0xc000b1f1f0})
	/src/alloy/internal/component/mimir/alerts/kubernetes/events.go:256 +0x18e
github.com/grafana/alloy/internal/component/mimir/alerts/kubernetes.(*eventProcessor).reconcileState(0xc002ab9040, {0xec231f8?, 0xc001e06280?})
	/src/alloy/internal/component/mimir/alerts/kubernetes/events.go:213 +0x6c
github.com/grafana/alloy/internal/component/mimir/alerts/kubernetes.(*eventProcessor).processEvent(0xc0014e9408?, {0xec231f8?, 0xc001e06280?}, {{0xd5acce5?, 0x656b672d30312e36?}, {0xc014fdb8c0?, 0x0?}})
	/src/alloy/internal/component/mimir/alerts/kubernetes/events.go:163 +0xa5
github.com/grafana/alloy/internal/component/mimir/alerts/kubernetes.(*eventProcessor).run(0xc002ab9040, {0xec231f8, 0xc001e06280})
	/src/alloy/internal/component/mimir/alerts/kubernetes/events.go:120 +0xe5
created by github.com/grafana/alloy/internal/component/mimir/alerts/kubernetes.(*Component).Startup in goroutine 416
	/src/alloy/internal/component/mimir/alerts/kubernetes/alerts.go:239 +0x78d

The serviceaccount running alloy has get,list,watch on secrets.
Prometheus Operator handles the same AlertmanagerConfig fine.

Steps to reproduce

Add an AlertmanagerConfig for sending alerts to slack

System information

No response

Software version

Grafana alloy v1.12.0

Configuration


Logs


Tip

React with 👍 if this issue is important to you.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions