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

Azure Storage Account Provider produced inconsistent result after apply #18897

Closed
1 task done
beameup50 opened this issue Oct 20, 2022 · 5 comments · Fixed by #26218
Closed
1 task done

Azure Storage Account Provider produced inconsistent result after apply #18897

beameup50 opened this issue Oct 20, 2022 · 5 comments · Fixed by #26218

Comments

@beameup50
Copy link

beameup50 commented Oct 20, 2022

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 "+1" or "me too" comments, 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

Terraform Version

Greater than 0.13

AzureRM Provider Version

2.86.0

Affected Resource(s)/Data Source(s)

azurerm_storage_account

Terraform Configuration Files

resource "azurerm_storage_account" "main" {
  name                      = "${var.storageaccountname}"
  resource_group_name       = azurerm_resource_group.main.name
  location                  = azurerm_resource_group.main.location
  account_kind              = "StorageV2"
  account_tier              = "Standard"
  enable_https_traffic_only = true
  is_hns_enabled            = true
  account_replication_type  = "LRS"
  access_tier               = "Hot"

  network_rules {
    default_action = "Deny"
    bypass         = ["AzureServices"]
    ip_rules       = var.optum_ip_addresses
  }

  min_tls_version = "TLS1_2"

  tags = var.tags
}

Debug Output/Panic Output

Error: Provider produced inconsistent result after apply

When applying changes to azurerm_storage_account.main, provider "provider[\"registry.terraform.io/hashicorp/azurerm\"]" produced an unexpected new value: Root resource    
was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own issue tracker.

Expected Behaviour

Storage account should be created

Actual Behaviour

Error

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

@beameup50 beameup50 added the bug label Oct 20, 2022
@github-actions github-actions bot removed the bug label Oct 20, 2022
@magodo
Copy link
Collaborator

magodo commented Oct 24, 2022

@beameup50 Could you please try out the latest provider as we are no longer maintaining the v2 provider?

@beameup50
Copy link
Author

beameup50 commented Oct 27, 2022

@magodo

After upgrading to latest provider 3.28.0 I get the following error at the same spot ... trying to create the storage account:

azurerm_storage_account.example: Creating...
azurerm_storage_account.example: Still creating... [10s elapsed]
azurerm_storage_account.example: Still creating... [20s elapsed]

│ Error: retrieving Storage Account: (Name "[StorageAccountName]" / Resource Group "[RGName]"): storage.AccountsClient#GetProperties: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="StorageAccountNotFound" Message="The storage account [StorageAccountName] was not found."

@beameup50
Copy link
Author

UPDATE: By manually removing the storage account from the TF state, manually creating a storage account, then importing it into the TF state, I was able to work around this problem.

@magodo
Copy link
Collaborator

magodo commented Oct 28, 2022

@beameup50 Could you please kindly attach the DEBUG log when the issue occurs? This probably relates to #2977, but with a minor difference: In #2977, the storage account is able to create successfully, but the container will fail, after setting up the network_rules.

Though the azurerm_storage_account also has some data plane API calls after creation, whilst from the previous behavior, those API calls are not blocked by the network rules. I'm not sure whether the storage service changed the behavior recently.

Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.