You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @sweeny-here, this issue comes when there is version mismatch between generators and runtime libraries. We have also faced this earlier. Can you please try building after running below commands
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go
qwerty@qwerty-mbp > go clean -cache && go clean -modcache
Download and install packages:
qwerty@qwerty-mbp > make -d install-tools
Now rebuild account-service:
qwerty@qwerty-mbp > cd account-service/cmd/server
qwerty@qwerty-mbp > export CGO_ENABLED=0 GOOS=linux GOARCH=amd64 && go build
Which repeats the earlier error:
# optisam-backend/account-service/pkg/api/v1
../../pkg/api/v1/account.pb.gw.go:107:3: undefined: runtime.CamelCaseFieldMask
../../pkg/api/v1/account.pb.gw.go:109:56: not enough arguments in call to runtime.FieldMaskFromRequestBody
have (io.Reader)
want (io.Reader, *descriptorpb.DescriptorProto)
Can you offer any further pointers?
Does the account-service api need to be rebuilt? Found under path - optisam-backend/account-service/pkg/api/v1
I followed your suggestion and updated the tools.go file and re-ran the makefile. Then switched back account-service directory but the error is persisting, as seen here:
qwerty@qwerty-mbp > pwd
/Users/qwerty/Hme/Tek/lac/sam/optisam-backend/account-service/cmd/server
qwerty@qwerty-mbp > export CGO_ENABLED=0 GOOS=linux GOARCH=amd64 && go build
# optisam-backend/account-service/pkg/api/v1
../../pkg/api/v1/account.pb.gw.go:107:3: undefined: runtime.CamelCaseFieldMask
../../pkg/api/v1/account.pb.gw.go:109:56: not enough arguments in call to runtime.FieldMaskFromRequestBody
have (io.Reader)
want (io.Reader, *descriptorpb.DescriptorProto)
Activity
Related bug Orange-OpenSource#3
dharmjit commentedon Jul 28, 2020
Hi @sweeny-here, this issue comes when there is version mismatch between generators and runtime libraries. We have also faced this earlier. Can you please try building after running below commands
The proper fix is to have tools also versioned under go modules as described
at https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
Also please note that current optisam version is bit old and we are going to publish the latest version very soon.
sweeny-here commentedon Jul 29, 2020
Thanks DHarmjit - I tried your recommendation but it's not playing ball.
Here are the steps I tried based on this article:
The tools.go file was created manually based on the packages declared within the sources:
Set the module path the root of the optisam-backend repo:
Create a makefile to download and install the packages:
Clear any existing cache:
Download and install packages:
Now rebuild account-service:
Which repeats the earlier error:
Can you offer any further pointers?
Does the account-service api need to be rebuilt? Found under path - optisam-backend/account-service/pkg/api/v1
dharmjit commentedon Jul 30, 2020
Hi @sweeny-here, We don't need to add everything as tools because there are only few libraries which is used as tools as well as code dependency.
Can you try to run this command directly as there are 2
$I am not sure if this will work.Can you try installing the updated version of protoc3 compiler. I will also try to setup this code and check If I am also facing the same error.
sweeny-here commentedon Jul 30, 2020
The Makefile has the correct syntax.
If running the command via the shell, then yes the second dollar sign needs to be dropped, as per:
The protoc compiler has been updated to v3x:
I followed your suggestion and updated the tools.go file and re-ran the makefile. Then switched back account-service directory but the error is persisting, as seen here: