solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy
https://docs.solo.io/
Apache License 2.0
4.07k stars 436 forks source link

convertGrpcStatus does not add grpc-status or grpc-message headers #5039

Open kevin-shelaga opened 3 years ago

kevin-shelaga commented 3 years ago

Describe the bug setting convertGrpcStatus in https://docs.solo.io/gloo-edge/latest/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/options/grpc_json/grpc_json.proto.sk/ does not add grpc-status or grpc-message headers when an error occurs. Also no error details were added the to body as json.

To Reproduce Steps to reproduce the behavior:

  1. Follow advanced guide (https://docs.solo.io/gloo-edge/latest/guides/traffic_management/destination_types/grpc_to_rest_advanced/)
  2. Add the following to the gateway
    ...
    httpGateway:
    options:
      grpcJsonTranscoder:
        convertGrpcStatus: true
        printOptions:
          alwaysPrintPrimitiveFields: true
          preserveProtoFieldNames: true
    ...
  3. Using grpcurl send a bad request (grpcurl -v --plaintext -d '{"theme": "music"}' $URL:80 main.Bookstore.CreateShelf
  4. See error
    
    Resolved method descriptor:
    rpc CreateShelf ( .main.CreateShelfRequest ) returns ( .main.Shelf ) {
    option (.google.api.http) = { post:"/shelf" body:"shelf"  };
    }

Request metadata to send: (empty) Error invoking method "main.Bookstore.CreateShelf": error getting request data: message type main.CreateShelfRequest has no known field named theme



**Expected behavior**
grpc-status and grpc-message headers should be returned

**Additional context**
Add any other context about the problem here, e.g.
- Gloo Edge version - v1.8.0
- Kubernetes version - 1.20
github-actions[bot] commented 3 months ago

This issue has been marked as stale because of no activity in the last 180 days. It will be closed in the next 180 days unless it is tagged "no stalebot" or other activity occurs.