-
Notifications
You must be signed in to change notification settings - Fork 15
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
Error creating alert rule group #11
Comments
I came here to report the same thing. This occurs for alerts with longer expressions and only for More details: This will deploy fine for any version of the provider (including
while this will deploy fine for any version of the provider except
I believe the reason is that for longer expressions the newest version of the provider tries to prettify them by breaking them into multi-line, which Mimir is not happy about. Probably some formatting issue, because in general Mimir should accept multi-line alerts (but I might be wrong here). Anyway here's the difference in plans. Shorter expressions:
Longer expressions:
|
@rayuduc yes the version 0.1.3 introduce a bug caused by the prettifying promql expression. Example of http request from debug mode:
That I don't really understand is why there is 4 spaces instead of 2 by default. (maybe related to go-yaml/yaml#864)). I made some tests with a custom encoder to force setting indentation to 2, but the code become more complex and could bring other unexpected issues. So I decided to just remove the spaces at the begining of expression. Release v0.1.4 should fix this issue. |
Thanks @fgouteroux ! |
Terraform 1.2.3 and same issue with 1.4.5
on darwin_arm64
terraform module is working as expected until 04/03/2023
2023-04-17T16:22:40.588-0700 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for module.alerts_cloudSQL_dev.mimir_rule_group_alerting.CloudSQL_alerts["test_dev_alert"]
2023-04-17T16:22:40.588-0700 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old
2023-04-17T16:22:40.588-0700 [TRACE] statemgr.Filesystem: no state changes since last snapshot
2023-04-17T16:22:40.588-0700 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
2023-04-17T16:22:40.594-0700 [ERROR] vertex "module.alerts_cloudSQL_dev.mimir_rule_group_alerting.CloudSQL_alerts["test_dev_alert"]" error: Cannot create alerting rule group 'CloudSqlAlerts_test_dev_alert' - unexpected response code '400': unable to decode rule group
2023-04-17T16:22:40.594-0700 [TRACE] vertex "module.alerts_cloudSQL_dev.mimir_rule_group_alerting.CloudSQL_alerts["test_dev_alert"]": visit complete, with errors
2023-04-17T16:22:40.594-0700 [TRACE] dag/walk: upstream of "module.alerts_cloudSQL_dev (close)" errored, so skipping
2023-04-17T16:22:40.594-0700 [TRACE] dag/walk: upstream of "provider["registry.terraform.io/fgouteroux/mimir"] (close)" errored, so skipping
2023-04-17T16:22:40.594-0700 [TRACE] dag/walk: upstream of "root" errored, so skipping
2023-04-17T16:22:40.594-0700 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old
2023-04-17T16:22:40.594-0700 [TRACE] statemgr.Filesystem: no state changes since last snapshot
2023-04-17T16:22:40.594-0700 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
╷
│ Error: Cannot create alerting rule group 'testapp_dev' - unexpected response code '400': unable to decode rule group
The text was updated successfully, but these errors were encountered: