-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Email Notifier panics when unmarshalling headers from email config #3064
Comments
This is a workaround for: prometheus/alertmanager#3064 To prevent panics when unmarshalling email headers from configuration.
This is a workaround for: prometheus/alertmanager#3064 To prevent panics when unmarshalling email headers from configuration.
This is a workaround for: prometheus/alertmanager#3064 To prevent panics when unmarshalling email headers from configuration. (cherry picked from commit 68b6197)
This is a workaround for: prometheus/alertmanager#3064 To prevent panics when unmarshalling email headers from configuration. (cherry picked from commit 68b6197) Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
This prevents a panic when unmarshalling certain strings in email notifier configurations. This is a workaround for: prometheus/alertmanager#3064
This prevents a panic when unmarshalling certain strings in email notifier configurations. This is a workaround for: prometheus/alertmanager#3064
Have you already filed a bug against |
I haven't yet. I ran a fuzz test this morning but wasn't able to trigger a panic. I'll file one with x/text/cases in the next 24h. |
The use of |
I've filed: golang/go#55032 There's currently a maintainer handoff in process: golang/go#54481 |
What do you think about converting to strings.ToLower? Given case-insensitivity, it's a much simpler transformation. |
We could use prometheus/blackbox_exporter#937 |
sounds good to me too. |
I read through |
…aders Fixes prometheus#3064. Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
Version 0.24.0 has a few bugs that cause panics. We update here to the latest commit on github.com/prometheus/alertmanager's main branch. Panic Bugs: prometheus/alertmanager#2936 prometheus/alertmanager#3064
Version 0.24.0 has a few bugs that cause panics. We update here to the latest commit on github.com/prometheus/alertmanager's main branch. Panic Bugs: prometheus/alertmanager#2936 prometheus/alertmanager#3064
Version 0.24.0 has a few bugs that cause panics. We update here to the latest commit on github.com/prometheus/alertmanager's main branch. Panic Bugs: prometheus/alertmanager#2936 prometheus/alertmanager#3064 (cherry picked from commit ce89624)
Version 0.24.0 has a few bugs that cause panics. We update here to the latest commit on github.com/prometheus/alertmanager's main branch. Panic Bugs: prometheus/alertmanager#2936 prometheus/alertmanager#3064 (cherry picked from commit ce89624)
…56228) (#56430) Version 0.24.0 has a few bugs that cause panics. We update here to the latest commit on github.com/prometheus/alertmanager's main branch. Panic Bugs: prometheus/alertmanager#2936 prometheus/alertmanager#3064 (cherry picked from commit ce89624)
…56228) (#56429) * Alerting: Update imported prometheus alertmanager version. (#56228) Version 0.24.0 has a few bugs that cause panics. We update here to the latest commit on github.com/prometheus/alertmanager's main branch. Panic Bugs: prometheus/alertmanager#2936 prometheus/alertmanager#3064 (cherry picked from commit ce89624)
…aders (prometheus#3080) * EmailConfig: Use CanonicalMIMEHeaderKey instead of TitleCasing for headers Fixes prometheus#3064. Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com> * Remove an unused field. Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com> Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com> Signed-off-by: Yijie Qin <qinyijie@amazon.com>
What did you do?
Updated the github.com/grafana/mimir dependency on Prometheus to v0.24.1-0.20220805150254-c732372d7d3b
Unmarshalled some email notifier configuration yaml that unmarshalled successfully in v0.24.0
What did you expect to see?
The configuration would continue to unmarshal successfully.
What did you see instead? Under which circumstances?
A panic while title-casing HTTP header values.
Environment
System information:
insert output of
uname -srm
hereAlertmanager version:
v0.24.1-0.20220805150254-c732372d7d3b
Alertmanager configuration file:
This is a tenant-private configuration. We will update this issue with a reproducible string once we find one.
Logs:
This was introduced in #3017, where Title casing switched from
strings.Title
(deprecated) togolang.org/x/text/case
title casing.One fix would be to revert to string.Title, which does not panic on these inputs, and filing a bug with x/text/case when we can determine the input that panics.
Another possible way of addressing this issue is to avoid title casing of header names. Email header names are case insensitive: https://www.rfc-editor.org/rfc/rfc5322#section-1.2.2 (see also: https://stackoverflow.com/questions/6143549/are-email-headers-case-sensitive), so lower-casing every header with
strings.ToLower()
should be sufficient to check for collisions.The text was updated successfully, but these errors were encountered: