-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Error while creating storage account #3939
Comments
Hi @shivamsriva31093, this sounds a lot like #3925. Would you by any chance have a firewall enabled for the storage account? |
@katbyte I checked with the team. There is no firewall enabled for the storage account. |
@katbyte I'm experiencing this too, quick google lead me to this. We do not have fw enabled on our storage accounts either. If it helps Getting the following error. Something about the container in the storage account.
|
I'm experiencing something similar. Deployed 5 storage accounts for 5 different environments some time ago. Exact same deployment but the only difference is that the one that fails is GRS. Terraform v0.11.11 Trying to apply some environment changes and had this error during terraform plan: module.my-storage-account.azurerm_storage_account.my-storage-account: azurerm_storage_account.my-storage-account:
Error reading queue properties for AzureRM Storage Account "mystorage": queues.Client#SetServiceProperties: Failure responding to request: StatusCode=500
-- Original Error: autorest/azure: error response cannot be parsed: "\ufeff<?xml version=\"1.0\"
encoding=\"utf-8\"?><Error><Code>
InternalError</Code><Message>
Server encountered an internal error. Please try again after some time.
\nRequestId:b0e6852b-7003-0015-2308-47d453000000\nTime:2019-07-30T18:57:11.2853333Z</Message></
Error>" error: invalid character 'ï' looking for beginning of value This storage account was deployed with Terraform some time ago, so I suspect something has changed in the AzureAPI that broke this. |
I thought this was related to my account coming off the free trial, but I ran variable "location" {
default = "eastus"
}
provider "azurerm" {
version = "~> 1.32"
}
resource "azurerm_resource_group" "rg" {
name = "azurerm-bug3939-test"
location = "${var.location}"
}
resource "azurerm_storage_account" "sa" {
name = "bug3939testme"
resource_group_name = "${azurerm_resource_group.rg.name}"
location = "${var.location}"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
enable_https_traffic_only = "true"
} |
I'm actually having the same issue. Any eta on a fix? |
I am deploying to the France Central region, and facing the same problem. I originally updated from 1.32.0 to 1.32.1 because I was blocked by #3968. This issue seems to be indeed fixed. But I'm facing #3939 now. Terraform configuration: resource "azurerm_resource_group" "main" {
name = "bug3939-resources"
location = "francecentral"
}
resource "azurerm_storage_account" "blob_storage" {
name = "bug3939storage"
resource_group_name = "${azurerm_resource_group.main.name}"
location = "${azurerm_resource_group.main.location}"
account_kind = "BlobStorage"
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_storage_container" "blob_container" {
name = "bug3939-container"
storage_account_name = "${azurerm_storage_account.blob_storage.name}"
container_access_type = "blob"
} Error message:
My current workaround is to move the location to North Europe. |
@loderunner I didn't try changing the location. I will try it. |
I have the same issue with North Europe and West Europe using version 1.32.0 and 1.32.1. |
Hey guys, I ended up rolling back the azure rm provider to 1.28 and looks like this is fixed on my end so it's definitely something in the 1.3x release. |
I've been trying to reproduce this issue over the week-en, and found that the same error manifests at different points in different scenarios. I built a simple Terraform Azure configuration that should deploy a storage account and container, and made variables for location and storage kind. provider "azurerm" {
version = "~> 1.32.1"
}
variable "region" {}
variable "storage_kind" {}
resource "azurerm_resource_group" "main" {
name = "loderunner-bugtest-resources"
location = "${var.region}"
}
resource "azurerm_storage_account" "blob_storage" {
name = "loderunnerbugteststorage"
resource_group_name = "${azurerm_resource_group.main.name}"
location = "${azurerm_resource_group.main.location}"
account_kind = "${var.storage_kind}"
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_storage_container" "blob_container" {
name = "loderunnerbugtest"
storage_account_name = "${azurerm_storage_account.blob_storage.name}"
container_access_type = "blob"
} I ran the same scenario for 4 different combinations:
Ypu can find the logs from these operations in this gist.
The ideal configuration for my current project if France Central/StorageV2. Hope this helps, keep me posted if you want me to investigate more. |
I raised a Support Ticket to Microsoft Azure. This is the answer from the support team to this 500 error:
Tried again and the error was gone. So looks like a Microsoft problem, not a Terraform one. Nevertheless, I don't know if there is anything Terraform can do to make this error more user-friendly... at least in my scenario where I received a 500 error. |
Still doing it in eastus with 1.3x, working with 1.28. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I can reproduce this. With no changes to my terraform code or infrastructure state, but upgrading my provider from 1.28.0 to 1.32.1, |
👋 So I'm struggling to reproduce this error, with different account kinds in different regions - but I believe the root cause is a permissions issue. Beginning in v1.32 of the Azure Provider we now can manage the Storage Properties for a Queue, which are configured on the top-level Storage Account; as such even if none are defined we make a call to the As such I believe this may need an additional permission to configure these properties (outlined here) - but without being able to reproduce this error makes it hard for me to confirm for sure; that said - looking at the documentation I believe this should be the So that we can debug this further, would it be possible for someone to confirm the permissions for the account/service principal they're using for the Resource Group/Storage Account/Container, and which means of authentication you're using (e.g. Azure CLI, MSI, Service Principal etc)? Thanks! |
I got these errors with Azure CLI authenticating as myself - the subscription owner, so I definitely have all the required permissions |
The Azure Provider uses the Resource ID as the Identifier rather than the Name, as such you'll need to use this to import it (an example can be found in the docs). |
@mikhailshilkov thanks for the repro - but unfortunately I'm still unable to repro this using the steps you've outlined when authenticating using the Azure CLI or a Service Principal (and when going from 1.31.0 -> 1.32.1 or 1.32.1 -> master):
That said looking at the Azure Docs here (and this Stack Overflow page) it appears the
Whilst I can't reproduce this, I believe this extra permission is the root cause of this - and whilst we could ask folks to assign this extra permission (which isn't ideal), it appears this may not be possible if a DataBricks resource is provisioned. Version 1.32 of the Azure Provider switched to using AzureAD Authentication for accessing the Storage Queues API, which is why this permission is now required; as such I'm going to open a PR to switch this over to using SharedKey for authentication instead - which should resolve this. Thanks! |
@tombuildsstuff Yeah, my repro has nothing special in it, so it must be related to the environment... Do you know where
comes from? I'm on Windows on a non-English locale, so one of my guesses were some encoding issues somewhere. |
That's coming from Azure/go-autorest which doesn't correctly parse the errors out of XML responses properly (since it's assumes the response is JSON by default) - I'd been meaning to send a PR for it but haven't got to that yet unfortunately. |
hi guys, I have the same issue. Not a fix but a workaround for me was to create and delete a queue. Can someone confirm this as workaround or was it just a coincident? |
@ljmsc must be a coincidence, didn't resolve the issue for me. Also, adding myself as a Storage Blob Contributor had no effect. |
Thanks @sladeedmonds for testing. I did a few more things before it worked. Maybe you can try them as well?
After each step I did a |
This has been released in version 1.33.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 1.33.0"
}
# ... other configuration ... |
I have confirmed that 1.33.0 resolves the issue I was having. Thanks much, @tombuildsstuff ! |
This is still affecting as after updating to 1.33. We consistently get 403 error, which cannot be decoded. Could it be that the API used for creating them changed and we lack permissions now? |
It seems this example is able to reproduce it:
I am not even able to create the storage container. I always get:
|
All my cases from this comment have been fixed by 1.33.0 👍 Thanks! |
I can also confirm that after upgrading to 1.33, |
@tombuildsstuff I'm aware of #2977, but it looks like issue with premium storage accounts, as in example above happens regardless of network policies. Should I create another issue to track it? |
unfortunately in my case problem persists
issue occurs when queue_properties cors_rule is added |
@damianskobel this issue is being tracked in #2977 |
@tombuildsstuff I'm not sure it's related, my error is more like above
|
Confirming that upgrading to v1.33, plan and apply are working for storage accounts again. |
It seems I found the solution, at least to my problem. Switching Authentication signature from |
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 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.12.3
Affected Resource(s)
azurerm_storage_account
Terraform Configuration Files
`
variable "storage_name" {}
variable "region" {}
variable "resource_group_name" {}
variable "environment" {}
variable "usage" {}
variable "dependencies" {
type = list(string)
}
resource "null_resource" "dependency_getter" {
triggers = {
my_dependencies = join(",", var.dependencies)
}
}
Generate random text for a unique name
resource "random_id" "randomId" {
keepers = {
# Generate a new ID only when a new resource group is defined
resource_group = var.resource_group_name
}
byte_length = 8
}
resource "azurerm_storage_account" "stgacc" {
name = "diag${random_id.randomId.hex}"
resource_group_name = var.resource_group_name
location = var.region
account_tier = "Standard"
account_replication_type = "LRS"
tags = {
environment = var.environment
}
depends_on = [null_resource.dependency_getter]
}
resource "azurerm_storage_account" "stgaccount" {
name = var.storage_name
resource_group_name = var.resource_group_name
location = var.region
account_tier = "Standard"
account_replication_type = "LRS"
tags = {
environment = var.environment
}
depends_on = [null_resource.dependency_getter]
}
`
Debug Output
Panic Output
Expected Behavior
Terraform successful creation statement.
Actual Behavior
Error: Error reading queue properties for AzureRM Storage Account "diag5d01f638b17d3d58": queues.Client#SetServiceProperties: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "\ufeff
AuthorizationPermissionMismatch
This request is not authorized to perform this operation using this permission.\nRequestId:4554aa06-9003-00dc-7bb2-43c9be000000\nTime:2019-07-26T13:01:08.2516744Z" error: invalid character 'ï' looking for beginning of valueError: Error reading queue properties for AzureRM Storage Account "tboxfkartstorage": queues.Client#SetServiceProperties: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: error response cannot be parsed: "\ufeff
AuthorizationPermissionMismatch
This request is not authorized to perform this operation using this permission.\nRequestId:df5abaf5-5003-0010-03b2-43d411000000\nTime:2019-07-26T13:00:58.3772146Z" error: invalid character 'ï' looking for beginning of valueSteps to Reproduce
terraform apply
Important Factoids
The resources are created and visible in the azure portal with proper configuration. But the script ends without success message.
References
The text was updated successfully, but these errors were encountered: