-
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
Regression in 0.26.0 when using amtool config rules
with webhook_configs
#3505
Comments
Looks like this is an issue when using |
I think the issue is as @czenker explained. For example, the command
That said, I don't think we should revert the change from The reason for this is that the However, looking further into how
|
Ah, I get it now -- I think it's because Line 127 in 353c0a1
and the Lines 138 to 151 in 353c0a1
which means, Lines 91 to 102 in 353c0a1
and ends up validating the URL on unmarshalling anyway. I think the patch above makes sense and we should be safe to remove that check from |
This commit fixes issue prometheus#3505 where amtool would fail with "error: scheme required for webhook url" when using amtool with --alertmanager.url. The issue here is that UnmarshalYaml for WebhookConfig checks if the scheme is present when c.URL is non-nil. However, UnmarshalYaml for SecretURL returns a non-nil, default value url.URL{} if the response from api/v2/status contains <secret> as the webhook URL. Signed-off-by: George Robinson <george.robinson@grafana.com>
This commit fixes issue prometheus#3505 where amtool would fail with "error: scheme required for webhook url" when using amtool with --alertmanager.url. The issue here is that UnmarshalYaml for WebhookConfig checks if the scheme is present when c.URL is non-nil. However, UnmarshalYaml for SecretURL returns a non-nil, default value url.URL{} if the response from api/v2/status contains <secret> as the webhook URL. Signed-off-by: George Robinson <george.robinson@grafana.com>
* Fix scheme required for webhook url in amtool This commit fixes issue #3505 where amtool would fail with "error: scheme required for webhook url" when using amtool with --alertmanager.url. The issue here is that UnmarshalYaml for WebhookConfig checks if the scheme is present when c.URL is non-nil. However, UnmarshalYaml for SecretURL returns a non-nil, default value url.URL{} if the response from api/v2/status contains <secret> as the webhook URL. Signed-off-by: George Robinson <george.robinson@grafana.com> * Add test for config routes test Signed-off-by: George Robinson <george.robinson@grafana.com> --------- Signed-off-by: George Robinson <george.robinson@grafana.com>
@gotjosh Thanks for the quick fix. This is a quick reminder that v0.26.1 is not released yet. |
* Fix scheme required for webhook url in amtool This commit fixes issue #3505 where amtool would fail with "error: scheme required for webhook url" when using amtool with --alertmanager.url. The issue here is that UnmarshalYaml for WebhookConfig checks if the scheme is present when c.URL is non-nil. However, UnmarshalYaml for SecretURL returns a non-nil, default value url.URL{} if the response from api/v2/status contains <secret> as the webhook URL. Signed-off-by: George Robinson <george.robinson@grafana.com> * Add test for config routes test Signed-off-by: George Robinson <george.robinson@grafana.com> --------- Signed-off-by: George Robinson <george.robinson@grafana.com>
* Fix scheme required for webhook url in amtool This commit fixes issue #3505 where amtool would fail with "error: scheme required for webhook url" when using amtool with --alertmanager.url. The issue here is that UnmarshalYaml for WebhookConfig checks if the scheme is present when c.URL is non-nil. However, UnmarshalYaml for SecretURL returns a non-nil, default value url.URL{} if the response from api/v2/status contains <secret> as the webhook URL. Signed-off-by: George Robinson <george.robinson@grafana.com> * Add test for config routes test Signed-off-by: George Robinson <george.robinson@grafana.com> --------- Signed-off-by: George Robinson <george.robinson@grafana.com> Signed-off-by: gotjosh <josue.abreu@gmail.com>
Is 0.26.1 planned? |
What's missing to get this released? Any way we can support? |
I am also having this error in grafana when checking alert manager 0.26 contact points. When can we expect this to be fixed?
|
@SuperQ please take a look, seems something prevents for a bugfix release |
I have also just hit this issue when upgrading alertmanager, and it has broken our automated test suite |
Should be fixed now? |
What did you do?
Update from version
0.25.0
to0.26.0
.What did you expect to see?
We use
amtool config routes test alertname=Foobar severity=panic
in an automated test to ensure there is no misconfiguration that would not route alerts into on-call. We expected the command to work as before in the sense, that it would tell us which receivers would receive that alert.What did you see instead? Under which circumstances?
With amtool
0.26.0
:With amtool
0.25.0
(error message is different, but the problem is the same):amtool exits with status code
1
regardless and does not print the matched routes.This is very likely a regression from #3228 as the API does not output the url anymore, but amtool seems to be unaware of it and detects an error.
It also affects the
amtool config routes show
command.Alertmanager configuration file
This probably only happens when using a
webhook_configs
with aurl
:As a workaround the new
url_file
could be used as this does not seem to validate any scheme.The text was updated successfully, but these errors were encountered: