Giter VIP home page Giter VIP logo

Comments (3)

iaincalderfh avatar iaincalderfh commented on May 20, 2024

I get the same error when running make generate

from operator-sdk.

ggallen avatar ggallen commented on May 20, 2024

I've tracked it down to this command:

[gallen@gallen-thinkpadp1gen5 memcached-operator]$ /home/gallen/work/tutorial/memcached-operator/bin/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=0xa0a20f]

goroutine 209 [running]:
go/types.(*Checker).handleBailout(0xc001902800, 0xc000a35d40)
	/usr/local/go/src/go/types/check.go:367 +0x88
panic({0xbc29e0?, 0x12a94e0?})
	/usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xdbd6b8, 0x12b1ce0})
	/usr/local/go/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
	/usr/local/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0xdbd6b8?, 0x12b1ce0?})
	/usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0xdc3a10, 0x127cc60}, 0xc001902800, 0x12b1ce0, 0x0)
	/usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).arrayLength(0xc001902800, {0xdc1cb8, 0xc000d71160?})
	/usr/local/go/src/go/types/typexpr.go:510 +0x2d3
go/types.(*Checker).typInternal(0xc001902800, {0xdc02d8, 0xc0019101e0}, 0x0)
	/usr/local/go/src/go/types/typexpr.go:299 +0x49d
go/types.(*Checker).definedType(0xc001902800, {0xdc02d8, 0xc0019101e0}, 0x10?)
	/usr/local/go/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).varType(0xc001902800, {0xdc02d8, 0xc0019101e0})
	/usr/local/go/src/go/types/typexpr.go:145 +0x25
go/types.(*Checker).structType(0xc001902800, 0xc00191d860, 0xc00191d860?)
	/usr/local/go/src/go/types/struct.go:113 +0x19f
go/types.(*Checker).typInternal(0xc001902800, {0xdc0248, 0xc0019005d0}, 0xc001921cc0)
	/usr/local/go/src/go/types/typexpr.go:316 +0x1345
go/types.(*Checker).definedType(0xc001902800, {0xdc0248, 0xc0019005d0}, 0xc8bf2e?)
	/usr/local/go/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).typeDecl(0xc001902800, 0xc001921cc0, 0xc000d6d640, 0x0)
	/usr/local/go/src/go/types/decl.go:615 +0x44d
go/types.(*Checker).objDecl(0xc001902800, {0xdc8f60, 0xc001921cc0}, 0x0)
	/usr/local/go/src/go/types/decl.go:197 +0xa7f
go/types.(*Checker).packageObjects(0xc001902800)
	/usr/local/go/src/go/types/resolver.go:681 +0x425
go/types.(*Checker).checkFiles(0xc001902800, {0xc000ab1458, 0x3, 0x3})
	/usr/local/go/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
	/usr/local/go/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc0002a7380, 0xc0008ea3c0)
	/home/gallen/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/loader.go:286 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc0008ea3c0)
	/home/gallen/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/loader.go:99 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc00024c6f0, 0xc0008ea3c0)
	/home/gallen/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:268 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x49?)
	/home/gallen/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:262 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 145
	/home/gallen/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:260 +0x1c5
[gallen@gallen-thinkpadp1gen5 memcached-operator]$ 

from operator-sdk.

ggallen avatar ggallen commented on May 20, 2024

OK, I made the incorrect assumption the go version wasn't that important. And a later go version would probably work just fine.

I was using go 1.22, when the instructions clearly say to use go 1.21.

Thanks to @joelanford for pointing this out. Once I downgraded to 1.21 the command works.

from operator-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.