-
Notifications
You must be signed in to change notification settings - Fork 218
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
[Bug]: Error: id "<folder UID>:<alert name>" does not match expected format. Should be in the format: folderUID:title #1535
Comments
hmm. I'm unable to reproduce this with the given steps. I've applied a rule group with 2.14.3, I upgrade my provider to 2.18.0 and the plan shows "no changes" |
Hello @julienduchesne, I take a deeper look to what is going on, and the issue is related to nested folder. When the alert is linked to a subfolder like this: The alert will be created but we will have an error at the end of the terraform apply. The issue start at v2.15, v2.14.3 was good for this |
I'm unable to reproduce this 🤔
|
Closing because I'm unable to reproduce, and this may be resolved with the new major version. I'd recommend you try that one. Feel free to re-open if this is still happening! |
We are observing this issue now. Details are: Terraform Version Terraform Grafana Provider Version Grafana Version Affected Resource(s) Terraform Configuration Files
|
Facing pretty much the same issue. Terraform Versionv1.4.6 Terraform Grafana Provider Version3.0.0 Using AWS Managed GrafanaAffected Resource(s)grafana_rule_group Terraform Configuration FilesI have created a terraform module for alerting to create rule groups with a folder resource "grafana_rule_group" "my_alert_rule" {
name = var.grafana_rule_group_name
folder_uid = grafana_folder.rule_folder.uid
... This was working weeks ago and I was using
and then this error:
I changed the terraform grafana version to |
To upgrade to v2, you have to upgrade to the latest v1 version, and then upgrade to v2. To upgrade to v3, you have upgrade to the latest v2 version, apply and then upgrade to v3 (see the v2 and v3 release notes, for more info) There is a year of continuous development, hundreds of commits, between the last v1 and v3.0.0 |
It's already failing without changing the version (I changed the version in an attempt to fix the issue). Also this failing at the plan level so before a tf apply. |
This issue should be reopened. We are also facing the same issue in our grafana cloud instance. Terraform version Terraform Grafana Provider Version Using AWS Managed Grafana Terraform Configuration Files: We just migrated from v2.6.1 to version 3.0.0. This was to resolve other issues we were having with creating rule resources. After upgrading, despite not updating any other TF, we also saw this error:
Looking at the resources in the state I can see that the id attribute is set to It seems like some update set the state value for id incorrectly and renders it unusable when making the API call. I suspect that if we delete the alert rules via the UI, remove them from the state, and then recreate via TF it might resolve the issue. Unfortunately I cant find a way to disable deletion protection for provisioned resources in grafana cloud ... |
See the upgrade procedure here: https://github.com/grafana/terraform-provider-grafana/releases/tag/v3.0.0 The upgrade process from v2 to v3 only works from the latest v2 version (v2.19.0, not v2.6.1). There were gradual changes of ID formats in v2 in order to standardize them, and all of the upgrade/compatibility code was removed in v3. |
As I said this is happening at the plan level for me and I think for all of us actually. So the upgrade process you’re mentioning is actually not possible. |
At the plan level with which version? Applying on the latest v2 version will update the ID format even if Terraform says there will be no changes |
I'm not able to reproduce this 🤔. I applied a contact point with 1.28.1 and then I applied it with 2.19.0 (no changes) and then I had no changes on a plan with 3.0.0 |
I’m not just creating a contact but also alert rules |
I'm also unable to reproduce this with rule groups. Applied both a contact point and rule group with 1.28.1, then I applied it with 2.19.0 (no changes) and then I had no changes on a plan with 3.0.0 |
Terraform Version
v1.8.2
Terraform Grafana Provider Version
2.15~2.18
Grafana Version
10.4.1
Affected Resource(s)
grafana_rule_group
Terraform Configuration Files
we have created a meta module for alerting which looks like this:
`resource "grafana_rule_group" "rule_group" {
name = var.name
folder_uid = var.folder_uid
interval_seconds = coalesce(var.evaluation_interval_seconds, local.evaluation_interval_seconds_default)
rule {
name = var.name
for = coalesce(var.alert_rule_for_duration, local.alert_rule_for_duration_default)
condition = var.condition_ref_id == null ? var.alert_rule_data[length(var.alert_rule_data) - 1].ref_id : var.condition_ref_id
}
}`
Expected Behavior
After upgrading terraform provider, we should be able to apply it without changing the whole alerting even when no changes
Actual Behavior
After bump to provider > 2.15, we have this warning during apply:
Warning: rule group with ID "0:<folder uid>;<alert name>" is in Terraform state, but no longer exists in Grafana
which gives us this error:
Error: id "<folder uid>:<alert name>" does not match expected format. Should be in the format: folderUID:title
On our side, no changes happened on the alerting, but from the error, we can see the warning do a separation via a
;
between folder uid and alert name when the error do the separation via a:
Steps to Reproduce
Apply the terraform using 2.14.3
Update to > 2.14.3
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: