New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grpc-json transcoder: returns 415 instead of 404 #5010
Comments
415 is returned from upstream, the gRPC JSON transcoder wouldn't modify unmapped requests so they will go directly to upstream and it is up to upstream to return whatever error code. |
If you don't want unmodified request to be sent to upstream, add |
I tested it and it works, thanks :). I added it here: virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match: { prefix: "/" , grpc: {} }
route: { cluster: grpc-backend-services, timeout: { seconds: 60 } } I found docs here: |
I have another question that might be related. But it might be another issue (I can create that): If the resource returns a stream, and I throw an error, the response is always 200 with body .proto // lists all the reservations, use query params on venue or timestamp to filter the resultset.
rpc ListReservations(ListReservationsRequest) returns (stream Reservation) {
// use query parameter to specify filters, example: ?venue=UtrechtHomeoffice
// these query parameters will be automatically mapped to the ListReservationRequest object
option (google.api.http) = {
get: "/v1/reservations"
};
} Java implementation: @Override
public void listReservations(ListReservationsRequest request, StreamObserver<Reservation> responseObserver) {
responseObserver.onError(Status.UNAUTHENTICATED.asRuntimeException());
} Curl:
|
Moved last question to a separte issue. #5011 |
Bug Template
Title: grpc-json transcoder returns http status 415 instead of 404 when a route is not configured in the .proto file.
Description:
When I run envoy as a grpc-json transcoder and I try to GET a path that is not mapped by any http option, envoy returns 415 with a body
Content-Type is missing from the request
. If the route is mapped and gRPC service returns NOT_FOUND, then envoy correctly returns 404.The expected behaviour is a 404 (or 400?) for unmapped paths.
Repro steps:
I came across this issue while writing a blog post about Envoy and grpc transcoding. Please just focus on the
CreateReservation
rpc for reproduction.Complete working exampe transcoding-grpc-to-http-json
reservation_service.proto file:
envoy config
generating service descriptor
Running envoy using docker
successful cal
Call producing wrong status code
Admin and Stats Output:
/clusters
/server_info
*/stats
Config:
Logs:
Call Stack:
The text was updated successfully, but these errors were encountered: