-
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: insufficient items for attribute "sku"; must have at least 1 #3964
Comments
I was hoping that 1.32.1 of the azurerm provider would address this issue but it looks like it's still present in that version as well (unfortunately). I've tried wiping my state as well and it still persists. :( Has anyone found a good workaround for this? It's a blocker for me at the moment. |
For anyone interested I managed to find a workaround to this:
That's it, in my case I only had 1 offending resource; after deleting it, I could do Again, this worked for my scenario but ymmv. |
@blinard We figured that out last night too. There were several App Services and their App Service Plans that had somehow been deleted through the portal, but I'm guessing that when Terraform was confirming their state, since the SKU field didn't even exist (since the App Service Plan was gone altogether), it was failing with the original error. All of this is supposition, but I feel like it makes the most sense? If true, it would mean that the SKU checking on the various resources are making the assumption that the resource still exists when checking its value, rather than skipping the SKU check altogether. @tombuildsstuff Thoughts? |
@blinard That workaround was successful for us as well. My guess is that we did something wrong and de-synced the Terraform state with the actual infrastructure. In any case, the "Error: insufficient items for attribute "sku"; must have at least 1" error message that's outputted isn't exactly ideal to pinpoint the issue. |
Hey @nexxai, I believe this is the same issue as #3584 and was centered around app_service_plan not returning an error on 404 which is an assumption we make throughout the provider. We merged a workaround for #3584 that might unblock you if you feel comfortable testing it out by building the provider off of master. If that doesn't work we'll continue digging until we find the root cause of your issue. |
I am having the same error, however in my case I haven't deleted any app service plans, instead I imported one and then started getting this error. I did notice that when I did an import, the sku was not set correctly in the state file. My guess is that there is an issue with the provider when it queries the state from azure to reconcile state vs. actual. I have tried modifying state to have the correct values, but I have not been successful yet. |
@aweiker Could your issue by any chance be related to #2991? I noticed that I imported the app service plan via the URL instead of
Notice the capitalization in |
@flagbug - What you found exactly described the root cause of my "insufficient items" error, I had deployed a linux ASP, which at the 58 min mark tf died, so after it finally provisioned I tried to import it and... this error kept on popping up and the state info was missing alot of things. Using the all lowercase serverfarms vs serverFarms on the import gave all the required info. |
Since this issue has been reported a long time ago and relates to the version of provider we no longer support - I'm going to close it. Please open a new updated bug report on current versions of terraform and provider if this is still relevant. Thank you. |
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. |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.12.5
(I've also tried v1.30.0, v1.31.0, and v1.32.0 of provider.azurerm; the issue occurs in all of them)
Affected Resource(s)
This is the problem: we don't know
Terraform Configuration Files
We have several .tf files in this environment; please review the debug log and let me know which one(s) you need to see
Debug Output
https://gist.github.com/nexxai/cce7e4a6b7097484db5963b23ecdb439 - signed via KeyBase
Panic Output
n/a
Expected Behavior
terraform plan
should have completed successfullyActual Behavior
We receive two of these errors:
Error: insufficient items for attribute "sku"; must have at least 1
Steps to Reproduce
terraform plan
Important Factoids
We have gone through and confirmed that every single SKU block in every single resource is formatted correctly. We have also tried backing up and then removing each SKU setting from each resource directly from the state file. Finally, in the azurerm_key_vault resources, we have tried every combination of
sku
andsku_name
when we were using the v1.32.0 azurerm_providerReferences
terraform plan
on App Service Plan deleted outside of Terraform #3584 - same error, same provider, potentially same resourceThe text was updated successfully, but these errors were encountered: