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

Cannot build the project #713

Closed
susanhuhu opened this issue Apr 1, 2020 · 3 comments
Closed

Cannot build the project #713

susanhuhu opened this issue Apr 1, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@susanhuhu
Copy link

susanhuhu commented Apr 1, 2020

A clear and concise description of what the bug is.

Expected Behavior

run 'make build', it should succeed

Actual Behavior

Got below error

root@vm-laptopnew:/home/susan/go/src/github.com/keda# make build
WARNING: GOROOT is not defined
GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 operator-sdk generate k8s
INFO[0000] Running deepcopy code-generation for Custom Resource group versions: [keda:[v1alpha1], ] 
F0331 20:53:43.804973   26835 deepcopy.go:885] Hit an unsupported type invalid type for invalid type, from ./pkg/apis/keda/v1alpha1.ScaledObject
goroutine 1 [running]:
k8s.io/klog.stacks(0xc00089f700, 0xc0006745a0, 0x91, 0xe1)
	/home/joe/go/pkg/mod/k8s.io/klog@v0.3.3/klog.go:855 +0xb8
k8s.io/klog.(*loggingT).output(0x335c940, 0xc000000003, 0xc0008ac2a0, 0x3146640, 0xb, 0x375, 0x0)
	/home/joe/go/pkg/mod/k8s.io/klog@v0.3.3/klog.go:806 +0x351
k8s.io/klog.(*loggingT).printf(0x335c940, 0x3, 0x1ee9b04, 0x2a, 0xc00062ced8, 0x3, 0x3)
	/home/joe/go/pkg/mod/k8s.io/klog@v0.3.3/klog.go:705 +0x14b
k8s.io/klog.Fatalf(...)
	/home/joe/go/pkg/mod/k8s.io/klog@v0.3.3/klog.go:1256
k8s.io/gengo/examples/deepcopy-gen/generators.(*genDeepCopy).doStruct(0xc0007ea600, 0xc0000eeb00, 0xc00027ae60)
	/home/joe/go/pkg/mod/k8s.io/gengo@v0.0.0-20191010091904-7fa3014cb28f/examples/deepcopy-gen/generators/deepcopy.go:885 +0x7bd
k8s.io/gengo/examples/deepcopy-gen/generators.(*genDeepCopy).generateFor(0xc0007ea600, 0xc0000eeb00, 0xc00027ae60)
	/home/joe/go/pkg/mod/k8s.io/gengo@v0.0.0-20191010091904-7fa3014cb28f/examples/deepcopy-gen/generators/deepcopy.go:695 +0xc5
k8s.io/gengo/examples/deepcopy-gen/generators.(*genDeepCopy).GenerateType(0xc0007ea600, 0xc0008ac230, 0xc0000eeb00, 0x21b7320, 0xc000587760, 0x0, 0x0)
	/home/joe/go/pkg/mod/k8s.io/gengo@v0.0.0-20191010091904-7fa3014cb28f/examples/deepcopy-gen/generators/deepcopy.go:608 +0xe98
k8s.io/gengo/generator.(*Context).executeBody(0xc0008ac230, 0x21b42a0, 0xc0005421b0, 0x222f9c0, 0xc0007ea600, 0x60, 0xc00062d288)
	/home/joe/go/pkg/mod/k8s.io/gengo@v0.0.0-20191010091904-7fa3014cb28f/generator/execute.go:306 +0x11c
k8s.io/gengo/generator.(*Context).ExecutePackage(0xc0008ac0e0, 0x0, 0x0, 0x2216ba0, 0xc0001319e0, 0x0, 0x0)
	/home/joe/go/pkg/mod/k8s.io/gengo@v0.0.0-20191010091904-7fa3014cb28f/generator/execute.go:267 +0xb25
k8s.io/gengo/generator.(*Context).ExecutePackages(0xc0008ac0e0, 0x0, 0x0, 0xc000781220, 0x1, 0x1, 0x0, 0x30)
	/home/joe/go/pkg/mod/k8s.io/gengo@v0.0.0-20191010091904-7fa3014cb28f/generator/execute.go:51 +0xbf
k8s.io/gengo/args.(*GeneratorArgs).Execute(0xc0003f5f40, 0xc00062d7b0, 0x1e886d7, 0x6, 0x1f94440, 0xc00041f8e0, 0x18)
	/home/joe/go/pkg/mod/k8s.io/gengo@v0.0.0-20191010091904-7fa3014cb28f/args/args.go:207 +0x1eb
github.com/operator-framework/operator-sdk/cmd/operator-sdk/internal/genutil.deepcopyGen(0xc000444d80, 0xe, 0xc000740ac0, 0x1, 0x1, 0x0, 0xc0000ca428)
	/home/joe/projects/work/operator-framework/operator-sdk/cmd/operator-sdk/internal/genutil/k8s.go:95 +0x4d9
github.com/operator-framework/operator-sdk/cmd/operator-sdk/internal/genutil.K8sCodegen.func1(0xc000444d80, 0xe, 0x0, 0x0)
	/home/joe/projects/work/operator-framework/operator-sdk/cmd/operator-sdk/internal/genutil/k8s.go:54 +0x50
github.com/operator-framework/operator-sdk/cmd/operator-sdk/internal/genutil.generateWithHeaderFile(0xc00062dc00, 0x0, 0x0)
	/home/joe/projects/work/operator-framework/operator-sdk/cmd/operator-sdk/internal/genutil/genutil.go:46 +0x175
github.com/operator-framework/operator-sdk/cmd/operator-sdk/internal/genutil.K8sCodegen(0xc00036f400, 0x0)
	/home/joe/projects/work/operator-framework/operator-sdk/cmd/operator-sdk/internal/genutil/k8s.go:55 +0x48d
github.com/operator-framework/operator-sdk/cmd/operator-sdk/generate.k8sFunc(0xc00036f400, 0x33841d8, 0x0, 0x0, 0x0, 0x0)
	/home/joe/projects/work/operator-framework/operator-sdk/cmd/operator-sdk/generate/k8s.go:56 +0x64
github.com/spf13/cobra.(*Command).execute(0xc00036f400, 0x33841d8, 0x0, 0x0, 0xc00036f400, 0x33841d8)
	/home/joe/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:826 +0x460
github.com/spf13/cobra.(*Command).ExecuteC(0xc000182c80, 0x21b8d40, 0xc0003da500, 0x0)
	/home/joe/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
	/home/joe/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
main.main()
	/home/joe/projects/work/operator-framework/operator-sdk/cmd/operator-sdk/main.go:84 +0x584
Makefile:95: recipe for target 'generate-api' failed
make: *** [generate-api] Error 255

Steps to Reproduce the Problem

  1. install v0.12.0
  2. go to Keda folder and run 'make build'

Specifications

  • KEDA Version: Latest from master branch
  • Platform & Version: Ubuntu 18.4.3
  • Kubernetes Version: v1.14.1
  • Scaler(s): Noe
@susanhuhu susanhuhu added the bug Something isn't working label Apr 1, 2020
@susanhuhu
Copy link
Author

This is fixed after explicility set GOPATH and GOROOT env in the build window. It doesn't help if only go env shows it.

@tomkerkhove
Copy link
Member

Feel free to PR a doc improvement if you think it's required!

@tomkerkhove
Copy link
Member

Happy to hear that it's fixed

SpiritZhou pushed a commit to SpiritZhou/keda that referenced this issue Jul 18, 2023
Signed-off-by: Ram Cohen <ram.cohen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants