OpenTelemetry missing packages - go

I am getting following error in my Go project. I am using go mod to manage dependencies. It looks like the latest version of opentelemetry doesn't specific packages. But how should I fix them
go get ./...
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/collector/trace/v1
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/collector/metrics/v1
go: finding module for package go.opentelemetry.io/otel/api/label
go: finding module for package go.opentelemetry.io/otel/api/standard
go: finding module for package go.opentelemetry.io/otel/instrumentation/othttp
go: finding module for package go.opentelemetry.io/otel/api/kv
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/trace/v1
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/common/v1
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/resource/v1
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/metrics/v1
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/collector/trace/v1
go: finding module for package go.opentelemetry.io/otel/api/kv
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/collector/metrics/v1
go: finding module for package go.opentelemetry.io/otel/api/standard
go: finding module for package go.opentelemetry.io/otel/instrumentation/othttp
go: finding module for package go.opentelemetry.io/otel/api/label
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/metrics/v1
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/resource/v1
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/common/v1
go: finding module for package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/trace/v1
pkg/tracing/opentelemetry.go:10:2: module go.opentelemetry.io/otel#latest found (v0.13.0), but does not contain package go.opentelemetry.io/otel/api/kv
../go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp#v0.10.0/internal/transform/metric.go:30:2: module go.opentelemetry.io/otel#latest found (v0.13.0), but does not contain package go.opentelemetry.io/otel/api/label
pkg/tracing/opentelemetry.go:12:2: module go.opentelemetry.io/otel#latest found (v0.13.0), but does not contain package go.opentelemetry.io/otel/api/standard
../go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp#v0.10.0/otlp.go:28:2: module go.opentelemetry.io/otel#latest found (v0.13.0), but does not contain package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/collector/metrics/v1
../go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp#v0.10.0/otlp.go:29:2: module go.opentelemetry.io/otel#latest found (v0.13.0), but does not contain package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/collector/trace/v1
../go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp#v0.10.0/internal/transform/attribute.go:18:2: module go.opentelemetry.io/otel#latest found (v0.13.0), but does not contain package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/common/v1
../go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp#v0.10.0/internal/transform/metric.go:27:2: module go.opentelemetry.io/otel#latest found (v0.13.0), but does not contain package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/metrics/v1
../go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp#v0.10.0/internal/transform/metric.go:28:2: module go.opentelemetry.io/otel#latest found (v0.13.0), but does not contain package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/resource/v1
../go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp#v0.10.0/internal/transform/span.go:20:2: module go.opentelemetry.io/otel#latest found (v0.13.0), but does not contain package go.opentelemetry.io/otel/internal/opentelemetry-proto-gen/trace/v1
pkg/home/net/http/fw_handlers.go:11:2: module go.opentelemetry.io/otel#latest found (v0.13.0), but does not contain package go.opentelemetry.io/otel/instrumentation/othttp

I was running into a similar issue and thoroughly cleaning the cache did the trick. Again, I believe this removes all the packages from your system so use with caution:
go clean -cache -modcache -i -r

Related

go verify module failed (how does go sumsdb work?)

I encountered this error on go build:
go: github.com/frankban/quicktest#v1.14.2: verifying module: github.com/frankban/quicktest#v1.14.2: Get "https://sum.golang.org/lookup/github.com/frankban/quicktest#v1.14.2": Not Found
My question is, why the frankban/quicktest is not found in sum db? as a matter of fact this is not the only package that caused this error, last time I try to compile the same project (about an hour ago), the error was on golang.org/x/xerrors.
Further more, could anyone explain (or point out some documents/articles/blogs) on how the go module system's "sums db" work. It is very frustrating if anyone encounter such error as there seems nothing you can do to fix it?
Full log:
$ go get -u
go: downloading github.com/tealeg/xlsx v1.0.5
go: downloading github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6
go: downloading github.com/frankban/quicktest v1.14.2
go: downloading golang.org/x/text v0.3.3
go: downloading github.com/google/btree v1.0.1
go: downloading github.com/kr/pretty v0.3.0
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
go: downloading github.com/kr/text v0.2.0
go: github.com/frankban/quicktest#v1.14.2: verifying module: github.com/frankban/quicktest#v1.14.2: Get "https://sum.golang.org/lookup/github.com/frankban/quicktest#v1.14.2": Not Found
go: github.com/google/btree#v1.0.1: verifying module: github.com/google/btree#v1.0.1: Get "https://sum.golang.org/lookup/github.com/google/btree#v1.0.1": Not Found
go: github.com/kr/pretty#v0.3.0: verifying module: github.com/kr/pretty#v0.3.0: Get "https://sum.golang.org/lookup/github.com/kr/pretty#v0.3.0": Not Found
go: github.com/kr/text#v0.2.0: verifying module: github.com/kr/text#v0.2.0: Get "https://sum.golang.org/lookup/github.com/kr/text#v0.2.0": Not Found
go: github.com/shabbyrobe/xmlwriter#v0.0.0-20220218224045-defe0ad214f6: verifying module: github.com/shabbyrobe/xmlwriter#v0.0.0-20220218224045-defe0ad214f6: Get "https://sum.golang.org/lookup/github.com/shabbyrobe/xmlwriter#v0.0.0-20220218224045-defe0ad214f6": Not Found
The sum.golang.org server needs some time to update the hash sum. Try again now. Everything works correctly for me:
$ GO111MODULE=on go get github.com/shabbyrobe/xmlwriter#v0.0.0-20220218224045-defe0ad214f6
go: downloading github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6
go: downloading golang.org/x/text v0.3.2
$ curl https://sum.golang.org/lookup/github.com/shabbyrobe/xmlwriter#v0.0.0-20220218224045-defe0ad214f6
9249991
github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6 h1:ri617veNyNwEMXywzcLmU//YIVSFdJvdk39lNsFB/Ro=
github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6/go.mod h1:tKYSeHyJGYz7eoZMlzrRDQSfdYPYt0UduMr8b97Mmaw=
go.sum database tree
9690070
OufFSNsOUYeDJ2VPyrxBAe7/d47lQYkE03JZL2ltaI8=
— sum.golang.org Az3grkvrWUkW3Rvnl5QL72oZpiY5ifJhab3/evZCb0hmRkEtGRE/tCMyFDXftZWFi2SF71EuHAxJMTgLd1laHabOzAE=

Installing a Go tool from github and facing installation errors

I want to install this tool from github : https://github.com/ethicalhackingplayground/ssrf-tool
I am using the cmd : go install github.com/ethicalhackingplayground/ssrf-tool#latest
Output :
go: finding module for package github.com/projectdiscovery/gologger
go: finding module for package github.com/briandowns/spinner
go: finding module for package github.com/logrusorgru/aurora
go: found github.com/briandowns/spinner in github.com/briandowns/spinner v1.18.1
go: found github.com/logrusorgru/aurora in github.com/logrusorgru/aurora v2.0.3+incompatible
go: found github.com/projectdiscovery/gologger in github.com/projectdiscovery/gologger v1.1.4
# github.com/ethicalhackingplayground/ssrf-tool
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool#v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:34:2: undefined: gologger.Printf
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool#v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:35:2: undefined: gologger.Infof
..\..\..\go\pkg\mod\github.com\ethicalhackingplayground\ssrf-tool#v0.0.0-20200901082948-7f3cffc3c7bb\ssrftool.go:36:2: undefined: gologger.Infof
I am super new to golang, go installation is fine in my system because other tools from github are working fine.
If some changes are required in the code of this tool, please suggest so.
This sources created without go module support and an old version of gologger, here is a workaround:
Clone repository git clone git#github.com:ethicalhackingplayground/ssrf-tool.git
cd ssrf-tool create go.mod file with content:
module github.com/ethicalhackingplayground/ssrf-tool
go 1.17
require (
github.com/briandowns/spinner v1.18.1
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/projectdiscovery/gologger v1.0.1
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.7.0 // indirect
github.com/mattn/go-colorable v0.1.2 // indirect
github.com/mattn/go-isatty v0.0.8 // indirect
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 // indirect
)
download deps go mod download
Build executable go build .
./ssrf-tool --help
Profit.
Here is the repo with the problem fixed.
go install github.com/R0X4R/ssrf-tool#latest
or
git clone https://github.com/R0X4R/ssrf-tool.git
cd ssrf-tool
go build ssrftool.go && mv ssrftool /usr/bin/

Can't install go modules

I'm trying to follow a tutorial on how to create a Go microservice but I keep getting this errors whenever I run go mod tidy.
$ go mod tidy
go: finding module for package github.com/velotiotech/watermark-service/internal
go: finding module for package github.com/lithammer/shortuuid/v3
go: finding module for package github.com/go-kit/kit/log
go: downloading github.com/go-kit/kit v0.12.0
go: downloading github.com/lithammer/shortuuid/v3 v3.0.7
go: downloading github.com/velotiotech/watermark-service v0.0.0-20200604060255-debbccd8157b
github.com/chococascante/focus-archery-api/pkg imports
github.com/go-kit/kit/log: github.com/go-kit/kit#v0.12.0: verifying module: github.com/go-kit/kit#v0.12.0: initializing sumdb.Client: reading tree note: malformed note
note:
github.com/chococascante/focus-archery-api/pkg imports
github.com/lithammer/shortuuid/v3: github.com/lithammer/shortuuid/v3#v3.0.7: verifying module: github.com/lithammer/shortuuid/v3#v3.0.7: initializing sumdb.Client: reading tree note: malformed note
note:
github.com/chococascante/focus-archery-api/pkg imports
github.com/velotiotech/watermark-service/internal: github.com/velotiotech/watermark-service#v0.0.0-20200604060255-debbccd8157b: verifying module: github.com/velotiotech/watermark-service#v0.0.0-20200604060255-debbccd8157b: initializing sumdb.Client: reading tree note: malformed note
note:
Try disable the integrity check. Or try to change sum.golang.org to proxy.golang.org.
go env -w GOSUMDB=off

replace module failed goland

I'm having a hard time replacing a module within go.
I was trying to clean the cache, go get <PackageName>, explicitly telling the compiler to change the module path etc..
replace github.com/terraform-providers/terraform-provider-aws => github.com/hashicorp/terraform-provider-aws v1.2.3
I was digging online but non of the solutions I saw helped me.
GOROOT=C:\Program Files\Go #gosetup
GOPATH=C:\Users\omer\go #gosetup
"C:\Program Files\Go\bin\go.exe" mod tidy #gosetup
go: finding module for package github.com/hashicorp/terraform-provider-aws
go: finding module for package github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource
go: finding module for package github.com/hashicorp/terraform-plugin-sdk/v2/terraform
go: finding module for package github.com/hashicorp/terraform-plugin-sdk/v2/diag
go: finding module for package golang.org/x/crypto/ssh
go: finding module for package github.com/hashicorp/go-multierror
go: finding module for package github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema
go: finding module for package github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation
go: found github.com/hashicorp/go-multierror in github.com/hashicorp/go-multierror v1.1.1
go: found github.com/hashicorp/terraform-plugin-sdk/v2/diag in github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0
go: found github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema in github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0
go: found github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation in github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0
go: found github.com/ravendb/ravendb-go-client in github.com/ravendb/ravendb-go-client v0.0.0-00010101000000-000000000000
go: found github.com/ravendb/ravendb-go-client/serverwide/operations in github.com/ravendb/ravendb-go-client v0.0.0-00010101000000-000000000000
go: found github.com/ravendb/terraform-provider-ravendb/utils in github.com/ravendb/terraform-provider-ravendb v0.0.0-00010101000000-000000000000
go: found golang.org/x/crypto/ssh in golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
go: found github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource in github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0
go: found github.com/hashicorp/terraform-plugin-sdk/v2/terraform in github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0
go: found github.com/hashicorp/terraform-provider-aws in github.com/hashicorp/terraform-provider-aws v1.60.0
go: terraform-provider-ravendb/ravendb tested by
terraform-provider-ravendb/ravendb.test imports
github.com/hashicorp/terraform-provider-aws: github.com/hashicorp/terraform-provider-aws#v1.60.0: parsing go.mod:
module declares its path as: github.com/terraform-providers/terraform-provider-aws
but was required as: github.com/hashicorp/terraform-provider-aws

Error "go.mod has post-v0 module" when I try "go get google.golang.org/grpc/reflection"

I am trying to add reflection to my working Go-based gRPC. I am getting an error when I try to fetch the reflection package:
$ GO111MODULE=on go get google.golang.org/grpc/reflection
go: github.com/google/go-github#v0.0.0-20190119011113-56cb1dd99043: go.mod has post-v0 module path "github.com/google/go-github/v21" at revision 56cb1dd99043
go: error loading module requirements
I can't find any reference to "go-github/v21" anywhere in my source, or in any of the packages in my GOPATH.
I also can't figure out what this error message means.
I am using Go version go1.11.5.
Thanks.

Resources