grpc-proxy icon indicating copy to clipboard operation
grpc-proxy copied to clipboard

panic: interface conversion: *proxy.frame is not proto.Message: missing method ProtoMessage

Open rmilejcz opened this issue 5 years ago • 3 comments

I have a project relying on https://github.com/improbable-eng/grpc-web/, specifically:

https://github.com/improbable-eng/grpc-web/go/grpcwebproxy

As of today, I can no longer make calls through the proxy, I get this error stack:

proxy_1    | panic: interface conversion: *proxy.frame is not proto.Message: missing method ProtoMessage
proxy_1    | 
proxy_1    | goroutine 47 [running]:
proxy_1    | google.golang.org/grpc/encoding/proto.marshal(0x923e20, 0xc0001a8400, 0xc000145980, 0x0, 0x0, 0x40c100, 0xc000145950, 0x30)
proxy_1    | 	/go/pkg/mod/google.golang.org/[email protected]/encoding/proto/proto.go:54 +0x45
proxy_1    | google.golang.org/grpc/encoding/proto.codec.Marshal(0x923e20, 0xc0001a8400, 0x203000, 0x0, 0x0, 0x203000, 0x203000)
proxy_1    | 	/go/pkg/mod/google.golang.org/[email protected]/encoding/proto/proto.go:74 +0xad
proxy_1    | google.golang.org/grpc.encode(0x7fc8845365d8, 0xee0970, 0x923e20, 0xc0001a8400, 0x0, 0xec4b80, 0x7fc88679e008, 0x0, 0x0)
proxy_1    | 	/go/pkg/mod/google.golang.org/[email protected]/rpc_util.go:543 +0x52
proxy_1    | google.golang.org/grpc.prepareMsg(0x923e20, 0xc0001a8400, 0x7fc8845365d8, 0xee0970, 0x0, 0x0, 0x0, 0x0, 0x3, 0x40902b, ...)
proxy_1    | 	/go/pkg/mod/google.golang.org/[email protected]/stream.go:1519 +0x85
proxy_1    | google.golang.org/grpc.(*clientStream).SendMsg(0xc000089b00, 0x923e20, 0xc0001a8400, 0x0, 0x0)
proxy_1    | 	/go/pkg/mod/google.golang.org/[email protected]/stream.go:699 +0x169
proxy_1    | github.com/mwitkow/grpc-proxy/proxy.(*handler).forwardServerToClient.func1(0xafc6c0, 0xc0001a8220, 0xc0001884e0, 0xafc7e0, 0xc000089b00)
proxy_1    | 	/go/pkg/mod/github.com/mwitkow/[email protected]/proxy/handler.go:155 +0xa0
proxy_1    | created by github.com/mwitkow/grpc-proxy/proxy.(*handler).forwardServerToClient
proxy_1    | 	/go/pkg/mod/github.com/mwitkow/[email protected]/proxy/handler.go:148 +0x89

How can I go about debugging why this is happening?

I'm using this service / proto message:

service AuthService {
  rpc GetToken(AuthData) returns (Token) {
    option (google.api.http) = {
      post: "/v1/auth"
      body: "*"
    };
  }
}

message AuthData {
  string username = 1;
  string password = 2;
}

the Go output does have a method called ProtoMessage, the TypeScript output does not but even if I manually add this method to generated TypeScript the error is the exact same.

As far as I can tell no one is having this error but me, but I don't seem to have any ability to influence or debug it. Any sort of direction or suggestions are greatly appreciated thank you

rmilejcz avatar Oct 01 '19 20:10 rmilejcz

I have the same problem. Any news regarding this issue?

hesmar avatar Oct 08 '19 08:10 hesmar

Ok, I use this fork now: The issue is fixed there.

hesmar avatar Oct 08 '19 16:10 hesmar

i had a similar stack trace. On dial out, I needed to pass the DialOption:

grpc.WithCodec(proxy.Codec())

emicklei avatar Sep 15 '20 13:09 emicklei