Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

errors when go get'ing library #184

Closed
Dieterbe opened this issue Aug 7, 2017 · 15 comments
Closed

errors when go get'ing library #184

Dieterbe opened this issue Aug 7, 2017 · 15 comments

Comments

@Dieterbe
Copy link
Contributor

Dieterbe commented Aug 7, 2017

~ ❯❯❯ go version                                                                                                                                                                             ⏎
go version go1.8.3 linux/amd64
~ ❯❯❯ go get -u github.com/uber/jaeger-client-go/
# github.com/uber/jaeger-client-go/thrift-gen/jaeger
go/src/github.com/uber/jaeger-client-go/thrift-gen/jaeger/agent.go:101: cannot use agentProcessorEmitBatch literal (type *agentProcessorEmitBatch) as type thrift.TProcessorFunction in assignment:
	*agentProcessorEmitBatch does not implement thrift.TProcessorFunction (wrong type for Process method)
		have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
		want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
go/src/github.com/uber/jaeger-client-go/thrift-gen/jaeger/agent.go:111: not enough arguments in call to processor.Process
	have (int32, thrift.TProtocol, thrift.TProtocol)
	want (context.Context, int32, thrift.TProtocol, thrift.TProtocol)
# github.com/uber/jaeger-client-go/thrift-gen/sampling
go/src/github.com/uber/jaeger-client-go/thrift-gen/sampling/samplingmanager.go:147: cannot use samplingManagerProcessorGetSamplingStrategy literal (type *samplingManagerProcessorGetSamplingStrategy) as type thrift.TProcessorFunction in assignment:
	*samplingManagerProcessorGetSamplingStrategy does not implement thrift.TProcessorFunction (wrong type for Process method)
		have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
		want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
go/src/github.com/uber/jaeger-client-go/thrift-gen/sampling/samplingmanager.go:157: not enough arguments in call to processor.Process
	have (int32, thrift.TProtocol, thrift.TProtocol)
	want (context.Context, int32, thrift.TProtocol, thrift.TProtocol)
# github.com/uber/jaeger-client-go/thrift-gen/zipkincore
go/src/github.com/uber/jaeger-client-go/thrift-gen/zipkincore/zipkincollector.go:147: cannot use zipkinCollectorProcessorSubmitZipkinBatch literal (type *zipkinCollectorProcessorSubmitZipkinBatch) as type thrift.TProcessorFunction in assignment:
	*zipkinCollectorProcessorSubmitZipkinBatch does not implement thrift.TProcessorFunction (wrong type for Process method)
		have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
		want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
go/src/github.com/uber/jaeger-client-go/thrift-gen/zipkincore/zipkincollector.go:157: not enough arguments in call to processor.Process
	have (int32, thrift.TProtocol, thrift.TProtocol)
	want (context.Context, int32, thrift.TProtocol, thrift.TProtocol)
@Dieterbe
Copy link
Contributor Author

Dieterbe commented Aug 7, 2017

maybe this is expected?
i stumbled upon the contributing instructions at https://github.com/uber/jaeger-client-go/blob/master/CONTRIBUTING.md which seem to indicate building may not work correctly if the correct glide commands have not been run.

so my suggestion is to clarify in the README.md, at the top, how this library should be installed and used.
thanks!

@yurishkuro
Copy link
Member

Yes, due to a recent upstream breaking change in thrift the go get doesn't work anymore.

Would you like to put a PR with how you suggest to update the README to make it clear?

Dieterbe added a commit to Dieterbe/jaeger-client-go that referenced this issue Aug 7, 2017
@trtg
Copy link

trtg commented Aug 15, 2017

I have a project that is making use of jaeger-client-go and I was seeing this error when I attempted a go get. glide install resolved that. but now I can no longer build a project that was working perfectly well until now as seen in the error message below. My code directly used the tracer initialization example code and worked perfectly. What has changed recently to break this? Am I just not fully understanding the implications of that breaking thrift change?

./main.go:135: cannot use jMetricsFactory (type "github.com/uber/jaeger-lib/metrics".Factory) as type "github.com/uber/jaeger-client-go/vendor/github.com/uber/jaeger-lib/metrics".Factory in argument to "github.com/uber/jaeger-client-go/config".Metrics: "github.com/uber/jaeger-lib/metrics".Factory does not implement "github.com/uber/jaeger-client-go/vendor/github.com/uber/jaeger-lib/metrics".Factory (wrong type for Counter method) have Counter(string, map[string]string) "github.com/uber/jaeger-lib/metrics".Counter want Counter(string, map[string]string) "github.com/uber/jaeger-client-go/vendor/github.com/uber/jaeger-lib/metrics".Counter

this is the initialization code it's complaining about:
jLogger := jaegerlog.StdLogger jMetricsFactory := jaegermetrics.NullFactory // Initialize tracer with a logger and a metrics factory closer, err := cfg.InitGlobalTracer( "rtb_proxy", jaegercfg.Logger(jLogger), jaegercfg.Metrics(jMetricsFactory), ) if err != nil { log.Printf("Could not initialize jaeger tracer: %s", err.Error()) return } defer closer.Close()
and specifically the line it complained about:
jaegercfg.Metrics(jMetricsFactory),

I'm assuming that I need to propagate the right vendoring everywhere, but I'm not really clear on how to do that. How do I import metrics in such a way to avoid this issue? If i just change the import to be:

jaegermetrics "github.com/uber/jaeger-client-go/vendor/github.com/uber/jaeger-lib/metrics"

I instead get "use of vendored package not allowed"

@yurishkuro
Copy link
Member

yes, you're getting conflicts between vendored and not-vendored code.

Are you using glide for the rest of your project or just to get jaeger-client-go? If you use vendoring, then both jaeger-client-go and jaeger-lib should be vendored at the same top level, independently. Plus, you should not have nested vendor dirs: vendor/github.com/uber/jaeger-client-go/vendor

@trtg
Copy link

trtg commented Aug 15, 2017

My project does not use vendoring, I only ran glide install on jaeger-client-go so it wouldn't throw all the thrift errors from this issue. Doing that however seems to create expectations of everything being vendored. Is there any way I can get this to work without having to use glide in my own project?

Basically, I hadn't run a go get since I originally cloned jaeger a long time ago. I finally had the branch of my project where I added jaeger tracing run through travis. travis does a go get as its first step, which caused me to hit the thrift issue and now this is where I'm at.

All of our other dependencies have either been developed in house or forked and brought in house, so we previously had no need for glide (and adding it would slow down both our CI and deploy processes, just for one dependency).

@yurishkuro
Copy link
Member

According to #177 (comment), you may not need to do glide install inside jaeger-client-go if you pin thrift in your go-path to 0.10 sha.

@tsuna
Copy link

tsuna commented Dec 11, 2017

Any plans to catch up with upstream Thrift code? It's been 5 months now...

@yurishkuro
Copy link
Member

The new 0.11 version has just been released and it contains breaking changes. We need to vet the new release and also figure out how much pain it's going to be for our users to upgrade.

@montera82
Copy link
Contributor

whatsup with this?
following your tutorial here and tried below..still same error

 > go get github.com/uber/jaeger-client-go

# github.com/uber/jaeger-client-go/thrift-gen/jaeger
../github.com/uber/jaeger-client-go/thrift-gen/jaeger/agent.go:101:34: cannot use agentProcessorEmitBatch literal (type *agentProcessorEmitBatch) as type thrift.TProcessorFunction in assignment:
        *agentProcessorEmitBatch does not implement thrift.TProcessorFunction (wrong type for Process method)
                have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
                want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
../github.com/uber/jaeger-client-go/thrift-gen/jaeger/agent.go:111:27: not enough arguments in call to processor.Process
        have (int32, thrift.TProtocol, thrift.TProtocol)
        want (context.Context, int32, thrift.TProtocol, thrift.TProtocol)
# github.com/uber/jaeger-client-go/thrift-gen/sampling
../github.com/uber/jaeger-client-go/thrift-gen/sampling/samplingmanager.go:101:15: cannot assign 1 values to 2 variables
../github.com/uber/jaeger-client-go/thrift-gen/sampling/samplingmanager.go:147:44: cannot use samplingManagerProcessorGetSamplingStrategy literal (type *samplingManagerProcessorGetSamplingStrategy) as type thrift.TProcessorFunction in assignment:
        *samplingManagerProcessorGetSamplingStrategy does not implement thrift.TProcessorFunction (wrong type for Process method)
                have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
                want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
../github.com/uber/jaeger-client-go/thrift-gen/sampling/samplingmanager.go:157:27: not enough arguments in call to processor.Process
        have (int32, thrift.TProtocol, thrift.TProtocol)
        want (context.Context, int32, thrift.TProtocol, thrift.TProtocol)
# github.com/uber/jaeger-client-go/thrift-gen/zipkincore
../github.com/uber/jaeger-client-go/thrift-gen/zipkincore/zipkincollector.go:101:15: cannot assign 1 values to 2 variables
../github.com/uber/jaeger-client-go/thrift-gen/zipkincore/zipkincollector.go:147:42: cannot use zipkinCollectorProcessorSubmitZipkinBatch literal (type *zipkinCollectorProcessorSubmitZipkinBatch) as type thrift.TProcessorFunction in assignment:
        *zipkinCollectorProcessorSubmitZipkinBatch does not implement thrift.TProcessorFunction (wrong type for Process method)
                have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
                want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
../github.com/uber/jaeger-client-go/thrift-gen/zipkincore/zipkincollector.go:157:27: not enough arguments in call to processor.Process
        have (int32, thrift.TProtocol, thrift.TProtocol)
        want (context.Context, int32, thrift.TProtocol, thrift.TProtocol)

@dinfer
Copy link

dinfer commented Jan 10, 2018

Fail to get when using dep. same problem with @montera82.

As glide suggests, I migrate from glide to dep. Pinning thrift version not works.

This lib can work with dep... in a silly way

dep ensure # install all pkg
cd vendor/github.com/uber/jaeger-client-go
glide install # vendor in vendor? sure, or I cannot work
rm -rf vendor/github.com/opentracing # makes this lib depend on the same opentracing with my project
cd - && go build ... # It works

But every time I run dep ensure, the vendor folder of jaeger-client-go is removed. so I have to repeat to install.

It's a half of year, the upstream is still broken. Is anyone maintaining this project?

@yurishkuro
Copy link
Member

@montera82 the tutorial does not suggest using go get, see https://github.com/yurishkuro/opentracing-tutorial/tree/master/go#installing

@dinfer
Copy link

dinfer commented Jan 10, 2018

Tips for dep user, By using this, jaeger-client-go seems works.

  1. fix libraries version that jaeger-client-go depends on in your project in Gopkg.toml. For me, the github.com/apache/thrift
  2. import the lib in the entry file. such as _ "github.com/apache/thrift/lib/go/thrift"
  3. run dep ensure to install them.

@yurishkuro
Copy link
Member

@dinfer I am adding Gopkg.toml in #250

@dinfer
Copy link

dinfer commented Jan 10, 2018

Great! thanks a lot! @yurishkuro

@kingeasternsun
Copy link

my env

wdy@wdy:~$ go env
GOARCH="amd64"
GOBIN="/home/wdy/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/wdy/svn/"
GORACE=""
GOROOT="/home/wdy/go"
GOTOOLDIR="/home/wdy/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build912081464=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

github.com/uber/jaeger-client-go/thrift-gen/zipkincore/zipkincollector.go:101: assignment count mismatch: 2 = 1


c/github.com/uber/jaeger-client-go/thrift-gen/zipkincore/zipkincollector.go:147: cannot use zipkinCollectorProcessorSubmitZipkinBatch literal (type *zipkinCollectorProcessorSubmitZipkinBatch) as type thrift.TProcessorFunction in assignment:
	*zipkinCollectorProcessorSubmitZipkinBatch does not implement thrift.TProcessorFunction (wrong type for Process method)
		have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
		want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)


/github.com/uber/jaeger-client-go/thrift-gen/zipkincore/zipkincollector.go:157: not enough arguments in call to processor.Process
	have (int32, thrift.TProtocol, thrift.TProtocol)
	want (context.Context, int32, thrift.TProtocol, thrift.TProtocol)


github.com/uber/jaeger-client-go/thrift-gen/jaeger/agent.go:101: cannot use agentProcessorEmitBatch literal (type *agentProcessorEmitBatch) as type thrift.TProcessorFunction in assignment:
	*agentProcessorEmitBatch does not implement thrift.TProcessorFunction (wrong type for Process method)
		have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
		want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)


github.com/uber/jaeger-client-go/thrift-gen/jaeger/agent.go:111: not enough arguments in call to processor.Process
	have (int32, thrift.TProtocol, thrift.TProtocol)
	want (context.Context, int32, thrift.TProtocol, thrift.TProtocol)


github.com/uber/jaeger-client-go/thrift-gen/sampling/samplingmanager.go:101: assignment count mismatch: 2 = 1


github.com/uber/jaeger-client-go/thrift-gen/sampling/samplingmanager.go:147: cannot use samplingManagerProcessorGetSamplingStrategy literal (type *samplingManagerProcessorGetSamplingStrategy) as type thrift.TProcessorFunction in assignment:
	*samplingManagerProcessorGetSamplingStrategy does not implement thrift.TProcessorFunction (wrong type for Process method)
		have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)
		want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException)

duanbing pushed a commit to opentracing-contrib/go-gorilla that referenced this issue Apr 16, 2018
* Add example in README

* Add example in README

* Reuse client from go-stdlib and add example

* Reuse client from go-stdlib and add example

* Simplify example

* Add before_script to avoid jaegertracing/jaeger-client-go#184

* Add before_script to avoid jaegertracing/jaeger-client-go#184

* Add before_script to avoid jaegertracing/jaeger-client-go#184

* Add before_script to avoid jaegertracing/jaeger-client-go#184

* Go fmt and give a simple way to attach tracer #2

* Provide default opName and build a gorilla middleware to inject tracer. #2

* Extract operation name from the route #2

* Extract operation name from the route #2

* Remove r.URL.Path and gofmt #2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants