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

FATA[0000] Failed to build operator binary: failed to exec []string #6198

Closed
KailashPatilKP opened this issue Nov 23, 2022 · 6 comments
Closed
Labels
language/go Issue is related to a Go operator project lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. triage/support Indicates an issue that is a support question.
Milestone

Comments

@KailashPatilKP
Copy link

Bug Report

What did you do?

I'm trying to execute the command (docker push <DOCKER_REGISTRY_URL>/<USER_NAME>/siddhi-operator:) but it's failing with below error.

`panic: modindex.GetPackage called with empty modroot

goroutine 19 [running]:
cmd/go/internal/modindex.GetModule({0x0, 0x0})
/usr/local/Cellar/go/1.19.3/libexec/src/cmd/go/internal/modindex/read.go:157 +0x125
cmd/go/internal/modindex.GetPackage({0x0, 0x0}, {0xc0000ee680, 0x7e})
/usr/local/Cellar/go/1.19.3/libexec/src/cmd/go/internal/modindex/read.go:135 +0x31
cmd/go/internal/modload.scanDir({0x0?, 0x7e?}, {0xc0000ee680, 0x7e}, 0x0?)
/usr/local/Cellar/go/1.19.3/libexec/src/cmd/go/internal/modload/load.go:2105 +0x4b
cmd/go/internal/modload.(*loader).load(0xc000155380, {0x172f930, 0xc0000b2000}, 0xc000155520)
/usr/local/Cellar/go/1.19.3/libexec/src/cmd/go/internal/modload/load.go:1734 +0x35f
cmd/go/internal/modload.(*loader).pkg.func1.1()
/usr/local/Cellar/go/1.19.3/libexec/src/cmd/go/internal/modload/load.go:1517 +0x29
cmd/go/internal/par.(*Queue).Add.func1()
/usr/local/Cellar/go/1.19.3/libexec/src/cmd/go/internal/par/queue.go:58 +0x7d
created by cmd/go/internal/par.(*Queue).Add
/usr/local/Cellar/go/1.19.3/libexec/src/cmd/go/internal/par/queue.go:56 +0x225
FATA[0000] Failed to build operator binary: failed to exec []string{"go", "build", "-o", "/Users/kailash.patil/Downloads/operator-sdk-v0.19.0/operator-sdk/vendor/github.com/siddhi-io/siddhi-operator/build/_output/bin/siddhi-operator", "-gcflags", "all=-trimpath=/Users/kailash.patil/Downloads/operator-sdk-v0.19.0/operator-sdk/vendor/github.com/siddhi-io", "-asmflags", "all=-trimpath=/Users/kailash.patil/Downloads/operator-sdk-v0.19.0/operator-sdk/vendor/github.com/siddhi-io", "-mod=vendor", "Users/kailash.patil/Downloads/operator-sdk-v0.19.0/operator-sdk/vendor/github.com/siddhi-io/siddhi-operator/cmd/manager"}: exit status 2 `

What did you expect to see?

Command executed successfully and image is created.

What did you see instead? Under which circumstances?

Encountered issue while executing the command.

Environment

Operator type:

/language go

Kubernetes cluster type:

docker-desktop

$ operator-sdk version

operator-sdk version: "v0.19.0", commit: "8e28aca60994c5cb1aec0251b85f0116cc4c9427", kubernetes version: "v1.18.2", go version: "go1.13.10 darwin/amd64"

$ go version (if language is Go)

go version go1.19.3 darwin/amd64

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6", GitCommit:"dff82dc0de47299ab66c83c626e08b245ab19037", GitTreeState:"clean", BuildDate:"2020-07-15T16:58:53Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"darwin/amd64"}

Possible Solution

Additional context

@openshift-ci openshift-ci bot added the language/go Issue is related to a Go operator project label Nov 23, 2022
@everettraven
Copy link
Contributor

@KailashPatilKP do you have to use Operator SDK version v0.19.0? That is a version we no longer support and I would highly recommend trying to upgrade and use the latest release of Operator SDK which is version v1.25.2.

If you absolutely need to use Operator SDK version v0.19.0 it seems like this is related to using a Go version that wasn't intended to be used when building it from source. From the version information it seems to me that Operator SDK v0.19.0 is intended to be built with Go v1.13, but it appears you are attempting to build it with Go v1.19. My recommendation would be to try building the binary with Go v1.13 and see if that works.

I hope this helps!

@varshaprasad96
Copy link
Member

Additionally, I would also highly recommend to either scaffold the project in the GOPATH or activate module support. This error usually happens in Go when it assumes that the package is outside a module (https://cs.opensource.google/go/go/+/refs/tags/go1.19.3:src/cmd/go/internal/modindex/read.go;l=157). However, maintaining the supported SDK+Go version compatibility will be helpful to avoid any unexpected errors.

@varshaprasad96 varshaprasad96 added the triage/support Indicates an issue that is a support question. label Nov 28, 2022
@varshaprasad96 varshaprasad96 added this to the Backlog milestone Nov 28, 2022
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 27, 2023
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 29, 2023
@openshift-bot
Copy link

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci
Copy link

openshift-ci bot commented Apr 29, 2023

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot closed this as completed Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/go Issue is related to a Go operator project lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. triage/support Indicates an issue that is a support question.
Projects
None yet
Development

No branches or pull requests

4 participants