You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Tereius (via GitHub)" <gi...@apache.org> on 2025/05/11 18:33:43 UTC
[I] bug: grpc-web unexpected error "upstream grpc status not received" [apisix]
Tereius opened a new issue, #12202:
URL: https://github.com/apache/apisix/issues/12202
### Current Behavior
Hi,
I am in the process of replacing Envoy with Apisix for grpc-web request transformation. My tests show that many things seem to work already, but I experienced a bug with the following edge case:
I have a server side grpc streaming response that **immediately** returns an error when called. This results in **two** calls of the error handler function on the frontend. The first error contains the following unexpected error message: `upstream grpc status not received`
The second error contains the expected error message from the server.
With Envoy only the expected server error is received on the frontend.
### Expected Behavior
Only the expected server error is delivered to the frontend.
### Error Logs
_No response_
### Steps to Reproduce
I created a minimal example to reproduce this edge case [here](https://github.com/Tereius/apisix_bug_minimal_example):
[Here](https://github.com/Tereius/apisix_bug_minimal_example/blob/c39a4cfe2f5116bf4d5239001407830aaa7ca5a5/frontend/script.js#L34) you find the immediate error response on the server side.
[Here](https://github.com/Tereius/apisix_bug_minimal_example/blob/c39a4cfe2f5116bf4d5239001407830aaa7ca5a5/frontend/script.js#L36) you find the frontend error handler that gets called twice.
### Environment
- APISIX version (run `apisix version`): 3.12.0
- Operating system (run `uname -a`): Linux 6.14.3-zen1-1-zen
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`): openresty/1.27.1.1
- etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): -
- APISIX Dashboard version, if relevant: -
- Plugin runner version, for issues related to plugin runners: -
- LuaRocks version, for installation issues (run `luarocks --version`): -
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: grpc-web unexpected error "upstream grpc status not received" [apisix]
Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung closed issue #12202: bug: grpc-web unexpected error "upstream grpc status not received"
URL: https://github.com/apache/apisix/issues/12202
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: grpc-web unexpected error "upstream grpc status not received" [apisix]
Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung commented on issue #12202:
URL: https://github.com/apache/apisix/issues/12202#issuecomment-3144037729
Hi, First of all, thank you very much for providing such a good minimal reproduction environment.
I spent a lot of time using `gdb` to trace functions in nginx, but to no avail.
But @bzp2010 prompts me that nginx may not parse correctly without Header `Trailer`.
So I tried change your minimal example:
```go
// cmd/main.go
func (s *server) SayHello(req *example.HelloRequest, stream grpc.ServerStreamingServer[example.HelloReply]) error {
+ trailerMD := metadata.Pairs(
+ "Trailer", "grpc-message, grpc-status",
+ )
+
+ stream.SendHeader(trailerMD)
return status.Errorf(codes.Internal, "this error is expected")
}
```
**It works.**
<img width="1234" height="142" alt="Image" src="https://github.com/user-attachments/assets/1fb19359-c2f2-4a47-b865-7d771bf3912d" />
---
I'm not familiar with the standards of grpc, but ChatGPT told me that it seems to be normal for gRPC (only works with http/2) to not have this Header `Trailer`.
I'm not quite sure yet; this requires discussion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: grpc-web unexpected error "upstream grpc status not received" [apisix]
Posted by "bzp2010 (via GitHub)" <gi...@apache.org>.
bzp2010 commented on issue #12202:
URL: https://github.com/apache/apisix/issues/12202#issuecomment-3178678451
@Tereius
This unintended behavior has been corrected, and this is essentially an edge use case that was not covered. You can get the patch from PR.
ref: https://github.com/apache/apisix/pull/12490
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: grpc-web unexpected error "upstream grpc status not received" [apisix]
Posted by "Tereius (via GitHub)" <gi...@apache.org>.
Tereius commented on issue #12202:
URL: https://github.com/apache/apisix/issues/12202#issuecomment-3178696390
Thank you very much.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org