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

scan throws error FeatureNotSupportedForAccount #1558

Closed
epalavras opened this issue Jul 5, 2022 · 6 comments
Closed

scan throws error FeatureNotSupportedForAccount #1558

epalavras opened this issue Jul 5, 2022 · 6 comments
Assignees
Labels
kind/bug Something isn't working status/backlog mean that the issue scope is clear and ready to be prioritized
Milestone

Comments

@epalavras
Copy link

Description
I am trying to run driftctl scan on a particular Azure Subscription, but I get the following error:

driftctl scan --only-unmanaged --from="tfstate+azurerm://testtf/*" --to="azure+tf"
Scanned states (3)
error scanning resource type azurerm_storage_container: {"error":{"code":"FeatureNotSupportedForAccount","message":"Blob is not supported for the account."}}

The issue is with this particular subscription, because everything works fine with another 2 subscriptions I tested. I also tried loading the state file from the local machine, but I got the same error.

Environment

  • OS: MacOS 12.4
  • driftctl version: v0.34.1
  • terraform version: 0.14.10
  • terraform providers versions: kubernetes@1.13.2, helm@2.1.0, gavinbunney/kubectl@1.7.0, azurerm@2.88.1"

How to reproduce
AZURE_SUBSCRIPTION_ID=<id> driftctl scan --only-unmanaged --from="tfstate+azurerm://testtf/*" --to="azure+tf"

Possible Solution

Additional context

@epalavras epalavras added the kind/bug Something isn't working label Jul 5, 2022
@eliecharra eliecharra added the status/backlog mean that the issue scope is clear and ready to be prioritized label Jul 6, 2022
@eliecharra
Copy link
Contributor

Hi @epalavras thanks for reporting that to us.

I don't think it's related with the subscription but with one of your storage account that does not support blob storage.
This is something we should catch here so this is definitively a bug.

Note for maintainers:
no need to trigger an alert for that case, just ignore the whole storage account, maybe adding a debug log record can make sense to explain why the storage account is skipped.

@moadibfr
Copy link
Contributor

moadibfr commented Jul 6, 2022

Seems it's an error from azure when driftctl try to scan azurerm_storage_container. Could you check if there is something specific about the storage account configuration you use for this subscription.
We should not stop the scan when this happen but it's a corner case for our error handling. I'll work on a fix but if we can identify why you have this alert it would help me reproduce and fix this.

@epalavras
Copy link
Author

Hi,
thank you for your prompt response.
There are different kinds of storage accounts under this subscription. Most of them are general v1 or v2, but there are some of type Blob or File. My guess would be that driftctl is trying to scan a storage account for azurerm_storage_container, but the type of that storage account is FileStorage. The other 2 subscriptions only have general v2 storage accounts.
Is there a way to enable debugging so I can check which of them causes the error?

@eliecharra
Copy link
Contributor

You can try to set LOG_LEVEL=debug but I'm pretty sure it will be easy to reproduce on our side by creating some storage account of type File.

@eliecharra
Copy link
Contributor

We reproduced it easily locally, @almog27 is working on a fix

eliecharra added a commit that referenced this issue Jul 19, 2022
…upportedforaccount

fix: fix #1558 by ignoring FeatureNotSupported
@patch-the-dog patch-the-dog added this to the v0.35.2 milestone Jul 19, 2022
@patch-the-dog
Copy link

This issue has been referenced in the v0.35.2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/backlog mean that the issue scope is clear and ready to be prioritized
Projects
None yet
Development

No branches or pull requests

5 participants