Terraform-provider-azurerm: Intermittent errors when destroying resources and reapplying tf apply using azurerm

Created on 3 Nov 2017  ·  6Comments  ·  Source: terraform-providers/terraform-provider-azurerm

Terraform Version

Core:10.9.dev
AzureRM: 0.3.2

Affected Resource(s)

Please list the resources as a list, for example:

  • azurerm_route

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "azurerm_resource_group" "test" {
  name     = "acceptanceTestResourceGroup1"
  location = "West US"
}

resource "azurerm_route_table" "test" {
  name                = "acceptanceTestRouteTable1"
  location            = "${azurerm_resource_group.test.location}"
  resource_group_name = "${azurerm_resource_group.test.name}"
}

resource "azurerm_route" "test" {
  name                = "acceptanceTestRoute1"
  resource_group_name = "${azurerm_resource_group.test.name}"
  route_table_name    = "${azurerm_route_table.test.name}"
  address_prefix      = "10.1.0.0/16"
  next_hop_type       = "vnetlocal"
}

Debug Output

vaangadi@VJUbuntu1704:~/go/hack/Route$ tf apply
azurerm_resource_group.test: Refreshing state... (ID: /subscriptions/cba4e087-aceb-44f0-970e-...rceGroups/acceptanceTestResourceGroup1)
azurerm_route_table.test: Refreshing state... (ID: /subscriptions/cba4e087-aceb-44f0-970e-.../routeTables/acceptanceTestRouteTable1)

Error: Error refreshing state: 1 error(s) occurred:

  • azurerm_route_table.test: azurerm_route_table.test: Error making Read request on Azure Route Table "acceptanceTestRouteTable1": network.RouteTablesClient#Get: Failure sending request: StatusCode=0 -- Original Error: Get https://management.azure.com/subscriptions//resourceGroups/acceptanceTestResourceGroup1/providers/Microsoft.Network/routeTables/acceptanceTestRouteTable1?api-version=2017-09-01: stream error: stream ID 7; HTTP_1_1_REQUIRED

Expected Behavior

What should have happened?

Actual Behavior

What actually happened?

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan
    Plan created
  2. terraform apply
    Reource created
  3. terraform destroy
    Resource successfully destroyed
  4. terraform plan
    Plan successfully created
  5. terraform apply
    Plan successfull applied
    6 . Now open the tf file. Delete all the content. Make it empty file.
  6. terraform plan
    Plan successfully created.
  7. terraform apply

Error as shown in Debug output.

bug

Most helpful comment

I'm also facing this issue in Australia East. For a couple of calls, I receive the same HTTP_1_1_REQUIRED error, then terraform starts crashing. Only be deleting the .terraform folder and re-running terraform init can I get back to the HTTP_1_1_REQUIRED error.

IMO, this issue should be tackled with high priority as it's a complete show stopper. I upgraded to the latest version of both terraform and the azure provider but the behaviour is the same.

All 6 comments

I'm also facing this issue in Australia East. For a couple of calls, I receive the same HTTP_1_1_REQUIRED error, then terraform starts crashing. Only be deleting the .terraform folder and re-running terraform init can I get back to the HTTP_1_1_REQUIRED error.

IMO, this issue should be tackled with high priority as it's a complete show stopper. I upgraded to the latest version of both terraform and the azure provider but the behaviour is the same.

I have also seen Terrafrom crash (SegV). I haven't had Terraform become wedged though. If I repeatedly try I can have Terraform eventually succeed. I do this: -

until terraform apply; do
    echo -e '\n\nsleeping\n\n';
    sleep 10;
done

It was during such a loop that I saw the crash.

I haven't yet looked into the source of Terraform but from ripclawffb comment in #526 it seems to me that part of the fault is Terraform, I suspect that the error handing path has some bugs in it that stops it from properly recovering and leads to it always failing. Microsoft stated they are working on the issues on there end, so the issue may go away, but if there's bugs in Terraform as well, I'd like to see those fixed rather than leave latent bugs in there.

Sorry if irrelevant, I've landed here searching for solution to some kubernetes clusters in australiaeast unable to talk to azure with similar messages...

The calls are failing from kubernetes kube-controller-manager's talking to azure with stream error: stream ID XX; HTTP_1_1_REQUIRED

So I added this to my kube-controller-manager environment: GODEBUG=http2client=0 which tells golangs http package to disable http2 support from the client... And all seems to be working now... ( azure have some half rolled out H2 support? )

Anyhow in case diagnostically useful...

@b333z Genius, mate, that actually fixes the problem. Thanks!

👋 hey all

This was a bug in the Azure API which has since been fixed at Azure's end (we'd worked with Microsoft when this was detected to get this resolved, but not closed this issue apparently - sorry about that!) Since this issue has been resolved upstream - I'm going to close this issue for the moment, but please free free to reopen this if you're still seeing issues and we'll take another look :)

Thanks!

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings