Got this issue and can't seem to figure out what exactly is going wrong.
Some insights into this would be helpful if someone has come across this problem.
In my setup, I have a go grpc server that needs to call another go grpc client but the server is not able to connect to the client.
However when I run the code to connect to the grpc client from a test file and it works!!!
Here is what the connection step looks like from grpc server side.
ctxValues := map[string]string{
auth.AUTH_USERID_HEADER_GRPC: "xxxx",
auth.AUTH_USER_SCOPE_HEADER_GRPC: "yyy",
}
md := metadata.New(ctxValues)
newctx := metadata.NewOutgoingContext(context.Background(), md)
user, err := service.userProfileClient.GetUser(newctx, empty)
The error I see in the console is this:
rpc error: code = FailedPrecondition desc = grpc: the client connection is closing
Same connection code above works from a test file.
Any ideas what is going wrong when grpc server is trying to connect with the grpc server using the generated client stub.