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

Panic detected while running "make docker-build" on Spoke cluster as according to README.md #30

Open
leodahal4 opened this issue May 19, 2024 · 2 comments
Assignees

Comments

@leodahal4
Copy link

leodahal4 commented May 19, 2024

I tried couple of times to setup this on my kind cluster, but everytime I tried to setup, I am getting error on running the command

make docker-build

the error is as below,

./hack/update-codegen.sh
Generating deepcopy funcs
Generating clientset at sigs.k8s.io/work-api/pkg/client/clientset
Generating listers at sigs.k8s.io/work-api/pkg/client/listers
Generating informers at sigs.k8s.io/work-api/pkg/client/informers
Generating register at sigs.k8s.io/work-api/pkg/apis/v1alpha1
go run sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=./hack/boilerplate.go.txt paths="./..."
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9edeaf]

goroutine 131 [running]:
go/types.(*Checker).handleBailout(0xc000fb8a00, 0xc0007a7d40)
	/usr/lib/go/src/go/types/check.go:367 +0x88
panic({0xb993e0?, 0x1259ae0?})
	/usr/lib/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xd84028, 0x1262380})
	/usr/lib/go/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
	/usr/lib/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0xd84028?, 0x1262380?})
	/usr/lib/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0xd8a480, 0x122e440}, 0xc000fb8a00, 0x1262380, 0x0)
	/usr/lib/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).arrayLength(0xc000fb8a00, {0xd886e0, 0xc000716b40?})
	/usr/lib/go/src/go/types/typexpr.go:510 +0x2d3
go/types.(*Checker).typInternal(0xc000fb8a00, {0xd86d90, 0xc00071a5d0}, 0x0)
	/usr/lib/go/src/go/types/typexpr.go:299 +0x49d
go/types.(*Checker).definedType(0xc000fb8a00, {0xd86d90, 0xc00071a5d0}, 0xc0007a7328?)
	/usr/lib/go/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).varType(0xc000fb8a00, {0xd86d90, 0xc00071a5d0})
	/usr/lib/go/src/go/types/typexpr.go:145 +0x25
go/types.(*Checker).structType(0xc000fb8a00, 0xc0013001e0, 0xc0013001e0?)
	/usr/lib/go/src/go/types/struct.go:113 +0x19f
go/types.(*Checker).typInternal(0xc000fb8a00, {0xd86d00, 0xc0012a13f8}, 0xc00037c2d0)
	/usr/lib/go/src/go/types/typexpr.go:316 +0x1345
go/types.(*Checker).definedType(0xc000fb8a00, {0xd86d00, 0xc0012a13f8}, 0xc5f74e?)
	/usr/lib/go/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).typeDecl(0xc000fb8a00, 0xc00037c2d0, 0xc0007247c0, 0x0)
	/usr/lib/go/src/go/types/decl.go:615 +0x44d
go/types.(*Checker).objDecl(0xc000fb8a00, {0xd8f8c0, 0xc00037c2d0}, 0x0)
	/usr/lib/go/src/go/types/decl.go:197 +0xa7f
go/types.(*Checker).packageObjects(0xc000fb8a00)
	/usr/lib/go/src/go/types/resolver.go:681 +0x425
go/types.(*Checker).checkFiles(0xc000fb8a00, {0xc0017b2930, 0x3, 0x3})
	/usr/lib/go/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
	/usr/lib/go/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc0002bee10, 0xc000c1b3e0)
	/home/mousam/go/pkg/mod/sigs.k8s.io/controller-tools@v0.5.0/pkg/loader/loader.go:283 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc000c1b3e0)
	/home/mousam/go/pkg/mod/sigs.k8s.io/controller-tools@v0.5.0/pkg/loader/loader.go:96 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc000e3ed80, 0xc000c1b3e0)
	/home/mousam/go/pkg/mod/sigs.k8s.io/controller-tools@v0.5.0/pkg/loader/refs.go:263 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x0?)
	/home/mousam/go/pkg/mod/sigs.k8s.io/controller-tools@v0.5.0/pkg/loader/refs.go:257 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 51
	/home/mousam/go/pkg/mod/sigs.k8s.io/controller-tools@v0.5.0/pkg/loader/refs.go:255 +0x1c5
exit status 2
make: *** [Makefile:62: generate] Error 1

Following are the versions which I am currently using,

kind version 0.22.0

Docker version 26.1.3, build b72abbb6f0

kubectl:
Client Version: v1.30.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.2

go version go1.22.3 linux/amd64
GNU Make 4.4.1

But while manually running,
docker build . -t work-api-controller:latest
the image gets created.

Can anyone guide me for mitigating this error? Any help will be greatly appreciated.

@RainbowMango
Copy link
Member

Let me take a look.

@RainbowMango
Copy link
Member

I can reproduce it with Go1.22.3 and can not with Go 1.21.8. That is probably due to this issue: kubernetes-sigs/controller-tools#888.

I guess we can bump controller-gen to v0.14.0+ to resolve it.
/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants