You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "RogueJin (via GitHub)" <gi...@apache.org> on 2023/09/25 08:16:49 UTC

[GitHub] [apisix] RogueJin opened a new issue, #10254: bug: grpcweb plugin truncates trailing headers

RogueJin opened a new issue, #10254:
URL: https://github.com/apache/apisix/issues/10254

   ### Current Behavior
   
   The response from grpc server has a trailing header but APISIX grpcweb plugin truncates it and causes client error.
   
   ![WeChatWorkScreenshot_5b0438bc-c91a-43d9-be01-ec214bad4fd3](https://github.com/apache/apisix/assets/21214103/7f16a335-326b-4035-94e3-6b40e304c3e7)
   
   ![WeChatWorkScreenshot_862b930d-6e49-4acc-869f-de6de27ebbef](https://github.com/apache/apisix/assets/21214103/98048e5e-6fc1-41b7-aadd-a2d6a3b3863b)
   
   
   The related code of grpc-dotnet could be checked here:
   [https://github.com/grpc/grpc-dotnet/blob/46480fca2fccddb3391cf267004f281afe87571d/src/Grpc.Net.Client/Internal/GrpcProtocolHelpers.cs#L386](url)
   ![WeChatWorkScreenshot_543b9c2f-e7ad-496e-a179-5c7dd0bf2e00](https://github.com/apache/apisix/assets/21214103/a7ea9f00-2ef9-4247-b810-0f6524b98fef)
   
   
   ### Expected Behavior
   
   Trailing headers could be reserved for client.
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   1. run APISIX via docker compose
   2. setup upstream grpcweb api
   3. config route
   ``` json
   {
     "uri": "/*",
     "name": "grpcweb",
     "plugins": {
       "cors": {},
       "grpc-web": {}
     },
     "upstream_id": "479432631159620291",
     "status": 1
   }
   ```
   5. curl
   ``` bash
   curl http://localhost:9080/xxxxxxxxx -X OPTIONS -v
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.5.0
   - Operating system (run `uname -a`):
   
   Linux 49c5eb4d90cd 5.15.49-linuxkit-pr https://github.com/apache/apisix/pull/1 SMP PREEMPT Thu May 25 07:27:39 UTC 2023 aarch64 GNU/Linux
   
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   nginx version: openresty/1.21.4.1
   built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
   built with OpenSSL 1.1.1s 1 Nov 2022
   TLS SNI support enabled
   
   - 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 plugin truncates trailing headers [apisix]

Posted by "RogueJin (via GitHub)" <gi...@apache.org>.
RogueJin commented on issue #10254:
URL: https://github.com/apache/apisix/issues/10254#issuecomment-1898394733

   we decided to give up grpc-web months ago since the issue, but I would check it in my spare time. thanks for the fixing anyway.
   
   > @RogueJin , can you please check this and verify if changing from `grpc-web` to `grpc-web-text` works for you : [#10573 (comment)](https://github.com/apache/apisix/issues/10573#issuecomment-1895621010)
   
   


-- 
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


[GitHub] [apisix] shreemaan-abhishek commented on issue #10254: bug: grpcweb plugin truncates trailing headers

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #10254:
URL: https://github.com/apache/apisix/issues/10254#issuecomment-1733371382

   I'm not sure if APISIX modified the response because it's clear from the code that the only (response) body modification involved in the `grpc-web` plugin is base64 encoding:
   
   https://github.com/shreemaan-abhishek/apisix/blob/88da2ecdd2a331d62f4c6d9849910d164ad33ead/apisix/plugins/grpc-web.lua#L135-L150
   
   Can encoding lead to such an issue? 🤔 


-- 
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 plugin truncates trailing headers [apisix]

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #10254:
URL: https://github.com/apache/apisix/issues/10254#issuecomment-1840292605

   continue discussion on #10573 


-- 
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


[GitHub] [apisix] RogueJin commented on issue #10254: bug: grpcweb plugin truncates trailing headers

Posted by "RogueJin (via GitHub)" <gi...@apache.org>.
RogueJin commented on issue #10254:
URL: https://github.com/apache/apisix/issues/10254#issuecomment-1733399907

   The content-type is application/grpc-web and it uses binary encoding according to code.
   ```
   content-type: application/grpc-web
   grpc-accept-encoding: identity,gzip,deflate
   ```
   
   https://github.com/shreemaan-abhishek/apisix/blob/88da2ecdd2a331d62f4c6d9849910d164ad33ead/apisix/plugins/grpc-web.lua#L43-L48
   
   Just as you mentioned, the weird thing is that there is no explicit code modifying response body. 
   
   Any clue?


-- 
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 plugin truncates trailing headers [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on issue #10254:
URL: https://github.com/apache/apisix/issues/10254#issuecomment-1837594929

   See https://github.com/projectcontour/contour/issues/3233


-- 
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: grpcweb plugin truncates trailing headers [apisix]

Posted by "Affanmir (via GitHub)" <gi...@apache.org>.
Affanmir commented on issue #10254:
URL: https://github.com/apache/apisix/issues/10254#issuecomment-1833743269

   Facing the same issue, any update on this?


-- 
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 plugin truncates trailing headers [apisix]

Posted by "sheharyaar (via GitHub)" <gi...@apache.org>.
sheharyaar commented on issue #10254:
URL: https://github.com/apache/apisix/issues/10254#issuecomment-1899013155

   @RogueJin , you can also checkout #10851 , if that fixes the issue


-- 
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 plugin truncates trailing headers [apisix]

Posted by "sheharyaar (via GitHub)" <gi...@apache.org>.
sheharyaar commented on issue #10254:
URL: https://github.com/apache/apisix/issues/10254#issuecomment-1895633157

   @RogueJin , can you please check this and verify if changing from `grpc-web` to `grpc-web-text` works for you : https://github.com/apache/apisix/issues/10573#issuecomment-1895621010


-- 
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 plugin truncates trailing headers [apisix]

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek closed issue #10254: bug: grpc-web plugin truncates trailing headers
URL: https://github.com/apache/apisix/issues/10254


-- 
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