terraformer: terraformer plan azure: "panic: runtime error: invalid memory address or nil pointer dereference"

Terraformer v0.8.21, macOS Monterey 12.2.1 (but similar issue observed on a Windows 10 laptop as well)

$ az login
$ export ARM_SUBSCRIPTION_ID=<somesubscriptionid>
$ terraformer plan azure -R MYRESOURCEGROUP --resources=*

2022/06/02 23:08:13 Testing if Service Principal / Client Certificate is applicable for Authentication..
2022/06/02 23:08:13 Testing if Multi Tenant Service Principal / Client Secret is applicable for Authentication..
2022/06/02 23:08:13 Testing if Service Principal / Client Secret is applicable for Authentication..
2022/06/02 23:08:13 Testing if Managed Service Identity is applicable for Authentication..
2022/06/02 23:08:13 Testing if Obtaining a token from the Azure CLI is applicable for Authentication..
2022/06/02 23:08:13 Using Obtaining a token from the Azure CLI for Authentication
2022/06/02 23:08:13 Getting OAuth config for endpoint https://login.microsoftonline.com/ with  tenant 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6bad4d3]

goroutine 1 [running]:
github.com/hashicorp/go-azure-helpers/authentication.Config.GetAuthorizationToken(...)
	github.com/hashicorp/go-azure-helpers@v0.10.0/authentication/config.go:123
github.com/GoogleCloudPlatform/terraformer/providers/azure.(*AzureProvider).getAuthorizer(0xc0005489a0)
	github.com/GoogleCloudPlatform/terraformer/providers/azure/azure_provider.go:91 +0x173
github.com/GoogleCloudPlatform/terraformer/providers/azure.(*AzureProvider).Init(0xc0005489a0, {0xc000a10ca0, 0x1, 0x102800a?})
	github.com/GoogleCloudPlatform/terraformer/providers/azure/azure_provider.go:105 +0x3f
github.com/GoogleCloudPlatform/terraformer/cmd.initOptionsAndWrapper({_, _}, {{0xc000a10c80, 0x1, 0x1}, {0x11e48aa0, 0x0, 0x0}, {0xad37714, 0x1e}, ...}, ...)
	github.com/GoogleCloudPlatform/terraformer/cmd/import.go:112 +0x86
github.com/GoogleCloudPlatform/terraformer/cmd.Import({_, _}, {{0xc000a10c80, 0x1, 0x1}, {0x11e48aa0, 0x0, 0x0}, {0xad37714, 0x1e}, ...}, ...)
	github.com/GoogleCloudPlatform/terraformer/cmd/import.go:85 +0xbf
github.com/GoogleCloudPlatform/terraformer/cmd.newCmdAzureImporter.func1(0xc001316dc0?, {0xac8fc10?, 0x3?, 0x3?})
	github.com/GoogleCloudPlatform/terraformer/cmd/provider_cmd_azure.go:30 +0xd2
github.com/spf13/cobra.(*Command).execute(0xc001316dc0, {0xc0012a1b00, 0x3, 0x3})
	github.com/spf13/cobra@v1.1.1/command.go:850 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc00113a2c0)
	github.com/spf13/cobra@v1.1.1/command.go:958 +0x39c
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.1.1/command.go:895
github.com/GoogleCloudPlatform/terraformer/cmd.Execute()
	github.com/GoogleCloudPlatform/terraformer/cmd/root.go:36 +0x1e
main.main()
	github.com/GoogleCloudPlatform/terraformer/main.go:39 +0x50

az cli version information:

$ az --version
azure-cli                         2.37.0

core                              2.37.0
telemetry                          1.0.6

Extensions:
azure-devops                      0.18.0

Dependencies:
msal                            1.18.0b1
azure-mgmt-resource             21.1.0b1

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 11
  • Comments: 35

Most upvoted comments

I am having the same issue, I get this error when trying to import aws security groups from a region. I was able to import all other resources fine from the same region.

I tried filtering to import just one security group and the same error again, has anyone tried to import individual resources and faced the same issue?

Just before this error i was able to import all resources from another Region in AWS just fine

Got the same issue when running ‘terraformer import azure’ on macOS Monterrey 12.4 M1 pro and:

terraformer v0.8.21 azure-cli 2.37.0

Was this working fine in a previous release of terraformer? Should we just discard terraformer on Azure?

Thanks to all

Same issue on my macOS 12.4 (M1 cpu)

Confirmed the same issue on my macOS Monterrey 12.4 with

terraformer v0.8.21 azure-cli 2.37.0