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

go get gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer Fails #1227

Closed
nithin-kumar opened this issue Mar 30, 2022 · 6 comments
Closed

go get gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer Fails #1227

nithin-kumar opened this issue Mar 30, 2022 · 6 comments
Assignees
Labels

Comments

@nithin-kumar
Copy link

nithin-kumar commented Mar 30, 2022

`[builder 8/11] RUN go get gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer:

#14 153.2 # gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer

#14 153.2 /go/src/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/stats.go:294:33: cannot use msg (type *sketchpb.DDSketch) as type protoreflect.ProtoMessage in argument to "google.golang.org/protobuf/proto".Marshal:
#14 153.2 *sketchpb.DDSketch does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
#14 153.2 /go/src/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/stats.go:299:34: cannot use msg (type *sketchpb.DDSketch) as type protoreflect.ProtoMessage in argument to "google.golang.org/protobuf/proto".Marshal:
#14 153.2 *sketchpb.DDSketch does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
executor failed running [/bin/sh -c go get gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer]: exit code: 2`

Golang Image : golang:1.15-alpine

@felixge felixge added bug unintended behavior that has to be fixed ack labels Mar 30, 2022
@felixge
Copy link
Member

felixge commented Mar 30, 2022

Thanks for submitting this issue. I'm able to reproduce it like this:

$ docker run -it --rm golang:1.15-alpine
$ apk add git
$ go get gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer
# gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer
src/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/stats.go:294:33: cannot use msg (type *sketchpb.DDSketch) as type protoreflect.ProtoMessage in argument to "google.golang.org/protobuf/proto".Marshal:
	*sketchpb.DDSketch does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
src/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/stats.go:299:34: cannot use msg (type *sketchpb.DDSketch) as type protoreflect.ProtoMessage in argument to "google.golang.org/protobuf/proto".Marshal:
	*sketchpb.DDSketch does not implement protoreflect.ProtoMessage (missing ProtoReflect method)

Additionally I checked:

  • golang:1.15 docker: Same issue.
  • golang:1.16-alpine docker: No issue.
  • go1.15 on macOS: No issue.

So this seems to be specific to go1.15 on linux.

@knusbaum assigning this to you for taking a closer look since you're on escalation rotation this week.

@gbooth27
Copy link

gbooth27 commented Apr 1, 2022

I am also seeing this issue with go 1.18 on a mac after upgrading from go 1.14

@gbbr
Copy link
Contributor

gbbr commented Apr 4, 2022

I suspect this was caused by #1188

@nsrip-dd
Copy link
Contributor

nsrip-dd commented Apr 4, 2022

I think this is a GOPATH mode vs module-aware mode issue. In GOPATH mode (the default for golang:1.15) running go get downloads the latest version of this library and of all of its dependencies directly from version control, ignoring all of the version information in the go.mod file. The github.com/DataDog/sketches-go package recently regenerated their protobuf bindings (leading to the error mentioned in this issue. This could be a breaking change in the future and there's already a PR to fix it). But you won't see this error running in module-aware mode since the correct version of sketches-go is used rather than the latest commit.

@nsrip-dd nsrip-dd removed the bug unintended behavior that has to be fixed label Apr 6, 2022
@nsrip-dd
Copy link
Contributor

nsrip-dd commented Apr 6, 2022

The previously mentioned PR has been merged and this works now.

@nsrip-dd nsrip-dd closed this as completed Apr 6, 2022
@nithin-kumar
Copy link
Author

Thanks @felixge @gbbr @gbooth27 @nsrip-dd for the quick resolution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants