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

Terraform destroy fails on firewall delete "Error: deleting Azure Firewall Firewall" #609

Closed
glennmusa opened this issue Jan 13, 2022 · 6 comments
Assignees
Labels
bug Something isn't working core New feature or request

Comments

@glennmusa
Copy link
Contributor

glennmusa commented Jan 13, 2022

Description

Running terraform destroy in AzureCloud from our pipeline agent fails with a 415 "The content media type '<null>' is not supported. Only 'application/json' is supported":

Error: deleting Azure Firewall Firewall: (Azure Firewall Name "firewall" / Resource Group "{resource group name}") : network.AzureFirewallsClient#Delete: Failure sending request: StatusCode=415 -- Original Error: Code="UnsupportedMediaType" Message="The content media type '<null>' is not supported. Only 'application/json' is supported."

Steps to Reproduce

Steps to reproduce the behavior:

  1. Run the nightly Terraform AzureCloud pipeline

Expected behavior

The firewall is successfully deleted and the pipeline finishes the terraform destroy task.

Actual behavior

The firewall is not deleted, it and its parent resource group must be manually deleted, and the pipeline fails.

Additional context

The azurerm team also encounters this error: hashicorp/terraform-provider-azurerm#14907 (review)

For academic purposes, it reads like this is the method bubbling up the error: https://github.com/hashicorp/terraform-provider-azurerm/blob/67e95001cc7ed859f2bd589c426f4e5bc056d237/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-05-01/network/azurefirewalls.go#L145-L149

Operating System: ubuntu
Terraform Version: 1.13 and azurerm 2.90.0
Cloud (public, Azure Government, etc.): AzureCloud

@glennmusa glennmusa added the bug Something isn't working label Jan 13, 2022
@glennmusa
Copy link
Contributor Author

The firewall is now able to be destroyed successfully.

@glennmusa
Copy link
Contributor Author

This error has returned.

@brooke-hamilton
Copy link
Contributor

Should we change the cleanup to delete the resource groups and subscription-level diagnostic settings?

@glennmusa
Copy link
Contributor Author

glennmusa commented Feb 7, 2022

^ I think it's a good idea as long as the "nightly status" still shows failure if the Terraform commands are unable to round-trip creation and deletion. Could put it in another always run job in the existing pipeline.

Oops, I misunderstand! You bring up a good point. What are we testing by running terraform destroy? Not our implementation, but the destroy command. I'm happy to replace the destroy step with a manual, Azure-y cleanup.

@brooke-hamilton brooke-hamilton self-assigned this Feb 7, 2022
@brooke-hamilton
Copy link
Contributor

I will convert this to a backlog item that will implement resource group deletes.

@brooke-hamilton
Copy link
Contributor

Created #640 to replace this bug.

Repository owner moved this from Backlog to Done in Mission Landing Zone 2022 Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants