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

   ### Current Behavior
   
   When I was troubleshooting the issue 
https://github.com/apache/apisix-dashboard/issues/2662, I found that the 
`proto_id` field of the `grpc-transcode` plugin is of type `string/integer`. 
but the strange thing is that when configured as string, everything is fine, 
and when configured as integer, APISIX shows the following error log:
   
   ```
   2023/02/27 07:47:13 [error] 51#51: *377378 [lua] grpc-transcode.lua:146: 
phase_func(): proto load error: failed to find proto by id: 1, client: 
172.19.0.1, server: _, request: "GET /grpctest HTTP/1.1", host: "127.0.0.1:9080"
   ```
   
   ### Expected Behavior
   
   The configuration should work correctly regardless of whether string or 
integer types are used. Otherwise, the documentation needs to be updated.
   
   ### Error Logs
   
   ```
   2023/02/27 07:47:13 [error] 51#51: *377378 [lua] grpc-transcode.lua:146: 
phase_func(): proto load error: failed to find proto by id: 1, client: 
172.19.0.1, server: _, request: "GET /grpctest HTTP/1.1", host: "127.0.0.1:9080"
   ```
   
   ### Steps to Reproduce
   
   Follow the steps in 
https://apisix.apache.org/docs/apisix/plugins/grpc-transcode/#enabling-the-plugin
   1. Create proto resource
   2. Create Route with
   ```
   curl http://127.0.0.1:9180/apisix/admin/routes/111 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["GET"],
       "uri": "/grpctest",
       "plugins": {
           "grpc-transcode": {
               "proto_id": 1,
               "service": "helloworld.Greeter",
               "method": "SayHello"
           }
       },
       "upstream": {
           "scheme": "grpc",
           "type": "roundrobin",
           "nodes": {
               "127.0.0.1:50051": 1
           }
       }
   }'
   ```
   
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.1.0
   - Operating system (run `uname -a`): Linux cedc51dc68a5 5.15.49-linuxkit #1 
SMP Tue Sep 13 07:51:46 UTC 2022 x86_64 GNU/Linux
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant: 3.0.0
   - 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to