terraformer
terraformer copied to clipboard
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/[email protected]/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/[email protected]/command.go:850 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc00113a2c0)
github.com/spf13/[email protected]/command.go:958 +0x39c
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/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
Same issue on WSL for Windows 10 (21H2 build 19044.1741).
Az info:
$ az --version
azure-cli 2.37.0
core 2.37.0
telemetry 1.0.6
Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1
When running:
$ terraformer plan azure --output hcl --resource-group $RESOURCEGROUPNAME --resources="*" --verbose
2022/06/06 20:54:09 Testing if Service Principal / Client Certificate is applicable for Authentication..
2022/06/06 20:54:09 Testing if Multi Tenant Service Principal / Client Secret is applicable for Authentication..
2022/06/06 20:54:09 Testing if Service Principal / Client Secret is applicable for Authentication..
2022/06/06 20:54:09 Testing if Managed Service Identity is applicable for Authentication..
2022/06/06 20:54:09 Testing if Obtaining a token from the Azure CLI is applicable for Authentication..
2022/06/06 20:54:09 Using Obtaining a token from the Azure CLI for Authentication
2022/06/06 20:54:09 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=0x5faf3d3]
goroutine 1 [running]:
github.com/hashicorp/go-azure-helpers/authentication.Config.GetAuthorizationToken(...)
/home/runner/go/pkg/mod/github.com/hashicorp/[email protected]/authentication/config.go:123
github.com/GoogleCloudPlatform/terraformer/providers/azure.(*AzureProvider).getAuthorizer(0xc00044ea80)
/home/runner/work/terraformer/terraformer/providers/azure/azure_provider.go:91 +0x173
github.com/GoogleCloudPlatform/terraformer/providers/azure.(*AzureProvider).Init(0xc00044ea80, {0xc0000fcfb0, 0x1, 0x7f468582250a?})
/home/runner/work/terraformer/terraformer/providers/azure/azure_provider.go:105 +0x3f
github.com/GoogleCloudPlatform/terraformer/cmd.initOptionsAndWrapper({_, _}, {{0xc0000fcfa0, 0x1, 0x1}, {0x11297e80, 0x0, 0x0}, {0xa1397f5, 0x1e}, ...}, ...)
/home/runner/work/terraformer/terraformer/cmd/import.go:112 +0x86
github.com/GoogleCloudPlatform/terraformer/cmd.Import({_, _}, {{0xc0000fcfa0, 0x1, 0x1}, {0x11297e80, 0x0, 0x0}, {0xa1397f5, 0x1e}, ...}, ...)
/home/runner/work/terraformer/terraformer/cmd/import.go:85 +0xbf
github.com/GoogleCloudPlatform/terraformer/cmd.newCmdAzureImporter.func1(0xc0009302c0?, {0xa091888?, 0x6?, 0x6?})
/home/runner/work/terraformer/terraformer/cmd/provider_cmd_azure.go:30 +0xd2
github.com/spf13/cobra.(*Command).execute(0xc0009302c0, {0xc000bc58c0, 0x6, 0x6})
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:850 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000880580)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:958 +0x39c
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:895
github.com/GoogleCloudPlatform/terraformer/cmd.Execute()
/home/runner/work/terraformer/terraformer/cmd/root.go:36 +0x1e
main.main()
/home/runner/work/terraformer/terraformer/main.go:39 +0x50
WSL info:
$ uname -a
Linux 048802602457 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
and:
$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
Terraformer version:
$ terraformer -v
version v0.8.21
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
Confirmed the same issue on WIndows 11 Pro with terraform version v0.8.21
Any feedback much appreciated!
Confirmed the same issue on my macOS Monterrey 12.4 with
terraformer v0.8.21 azure-cli 2.37.0
Same issue on my macOS 12.4 (M1 cpu)
I encountered this issue when I tried to run terraformer before terraform init
. By this time, I had also build terraformer from source with all providers.
Looks like login over "az login" is broken :( (or isn't compatible with 2FA or similar stuff)
i have tried install terraformer from source and looks like login is OK :) (i have MacBook with intel CPU, i'm using (almost) latest terraform binary)
I have the same issue
I have the same issue on Terraformer import
same issue
Same issue when trying to run "~/terraformer import azure -r *" using Terraformer v0.8.22 on Ubuntu 22.04.01
Here's the pertinent bit of output
Getting OAuth config for endpoint https://login.microsoftonline.com/ with tenant"
Then "panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6327315]
It would be nice to see this working
Cheers
-=A=-
.
It ran fine on resources=application.
But then I had the same reported issue when running terraformer import azuread --resources=group
It ran until it hit a group that has 43 characters in its name. Not sure if that's what's causing it or not, but thought I'd mention that.
Here's what it output: panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10a1c8ae8]
goroutine 1 [running]: github.com/GoogleCloudPlatform/terraformer/providers/azuread.(*GroupServiceGenerator).InitResources(0x1400018f7a0) github.com/GoogleCloudPlatform/terraformer/providers/azuread/group.go:51 +0x98 github.com/GoogleCloudPlatform/terraformer/cmd.initServiceResources({, }, {, }, {{0x14000501860, 0x1, 0x1}, {0x1152b68d8, 0x0, 0x0}, ...}, ...) github.com/GoogleCloudPlatform/terraformer/cmd/import.go:209 +0x1a4 github.com/GoogleCloudPlatform/terraformer/cmd.initAllServicesResources(, {{0x14000501860, 0x1, 0x1}, {0x1152b68d8, 0x0, 0x0}, {0x10c0dadd4, 0x1e}, {0x10c03d33e, ...}, ...}, ...) github.com/GoogleCloudPlatform/terraformer/cmd/import.go:166 +0x12c github.com/GoogleCloudPlatform/terraformer/cmd.Import({, _}, {{0x14000501860, 0x1, 0x1}, {0x1152b68d8, 0x0, 0x0}, {0x10c0dadd4, 0x1e}, ...}, ...) github.com/GoogleCloudPlatform/terraformer/cmd/import.go:98 +0x17c github.com/GoogleCloudPlatform/terraformer/cmd.newCmdAzureADImporter.func1(0x14001241600?, {0x10c02f4a5?, 0x1?, 0x1?}) github.com/GoogleCloudPlatform/terraformer/cmd/provider_cmd_azuread.go:30 +0xb0 github.com/spf13/cobra.(*Command).execute(0x14001241600, {0x14000501810, 0x1, 0x1}) github.com/spf13/[email protected]/command.go:850 +0x4c4 github.com/spf13/cobra.(*Command).ExecuteC(0x14001198580) github.com/spf13/[email protected]/command.go:958 +0x34c github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/[email protected]/command.go:895 github.com/GoogleCloudPlatform/terraformer/cmd.Execute() github.com/GoogleCloudPlatform/terraformer/cmd/root.go:36 +0x20 main.main() github.com/GoogleCloudPlatform/terraformer/main.go:39 +0x54
Is there a solution for the error. In my case it ran fine for weeks, but now I can't get it to complete.
from my last try, new version seems to be OKish.
Hi all, I installed yesterday and I have same error doing an import. Last version of terraformer and providers installed
Same error on Windows 10 with latest version of terraform, when trying to import aws resources="*". Getting below error `panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x0 pc=0x53f6f9f]
goroutine 1 [running]: github.com/GoogleCloudPlatform/terraformer/providers/aws.fromPort(...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:362 github.com/GoogleCloudPlatform/terraformer/providers/aws.baseRuleAttributes({, }, {0x0, 0xc002540e60, {0xc001d688b8, 0x1, 0x1}, {0x85ba2f0, 0x0, 0x0}, ...}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:164 +0x33f github.com/GoogleCloudPlatform/terraformer/providers/aws.processRule({0x0, 0xc002540e60, {0xc001d688b8, 0x1, 0x1}, {0x85ba2f0, 0x0, 0x0}, {0x85ba2f0, 0x0, ...}, ...}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:145 +0x718 github.com/GoogleCloudPlatform/terraformer/providers/aws.SecurityGenerator.createResources({{{{0x5fafb25, 0x2}, {0x0, 0x0, 0x0}, {0x5fb00f8, 0x3}, 0xc001ce0540, {0xc000dea6c0, 0x2, ...}, ...}}}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:84 +0x7cd github.com/GoogleCloudPlatform/terraformer/providers/aws.(*SecurityGenerator).InitResources(0xc00249e300) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:260 +0x3b0 github.com/GoogleCloudPlatform/terraformer/providers/aws.(*AwsFacade).InitResources(0xc0024829b0?) /home/runner/work/terraformer/terraformer/providers/aws/aws_facade.go:61 +0x26 github.com/GoogleCloudPlatform/terraformer/cmd.initServiceResources({, }, {, }, {{0xc00098d800, 0x54, 0x80}, {0x85ba2f0, 0x0, 0x0}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/import.go:209 +0x21e github.com/GoogleCloudPlatform/terraformer/cmd.initAllServicesResources(, {{0xc00098d800, 0x54, 0x80}, {0x85ba2f0, 0x0, 0x0}, {0x6021037, 0x1e}, {0x5fba256, ...}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/import.go:166 +0x1a7 github.com/GoogleCloudPlatform/terraformer/cmd.Import({, _}, {{0xc00098d800, 0x54, 0x80}, {0x85ba2f0, 0x0, 0x0}, {0x6021037, 0x1e}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/import.go:98 +0x2a5 github.com/GoogleCloudPlatform/terraformer/cmd.importRegionResources({{0xc0002e0690, 0x1, 0x1}, {0x85ba2f0, 0x0, 0x0}, {0x6021037, 0x1e}, {0x5fba256, 0x9}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/provider_cmd_aws.go:121 +0x292 github.com/GoogleCloudPlatform/terraformer/cmd.newCmdAwsImporter.func1(0xc0001a62c0?, {0x5fb0cfc?, 0x5?, 0x5?}) /home/runner/work/terraformer/terraformer/cmd/provider_cmd_aws.go:58 +0x5ae github.com/spf13/cobra.(*Command).execute(0xc0001a62c0, {0xc0002e85a0, 0x5, 0x5}) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:850 +0x67c github.com/spf13/cobra.(*Command).ExecuteC(0xc0003ad600) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:958 +0x39d github.com/spf13/cobra.(*Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:895 github.com/GoogleCloudPlatform/terraformer/cmd.Execute() /home/runner/work/terraformer/terraformer/cmd/root.go:36 +0x1e main.main() /home/runner/work/terraformer/terraformer/main.go:39 +0x50`
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
@Gopinath-Radhakrishnan This is fixed in https://github.com/GoogleCloudPlatform/terraformer/pull/1492 I rebuilt it with the merged code and I can import SGs from AWS. Good luck!
@djedi-maat , I have below code in sg.go `func fromPort(ip types.IpPermission) int { switch { case *ip.IpProtocol == "icmp": return -1 case *ip.IpProtocol == "-1": return -1 case ip.FromPort != nil && *ip.FromPort > 0: return int(*ip.FromPort) default: return 0 } }
func toPort(ip types.IpPermission) int { switch { case *ip.IpProtocol == "icmp": return -1 case *ip.IpProtocol == "-1": return -1 case ip.ToPort != nil && *ip.ToPort > 0: return int(*ip.ToPort) default: return 65536 } }`
But still I am getting error while importing AWS SG. `C:\Users\tapan.shah\Desktop\terraformer\terraformer>terraformer import aws --resources=sg --regions=ap-northeast-1 2022/11/22 10:16:21 aws importing region ap-northeast-1 2022/11/22 10:16:24 aws importing... sg panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x0 pc=0x4ed6f9f]
goroutine 1 [running]: github.com/GoogleCloudPlatform/terraformer/providers/aws.fromPort(...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:362 github.com/GoogleCloudPlatform/terraformer/providers/aws.baseRuleAttributes({, }, {0x0, 0xc000c52410, {0xc000c1e0d8, 0x1, 0x1}, {0x809a2f0, 0x0, 0x0}, ...}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:164 +0x33f github.com/GoogleCloudPlatform/terraformer/providers/aws.processRule({0x0, 0xc000c52410, {0xc000c1e0d8, 0x1, 0x1}, {0x809a2f0, 0x0, 0x0}, {0x809a2f0, 0x0, ...}, ...}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:145 +0x718 github.com/GoogleCloudPlatform/terraformer/providers/aws.SecurityGenerator.createResources({{{{0xc0008b5740, 0x2}, {0x0, 0x0, 0x0}, {0x5a900f8, 0x3}, 0xc001a067e0, {0x809a2f0, 0x0, ...}, ...}}}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:84 +0x7cd github.com/GoogleCloudPlatform/terraformer/providers/aws.(*SecurityGenerator).InitResources(0xc00089c120) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:260 +0x3b0 github.com/GoogleCloudPlatform/terraformer/providers/aws.(*AwsFacade).InitResources(0xc0003b6640?) /home/runner/work/terraformer/terraformer/providers/aws/aws_facade.go:61 +0x26 github.com/GoogleCloudPlatform/terraformer/cmd.initServiceResources({, }, {, }, {{0xc000657830, 0x1, 0x1}, {0x809a2f0, 0x0, 0x0}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/import.go:209 +0x21e github.com/GoogleCloudPlatform/terraformer/cmd.initAllServicesResources(, {{0xc000657830, 0x1, 0x1}, {0x809a2f0, 0x0, 0x0}, {0x5b01037, 0x1e}, {0x5a9a256, ...}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/import.go:166 +0x1a7 github.com/GoogleCloudPlatform/terraformer/cmd.Import({, _}, {{0xc000657830, 0x1, 0x1}, {0x809a2f0, 0x0, 0x0}, {0x5b01037, 0x1e}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/import.go:98 +0x2a5 github.com/GoogleCloudPlatform/terraformer/cmd.importRegionResources({{0xc0006577f0, 0x1, 0x1}, {0x809a2f0, 0x0, 0x0}, {0x5b01037, 0x1e}, {0x5a9a256, 0x9}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/provider_cmd_aws.go:121 +0x292 github.com/GoogleCloudPlatform/terraformer/cmd.newCmdAwsImporter.func1(0xc000491080?, {0x5a90cfc?, 0x2?, 0x2?}) /home/runner/work/terraformer/terraformer/cmd/provider_cmd_aws.go:58 +0x5ae github.com/spf13/cobra.(*Command).execute(0xc000491080, {0xc0008c44e0, 0x2, 0x2}) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:850 +0x67c github.com/spf13/cobra.(*Command).ExecuteC(0xc000490580) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:958 +0x39d github.com/spf13/cobra.(*Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:895 github.com/GoogleCloudPlatform/terraformer/cmd.Execute() /home/runner/work/terraformer/terraformer/cmd/root.go:36 +0x1e main.main() /home/runner/work/terraformer/terraformer/main.go:39 +0x50`
Facing the same issue. Can someone provide the solution if you were able to fix. Thanks
I fixed the problem by shifting to Terrafy as it's a lot easier to use, and not only exports the existing state, it generates the .tf files as well
It could be better at exporting things, but it does what it says on the tin, and it makes it easy to export an existing Azure infrastructure (or at least as much as it can currently handle)
Probably not the solution most are looking for - but it's the best one for me at this point in time
Cheers
-=A=-
.
On Tue, Jan 3, 2023 at 5:29 PM Chaitanya Boggavarapu < @.***> wrote:
Facing the same issue. Can someone provide the solution if you were able to fix. Thanks
— Reply to this email directly, view it on GitHub https://github.com/GoogleCloudPlatform/terraformer/issues/1340#issuecomment-1370039426, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARAYJJM6RIERVMPZ4ZYRKVDWQROWPANCNFSM5XWH7CKA . You are receiving this because you commented.Message ID: @.***>
@dbhaigh , I need solution for AWS infrastructure and Terrafy seems to be for Azure.
It is Azure-centric as it is being developed by Microsoft - great for me, but unfortunately not for you
Hope the terraform devs sort their problems out as this issue has been outstanding for a while now
On Wed, 4 Jan 2023, 19:38 tapanshah7891, @.***> wrote:
@dbhaigh https://github.com/dbhaigh , I need solution for AWS infrastructure and Terrafy seems to be for Azure.
— Reply to this email directly, view it on GitHub https://github.com/GoogleCloudPlatform/terraformer/issues/1340#issuecomment-1371340637, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARAYJJNFXHTX2KKQXABC4DTWQXGU7ANCNFSM5XWH7CKA . You are receiving this because you were mentioned.Message ID: @.***>
Hi,
the problem for aws seems to be faced when we import sgs, i have 47 security group in tis account : ..... ..... 2023/01/23 16:51:11 aws done importing ses 2023/01/23 16:51:11 aws importing... sfn 2023/01/23 16:51:12 aws done importing sfn 2023/01/23 16:51:12 aws importing... sg panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4d70abf]
goroutine 1 [running]: github.com/GoogleCloudPlatform/terraformer/providers/aws.fromPort(...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:362 github.com/GoogleCloudPlatform/terraformer/providers/aws.baseRuleAttributes({_, _}, {0x0, 0xc000b9a890, {0xc002238d98, 0x1, 0x1}, {0x7eff210, 0x0, 0x0}, ...}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:164 +0x33f github.com/GoogleCloudPlatform/terraformer/providers/aws.processRule({0x0, 0xc000b9a890, {0xc002238d98, 0x1, 0x1}, {0x7eff210, 0x0, 0x0}, {0x7eff210, 0x0, ...}, ...}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:145 +0x718 github.com/GoogleCloudPlatform/terraformer/providers/aws.SecurityGenerator.createResources({{{{0x59285be, 0x2}, {0x0, 0x0, 0x0}, {0x5928ade, 0x3}, 0xc002089f80, {0x7eff210, 0x0, ...}, ...}}}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:84 +0x7cd github.com/GoogleCloudPlatform/terraformer/providers/aws.(*SecurityGenerator).InitResources(0xc0020e8fc0) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:260 +0x3b0 github.com/GoogleCloudPlatform/terraformer/providers/aws.(*AwsFacade).InitResources(0xc0020b2500?) /home/runner/work/terraformer/terraformer/providers/aws/aws_facade.go:61 +0x26
the problem for aws seems to be faced when we import sgs, i have 47 security group in tis account :
yes, got the same issue when importing security groups. I have 178 of them
`aws importing... sg panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4d70abf]
goroutine 1 [running]: github.com/GoogleCloudPlatform/terraformer/providers/aws.fromPort(...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:362 github.com/GoogleCloudPlatform/terraformer/providers/aws.baseRuleAttributes({, }, {0x0, 0xc000e88b10, {0x7eff210, 0x0, 0x0}, {0x7eff210, 0x0, 0x0}, ...}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:164 +0x33f github.com/GoogleCloudPlatform/terraformer/providers/aws.processRule({0x0, 0xc000e88b10, {0x7eff210, 0x0, 0x0}, {0x7eff210, 0x0, 0x0}, {0x7eff210, 0x0, ...}, ...}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:126 +0xa98 github.com/GoogleCloudPlatform/terraformer/providers/aws.SecurityGenerator.createResources({{{{0x59285be, 0x2}, {0x0, 0x0, 0x0}, {0x5928ade, 0x3}, 0xc00258d2c0, {0x7eff210, 0x0, ...}, ...}}}, ...) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:81 +0x6ed github.com/GoogleCloudPlatform/terraformer/providers/aws.(*SecurityGenerator).InitResources(0xc001e7d860) /home/runner/work/terraformer/terraformer/providers/aws/sg.go:260 +0x3b0 github.com/GoogleCloudPlatform/terraformer/providers/aws.(*AwsFacade).InitResources(0xc002036550?) /home/runner/work/terraformer/terraformer/providers/aws/aws_facade.go:61 +0x26 github.com/GoogleCloudPlatform/terraformer/cmd.initServiceResources({, }, {, }, {{0xc0006c5800, 0x54, 0x80}, {0x7eff210, 0x0, 0x0}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/import.go:209 +0x21e github.com/GoogleCloudPlatform/terraformer/cmd.initAllServicesResources(, {{0xc0006c5800, 0x54, 0x80}, {0x7eff210, 0x0, 0x0}, {0x5998962, 0x1e}, {0x5932b62, ...}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/import.go:166 +0x1a7 github.com/GoogleCloudPlatform/terraformer/cmd.Import({, _}, {{0xc0006c5800, 0x54, 0x80}, {0x7eff210, 0x0, 0x0}, {0x5998962, 0x1e}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/import.go:98 +0x2a5 github.com/GoogleCloudPlatform/terraformer/cmd.importRegionResources({{0xc0003db2d0, 0x1, 0x1}, {0x7eff210, 0x0, 0x0}, {0x5998962, 0x1e}, {0x5932b62, 0x9}, ...}, ...) /home/runner/work/terraformer/terraformer/cmd/provider_cmd_aws.go:121 +0x292 github.com/GoogleCloudPlatform/terraformer/cmd.newCmdAwsImporter.func1(0xc0001d8580?, {0x5929668?, 0x1?, 0x1?}) /home/runner/work/terraformer/terraformer/cmd/provider_cmd_aws.go:66 +0x13e github.com/spf13/cobra.(*Command).execute(0xc0001d8580, {0xc0003db2b0, 0x1, 0x1}) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:850 +0x67c github.com/spf13/cobra.(*Command).ExecuteC(0xc000345080) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:958 +0x39d github.com/spf13/cobra.(*Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:895 github.com/GoogleCloudPlatform/terraformer/cmd.Execute() /home/runner/work/terraformer/terraformer/cmd/root.go:36 +0x1e main.main() /home/runner/work/terraformer/terraformer/main.go:39 +0x50 `
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
I am still facing issue with AWS SG import. Anyone got the solution around it?
Same issue with AWS SG import
Same Issue with AWS SG import