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

Planning failed. Terraform encountered an error while generating this plan. ╷ │ Error: making Read request on AzureRM Application Insights Billing Feature #27248

Open
1 task done
omkaracharya17 opened this issue Aug 30, 2024 · 6 comments
Labels
service/application-insights upstream/microsoft/blocking-api-issue This label is applicable when there is a bug on the Azure API that is blocking. v/2.x (legacy)

Comments

@omkaracharya17
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.9.5

AzureRM Provider Version

2.99.0

Affected Resource(s)/Data Source(s)

azurerm_application_insights

Terraform Configuration Files

data "azurerm_log_analytics_workspace" "log-analytics" {
  name                      = var.workspace_name
  resource_group_name       = var.global_resource_group
}

resource "azurerm_application_insights" "app-insights" {
  for_each                  = var.apps_insights
  name                      = format("poh-%s-%s-%s-%s-%s-ai",
                                      var.environment_code, each.key, 
                                      each.value.customername, each.value.customerenvironment, 
                                      each.value.location)
                            #poh-{env#}-{IDNTenantID}-{ClientCode}-{ClientEnv}-{location}-ai
  resource_group_name       = var.resource_group_name
  location                  = each.value.location
  application_type          = "web"
  workspace_id              = data.azurerm_log_analytics_workspace.log-analytics.id
  
  tags                      = merge(tomap({"AZTYPE" = "ai"}), var.tags[each.key])
  
  lifecycle {
    ignore_changes = [ tags ]
  }
}

Debug Output/Panic Output

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: making Read request on AzureRM Application Insights Billing Feature 'poh-4-0416c968-a41f-450b-8ac5-d7e1ca6354c3-adbcs-DEV-eastus2-ai': insights.ComponentCurrentBillingFeaturesClient#Get: Failure sending request: StatusCode=504 -- Original Error: context deadline exceeded
│ 
│   with module.environment-group.azurerm_application_insights.app-insights["0416c968-a41f-450b-8ac5-d7e1ca6354c3"],
│   on ../../modules/environment-group/app-insight.tf line 6, in resource "azurerm_application_insights" "app-insights":
│    6: resource "azurerm_application_insights" "app-insights" {

Expected Behaviour

Plan should be enerated

Actual Behaviour

Error 504

Steps to Reproduce

Just run terraform plan

Important Factoids

NA

References

NA

@usr122
Copy link

usr122 commented Aug 30, 2024

We're seeing the same errors pretty consistently. The resource changes each time, but it's always on the resources' Application Insights. So far, just retrying the plan (multiple times in some cases) seems to eventually get it through, but that's getting untenable.

@teowa
Copy link
Contributor

teowa commented Sep 2, 2024

Hi @omkaracharya17 , thanks for submitting the issue!

The mentioned used provider version is 2.99.0 which releases year ago (not sure if you type the wrong version), and recent code change for azurerm_application_gateway was 3 months ago, no code change is made recently.

The 504 error might be something wrong at Azure side. And to help investigation, could you please help provide debug log which contain HTTP request trace?

@pdefreitas
Copy link

Same behavior on 3.95 sometimes the plan works, sometimes it gives a timeout. It seems to be Azure related.

@JRobertEdwards
Copy link

Also seeing this behaviour pretty consistently as outlined in this ticket #27267

Assume there's no resolution yet outside of brute forcing it over multiple tries

@mybayern1974 mybayern1974 added the upstream/microsoft/blocking-api-issue This label is applicable when there is a bug on the Azure API that is blocking. label Sep 4, 2024
@vivaladan
Copy link

I also see this intermittently and have to re-run the plan. Usually one more try will do it.

@corporate-gadfly
Copy link

It might be helpful to remove the v/2.x (legacy) label, as this is happening with 3.x and 4.x versions as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/application-insights upstream/microsoft/blocking-api-issue This label is applicable when there is a bug on the Azure API that is blocking. v/2.x (legacy)
Projects
None yet
Development

No branches or pull requests

8 participants