You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/08/04 13:00:36 UTC

[GitHub] [apisix] zhoujun24 opened a new issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

zhoujun24 opened a new issue #1991:
URL: https://github.com/apache/apisix/issues/1991


   ### Issue description
   The grpc-transcode plugin, after the protocol conversion, the parameters obtained by the back-end service are inconsistent with the http request parameters
   
   .protoļ¼š
   syntax = "proto3";
   
   package cmdb_api;
   
   // The CmdbAPI service definition.
   service CmdbAPI {
     rpc GetHostIPs (IPsRequest) returns (IPsReply) {}
   }
   
   message UsageTable {
     string usage = 1;
     repeated string secusage = 2;
   }
   
   message IPsRequest {
     repeated string region = 1;
     repeated string idc = 2;
     repeated UsageTable usagetables = 3;
   }
   
   message IPsReply {
     repeated string ips = 1;
     string message = 2;
   }
   
   Add a route:
   curl http://127.0.0.1:9080/apisix/admin/routes/10000 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["POST"],
       "uri": "/CmdbAPI/GetHostIPs",
       "service_protocol": "grpc",
       "plugins": {
           "grpc-transcode": {
               "proto_id": "100",
               "service": "cmdb_api.CmdbAPI",
               "method": "GetHostIPs"
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "127.0.0.1:9096": 1
           }
       }
   }'
   
   ![image](https://user-images.githubusercontent.com/19777017/89294607-5225ce00-d692-11ea-9308-b60959c87de1.png)
   ![image](https://user-images.githubusercontent.com/19777017/89295060-fdcf1e00-d692-11ea-8b36-28091ed35a47.png)
   
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 1.4
   * OS: CentOS 7.4
   * Golang: 1.13  protoc: 3.11.4
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-670808675


   ok, close this 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zhoujun24 commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
zhoujun24 commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-669659409


   @nic-chen 
   Another question:
   The response defined in .proto is a repeated string type. When the backend response data is empty, the http response data becomes {}, which should be []. You can see in the previous Issue description
   
   I am a backend engineer. Although I am interested in APISIX, I have never used Lua. I usually develop projects in C/C++, Go and Python. If I want to fix the problem, I should learn first.
   
   The doc link of the grpc-transcode plugin on the APISIX project homepage is incorrect, it should actually be https://github.com/apache/apisix/blob/master/doc/plugins/grpc-transcode.md


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nic-chen commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-668941811


   @zhoujun24  could you have a try that use format `form-data` to send request, please ?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nic-chen closed issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
nic-chen closed issue #1991:
URL: https://github.com/apache/apisix/issues/1991


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zhoujun24 commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
zhoujun24 commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-669005358


   @nic-chen 
   ![image](https://user-images.githubusercontent.com/19777017/89378607-bf833e80-d726-11ea-9b8e-f83e3f94178a.png)
   ![image](https://user-images.githubusercontent.com/19777017/89378817-36203c00-d727-11ea-98fa-4df57ddabe3b.png)
   
   The form-data format does not meet our application scenarios


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nic-chen commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-669237233


   @zhoujun24 
   
   I know where the problem is now. 
   Currently only basic data types are supported, and support for complex types needs to be added:
   https://github.com/apache/apisix/blob/master/apisix/plugins/grpc-transcode/util.lua#L63
   
   If you are interested in fixing it, welcome to pr, or I will  deal with it on this weekend.
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nic-chen closed issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
nic-chen closed issue #1991:
URL: https://github.com/apache/apisix/issues/1991


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-668694334


   @nic-chen please take a look at this 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zhoujun24 commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
zhoujun24 commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-670820190


   @membphis 
   https://github.com/apache/apisix/issues/1991, This bug is not fixed.
   
   ![image](https://user-images.githubusercontent.com/19777017/89702006-3ca0f480-d96f-11ea-8b95-aee0ca2a70d9.png)
   ![image](https://user-images.githubusercontent.com/19777017/89702022-56dad280-d96f-11ea-8378-20491da81a56.png)
   
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis closed issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
membphis closed issue #1991:
URL: https://github.com/apache/apisix/issues/1991


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zhoujun24 commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
zhoujun24 commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-670801709


   @membphis 
   It was fixed a few days ago, https://github.com/apache/apisix/pull/1946
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zhoujun24 edited a comment on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
zhoujun24 edited a comment on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-675215902


   @nic-chen Hello, When will this issue be fixed?
   
   1. The grpc-transcode plugin, after the protocol conversion, the parameters obtained by the back-end service are inconsistent with the http request parameters.
   2. The response defined in .proto is a repeated string type. When the backend response data is empty, the http response data becomes {}, which should be []. You can see in the previous Issue description
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zhoujun24 commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
zhoujun24 commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-675215902


   @nic-chen Hello, When will this issue be fixed?
   1. The grpc-transcode plugin, after the protocol conversion, the parameters obtained by the back-end service are inconsistent with the http request parameters
   2.The response defined in .proto is a repeated string type. When the backend response data is empty, the http response data becomes {}, which should be []. You can see in the previous Issue description
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nic-chen commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-678715063


   > @nic-chen Hello, When will this issue be fixed?
   > 
   > 1. The grpc-transcode plugin, after the protocol conversion, the parameters obtained by the back-end service are inconsistent with the HTTP request parameters.
   > 2. The response defined in .proto is a repeated string type. When the backend response data is empty, the HTTP response data becomes {}, which should be []. You can see in the previous Issue description
   
   Sorry for the delay, it has been busy recently, I will fix it as soon as possible.
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-669825541


   > The doc link of the grpc-transcode plugin on the APISIX project homepage is incorrect,
   
   can you supply a screen capture? I can not sure which link is wrong.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] zhoujun24 edited a comment on issue #1991: request help: grpc-transcode plugin converts http/json parameters abnormally

Posted by GitBox <gi...@apache.org>.
zhoujun24 edited a comment on issue #1991:
URL: https://github.com/apache/apisix/issues/1991#issuecomment-675215902


   @nic-chen Hello, When will this issue be fixed?
   
   1. The grpc-transcode plugin, after the protocol conversion, the parameters obtained by the back-end service are inconsistent with the HTTP request parameters.
   2. The response defined in .proto is a repeated string type. When the backend response data is empty, the HTTP response data becomes {}, which should be []. You can see in the previous Issue description
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org