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

fix: Webhook request parsing #373

Merged
merged 1 commit into from May 20, 2024

Conversation

anloubie2
Copy link
Contributor

When a webhook was modified or an alert was sent, a runtime error: invalid memory address or nil pointer dereference was raised at the moment the alert was parsed to create the webhook message:

github.com/uptrace/uptrace/pkg/alerting.NewWebhookMessage(0xc0004bcc60, {0x3613b20?, 0xc0005cd0e0?}, {0x17b0660, 0xc001d66900})
        github.com/uptrace/uptrace/pkg/alerting/notif_channel_handler.go:565 +0x57
github.com/uptrace/uptrace/pkg/alerting.notifyByWebhookChannel({0x3610a20, 0xc001d66660}, 0xc0004bcc60, 0x40?, {0x3613b20?, 0xc0005cd0e0?}, 0xc001d665d0)
        github.com/uptrace/uptrace/pkg/alerting/notif_webhook.go:58 +0x185
github.com/uptrace/uptrace/pkg/alerting.(*NotifChannelHandler).sendWebhookTestMsg(0xc0012d52b0, {0x3610a20, 0xc001d66660}, 0xc001c7d200, 0xc001d665d0)
        github.com/uptrace/uptrace/pkg/alerting/notif_channel_handler.go:476 +0x206
github.com/uptrace/uptrace/pkg/alerting.(*NotifChannelHandler).WebhookUpdate(0xc0012d52b0, {0x360d250, 0xc00343bb80}, {0xc001455b00, {{0xc000044c34, 0x37}, 0xc000749980, 0xc0012d5a20, 0x0}})
        github.com/uptrace/uptrace/pkg/alerting/notif_channel_handler.go:442 +0x232

By changing the way the Event inside the alert is accessed, the problem doesn't show anymore

@vmihailenco vmihailenco merged commit 6ba916f into uptrace:master May 20, 2024
11 checks passed
@vmihailenco
Copy link
Member

Thank you 👍

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 this pull request may close these issues.

None yet

2 participants