Search code examples
gorhelrhel7opaopen-policy-agent

Cannot load github.com/open-policy-agent/opa/capabilities: no Go source files


I was trying to install the OPA library using command go get github.com/open-policy-agent/opa/rego

but installation is getting stuck with message

build github.com/open-policy-agent/opa/capabilities: cannot load github.com/open-policy-agent/opa/capabilities: no Go source files

Below is the o/p of command:

-bash-4.2$ go get github.com/open-policy-agent/opa/rego
go: finding github.com/open-policy-agent/opa/rego latest
go: finding github.com/open-policy-agent/opa v0.53.1
go: downloading github.com/open-policy-agent/opa v0.53.1
go: extracting github.com/open-policy-agent/opa v0.53.1
go: downloading github.com/gorilla/mux v1.8.0
go: downloading github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
go: downloading github.com/sirupsen/logrus v1.9.2
go: downloading github.com/go-ini/ini v1.67.0
go: downloading go.opentelemetry.io/otel v1.14.0
go: extracting github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
go: downloading github.com/prometheus/client_golang v1.15.1
go: downloading github.com/OneOfOne/xxhash v1.2.8
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/gobwas/glob v0.2.3
go: extracting github.com/gorilla/mux v1.8.0
go: downloading github.com/tchap/go-patricia v2.2.6+incompatible
go: extracting github.com/prometheus/client_golang v1.15.1
go: extracting gopkg.in/yaml.v2 v2.4.0
go: extracting github.com/sirupsen/logrus v1.9.2
go: extracting github.com/OneOfOne/xxhash v1.2.8
go: extracting go.opentelemetry.io/otel v1.14.0
go: extracting github.com/tchap/go-patricia v2.2.6+incompatible
go: extracting github.com/go-ini/ini v1.67.0
go: downloading github.com/yashtewari/glob-intersection v0.1.0
go: downloading github.com/tchap/go-patricia/v2 v2.3.1
go: downloading github.com/ghodss/yaml v1.0.0
go: downloading github.com/agnivade/levenshtein v1.1.1
go: extracting github.com/tchap/go-patricia/v2 v2.3.1
go: downloading github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
go: extracting github.com/yashtewari/glob-intersection v0.1.0
go: extracting github.com/ghodss/yaml v1.0.0
go: extracting github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
go: extracting github.com/gobwas/glob v0.2.3
go: downloading github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb
go: downloading golang.org/x/sys v0.8.0
go: extracting github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb
go: extracting golang.org/x/sys v0.8.0
go: downloading google.golang.org/protobuf v1.30.0
go: downloading github.com/prometheus/client_model v0.3.0
go: downloading github.com/prometheus/common v0.42.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash v1.1.0
go: extracting github.com/agnivade/levenshtein v1.1.1
go: extracting github.com/prometheus/common v0.42.0
go: extracting github.com/beorn7/perks v1.0.1
go: extracting github.com/prometheus/client_model v0.3.0
go: extracting github.com/cespare/xxhash v1.1.0
go: downloading github.com/prometheus/procfs v0.9.0
go: downloading github.com/cespare/xxhash/v2 v2.2.0
go: extracting google.golang.org/protobuf v1.30.0
go: downloading github.com/golang/protobuf v1.5.3
go: extracting github.com/cespare/xxhash/v2 v2.2.0
go: extracting github.com/golang/protobuf v1.5.3
go: extracting github.com/prometheus/procfs v0.9.0
go: downloading go.opentelemetry.io/otel/sdk v1.14.0
go: extracting go.opentelemetry.io/otel/sdk v1.14.0
go: downloading github.com/go-logr/logr v1.2.4
go: extracting github.com/go-logr/logr v1.2.4
go: downloading github.com/go-logr/stdr v1.2.2
go: extracting github.com/go-logr/stdr v1.2.2
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.4
go: extracting github.com/matttproud/golang_protobuf_extensions v1.0.4
go: downloading go.opentelemetry.io/otel/trace v1.14.0
go: extracting go.opentelemetry.io/otel/trace v1.14.0
go: finding github.com/OneOfOne/xxhash v1.2.8
build github.com/open-policy-agent/opa/capabilities: cannot load github.com/open-policy-agent/opa/capabilities: no Go source files

Is there any pre-requisite before installation of OPA? or am I missing something during installation?

-bash-4.2$ uname -a
Linux dev-rh72-tas-1.in.intinfra.com 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux

Solution

  • Your Go version is outdated since several years. Opa requires at least Go 1.16