Closed pranabhkumar closed 4 years ago
It looks like the thrift compiler version is different. Here is mine:
~ maximfateev$ thrift --version Thrift version 0.9.3
@pranabhkumar were you able to get past this issue?
Same problem here.
thrift --version
Thrift version 0.11.0
https://github.com/apache/thrift/blob/master/lib/go/thrift/serializer.go#L62 Write
function takes 2 arguments but cadence passed only one
We are using version 0.9.3 for compatibility with Uber internal tools.
Here is the command to install that version on mac:
brew install https://gist.githubusercontent.com/chrislusf/8b4e7c19551ba220232f037b43c0eaf3/raw/01465b867b8ef9af7c7c3fa830c83666c825122d/thrift.rb && brew pin thrift
Thanks, git checkout to 0.9.3 of thrift worked for me, seems no need to change thrift compiler version.
hi
as described in the read me to use cadence-client when I perform:
go get go.uber.org/cadence
I encounter the same issue again (with go modules enabled and disabled, go version go1.11.10 linux/amd64)
is checking out 0.9.3 version of the thrift lib residing in $GOPATH/src the final solution to this? shouldn't this be documented then as an extra step?
Thanks.
@pranabhkumar, I've been working on updated documentation. The fix I found is to add the following to the Gopkg.toml:
[[override]]
name = "github.com/apache/thrift"
revision = "9549b25c77587b29be4e0b5c258221a4ed85d37a"
If you are using Go modules in your project, the top-level module (i.e. your project) can make use of the replace
directive to determine the exact version to be used for a given dependency, e.g. Apache Thrift v0.9.x. That's been working well for me so far.
I'm going to share a quick example. I'm using Go v1.13 and my project wants to import this library. Running go build
gives me the same error already shared above:
# go.uber.org/cadence/internal/common
../../go/pkg/mod/go.uber.org/cadence@v0.9.1/internal/common/thrift_util.go:29:38: not enough arguments in call to thrift.NewTSerializer().Write
have (thrift.TStruct)
want (context.Context, thrift.TStruct)
../../go/pkg/mod/go.uber.org/cadence@v0.9.1/internal/common/thrift_util.go:51:27: not enough arguments in call to t.Protocol.Flush
have ()
want (context.Context)
../../go/pkg/mod/go.uber.org/cadence@v0.9.1/internal/common/thrift_util.go:55:28: not enough arguments in call to t.Transport.Flush
have ()
want (context.Context)
I run go mod graph
to discover that the module version being used is github.com/apache/thrift@v0.12.0
hence the conflict. I'm going to use go mod edit -replace
to introduce the replace
directive in my project pinning the dependency to the particular version that we want:
$ go mod edit -replace "github.com/apache/thrift=github.com/apache/thrift@a9b748bb0e02"
$ go mod tidy
go: finding github.com/apache/thrift a9b748bb0e02
I've used a9b748bb0e02
because Thrift's corresponding tag v0.9.3.1
isn't a valid semver version.
Now go build
completes successfully. My go.mod
file includes:
replace github.com/apache/thrift => github.com/apache/thrift v0.0.0-20190309152529-a9b748bb0e02
If you are using go get follow these steps cd C:\Users\Gowtham.MS\go\src\github.com\apache\thrift git checkout 53dd39833a08 go get go.uber.org/cadence
replace github.com/apache/thrift => github.com/apache/thrift v0.0.0-20190309152529-a9b748bb0e02
Is there a way to keep this hardcoded commit number in sync with the one actually being used by cadence (currently v0.0.0-20161221203622-b2a4d4ae21c7
)? See go.mod.
Hello, Is it normal this problem is still occurring? replace does fix it though...
As a very late update: this should be fixed whenever https://github.com/yarpc/yarpc-go/pull/2075 is merged (and we upgrade Cadence to it, which should be fairly soon after).
Users of glide or dep (or anything compatible with them) are currently pulling in yarpc's glide.yaml file, and that sets an upper bound of <0.11, which keeps apache/thrift compatible with cadence and yarpc / tchannel-go. Users of go modules pull in the incompatible 0.13 (or newer), and they get this error.
Looks like yarpc
is merged a while ago. Any updates here?
go.uber.org/cadence/internal/common
go/src/go.uber.org/cadence/internal/common/thrift_util.go:29:38: not enough arguments in call to thrift.NewTSerializer().Write have (thrift.TStruct) want (context.Context, thrift.TStruct) go/src/go.uber.org/cadence/internal/common/thrift_util.go:51:27: not enough arguments in call to t.Protocol.Flush have () want (context.Context) go/src/go.uber.org/cadence/internal/common/thrift_util.go:55:28: not enough arguments in call to t.Transport.Flush have () want (context.Context)