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

[Bug]: Generator crashes with invalid memory address or nil pointer dereference when updating to terraform-provider-google v6.10.0 #656

Open
1 task done
rickard-von-essen opened this issue Nov 10, 2024 · 2 comments
Labels
bug Something isn't working needs:triage

Comments

@rickard-von-essen
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Affected Resource(s)

All

Resource MRs required to reproduce the bug

No response

Steps to Reproduce

  1. Change Makefile to use v 6.10.0 of the terraform-provider-google
diff --git a/Makefile b/Makefile
index 6212c055..606ab03b 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ PROJECT_NAME := provider-$(PROVIDER_NAME)
 PROJECT_REPO := github.com/upbound/$(PROJECT_NAME)

 export TERRAFORM_VERSION := 1.5.5
-export TERRAFORM_PROVIDER_VERSION := 5.44.2
+export TERRAFORM_PROVIDER_VERSION := 6.10.0
 export TERRAFORM_PROVIDER_SOURCE := hashicorp/google
 export TERRAFORM_PROVIDER_REPO ?= https://github.com/hashicorp/terraform-provider-google
 export TERRAFORM_DOCS_PATH ?= website/docs/r
  1. Regenerate make clean generate

What happened?

It fails with panic: runtime error: invalid memory address or nil pointer dereference

Relevant Error Output Snippet

go run github.com/crossplane/upjet/cmd/scraper -n hashicorp/terraform-provider-google -r ../.work/terraform-provider-google/website/docs/r -o ../config/provider-metadata.yaml --prelude-xpath //text()[contains(., "subcategory")] --resource-prefix google
go run ../cmd/generator/main.go ..
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x103628a08]

goroutine 1 [running]:
github.com/crossplane/upjet/pkg/schema/traverser.AccessSchema({0x1078e1de0?, 0x0?}, {0x1400348feb0?, 0x1, 0x140030877c8?}, {0x140030877b8, 0x1, 0x1})
        /Users/ext.rickard.von/.asdf/installs/go/1.23.1/packages/pkg/mod/github.com/crossplane/[email protected]/pkg/schema/traverser/access.go:39 +0x188
github.com/crossplane/upjet/pkg/schema/traverser.(*maxItemsSync).VisitResource(0x0?, 0x14003489c20)
        /Users/ext.rickard.von/.asdf/installs/go/1.23.1/packages/pkg/mod/github.com/crossplane/[email protected]/pkg/schema/traverser/maxitemssync.go:42 +0xb0
github.com/crossplane/upjet/pkg/schema/traverser.(*ResourceNode).Accept(...)
        /Users/ext.rickard.von/.asdf/installs/go/1.23.1/packages/pkg/mod/github.com/crossplane/[email protected]/pkg/schema/traverser/traverse.go:83
github.com/crossplane/upjet/pkg/schema/traverser.traverse(0x14003087af8?, {{0x105fcbe5f, 0x2f}, 0x0, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}}, ...)
        /Users/ext.rickard.von/.asdf/installs/go/1.23.1/packages/pkg/mod/github.com/crossplane/[email protected]/pkg/schema/traverser/traverse.go:116 +0x3d0
github.com/crossplane/upjet/pkg/schema/traverser.Traverse(...)
        /Users/ext.rickard.von/.asdf/installs/go/1.23.1/packages/pkg/mod/github.com/crossplane/[email protected]/pkg/schema/traverser/traverse.go:31
github.com/crossplane/upjet/pkg/schema/traverser.TFResourceSchema.Traverse(0x1062ab820?, {0x14003087e18, 0x1, 0x1})
        /Users/ext.rickard.von/.asdf/installs/go/1.23.1/packages/pkg/mod/github.com/crossplane/[email protected]/pkg/schema/traverser/traverse.go:151 +0xf0
github.com/upbound/provider-gcp/config.GetProvider({0x16d94de1a?, 0x14000162010?}, 0x1)
        /Users/ext.rickard.von/src/provider-upjet-gcp/config/registry.go:147 +0xb0
main.main()
        /Users/ext.rickard.von/src/provider-upjet-gcp/cmd/generator/main.go:36 +0x618
exit status 2
apis/generate.go:26: running "go": exit status 1
12:26:09 [FAIL]
make[1]: *** [go.generate] Error 1
make: *** [generate] Error 2

Crossplane Version

N/A

Provider Version

f90cbe5

Kubernetes Version

N/A

Kubernetes Distribution

N/A

Additional Info

This is required to update some new or updated resources only available in later terraform-provider-google.

@rickard-von-essen rickard-von-essen added bug Something isn't working needs:triage labels Nov 10, 2024
@rickard-von-essen
Copy link
Contributor Author

rickard-von-essen commented Nov 10, 2024

Screenshot 2024-11-10 at 16 36 31
s = nill
k = "sign_in"

@rickard-von-essen
Copy link
Contributor Author

Probably related to the changes in hashicorp/terraform-provider-google#15876

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:triage
Projects
None yet
Development

No branches or pull requests

1 participant