Azure / aztfexport

A tool to bring existing Azure resources under Terraform's management
https://azure.github.io/aztfexport/
Mozilla Public License 2.0
1.59k stars 184 forks source link

Azure Terraform Export Tool Stuck In Initializing #529

Closed UdhavPawar closed 4 months ago

UdhavPawar commented 4 months ago

Hello AZ TF export team, hope you're doing great! your tool is amazing and was working great, but now all of sudden it's stuck in initializing step forever.

I'm running a simple RG export command aztfexport resource-group --hcl-only "RG name". I tried and verified following:

  1. AZ CLI has vaid creds via az login and has access to that RG.
  2. Used a fresh new empty directory.
  3. TF init works as expected when run manually.
  4. Also upgraded TF binary to latest version.
  5. Tool does try to init latest Azure provider.

Pls lmk is any additional input is required from my end, thank you.

Screenshot 2024-05-21 at 10 57 28 AM
admin@host:~/Downloads/temp/test-init$ aztfexport resource-group --hcl-only "en-qa-app-rg"
admin@host:~/Downloads/temp/test-init$ stuck in init so I exited
admin@host:~/Downloads/temp/test-init$ 
admin@host:~/Downloads/temp/test-init$ files generated by tool
admin@host:~/Downloads/temp/test-init$ ls -l
total 16
-rw-r--r--  1 admin  staff    40B May 21 11:05 provider.tf
-rw-r--r--  1 admin  staff   146B May 21 11:05 terraform.tf
admin@host:~/Downloads/temp/test-init$ cat provider.tf 
provider "azurerm" {
  features {
  }
}
admin@host:~/Downloads/temp/test-init$ cat terraform.tf 
terraform {
  backend "local" {}

  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "3.99.0"

    }
  }
}
stemaMSFT commented 4 months ago

Thanks for the issue, @UdhavPawar! Can you try running with --non-interactive and see if the tool gets stuck in the same initialization process?

UdhavPawar commented 4 months ago

Thanks for the issue, @UdhavPawar! Can you try running with --non-interactive and see if the tool gets stuck in the same initialization process?

Thank you for the prompt response @stemaMSFT yes same issue.

magodo commented 4 months ago

@UdhavPawar Could you please enable the logs by adding --log-path /tmp/log.txt --log-level TRACE options, and send the log file (i.e. /tmp/log.txt) here (with secrets redacted)?

UdhavPawar commented 4 months ago

update: think I figured out the issue, seems like I was rate limited by terraform lol (each run was fetching 100s of resources and I've been making calls since morning) ... took a break for few hours and it works now.

Thank you all for quick help, marking this as resolved.