vortegatorres opened a new issue, #9174:
URL: https://github.com/apache/apisix/issues/9174
### Current Behavior
I am trying to run Stand-Alone mode using the `grpc-transcode` plugin with
this `apisix.yalm` file:
```
protos:
-
id: 1
key: "/apisix/protos/1",
content: "syntax = \"proto3\";\npackage helloworld;\nservice Greeter
{\nrpc SayHello (HelloRequest) returns (HelloReply) {}\n}\nmessage HelloRequest
{\nstring name = 1;\n}\nmessage HelloReply {\nstring message = 1;\n}"
routes:
-
id: 1
uri: "/grpctest"
upstream:
scheme: "grpc"
nodes:
"host.docker.internal:50051": 1
type: roundrobin
scheme: "grpc"
methods: ["POST", "GET"]
plugins:
grpc-transcode:
method: "SayHello"
proto_id: 1
service: "helloworld.Greeter"
#END
```
And with this command:
```
curl -i -XPOST "http://127.0.0.1:9080/grpctest?name=world"
```
I am having this error because the proto is not being parsed:
```
docker-apisix-apisix-1 | 2023/03/27 07:14:11 [error] 136#136: *5231 [lua]
grpc-transcode.lua:146: phase_func(): proto load error: failed to find proto by
id: 1, client: 172.21.0.1, server: _, request: "POST /grpctest?name=world
HTTP/1.1", host: "127.0.0.1:9080"
docker-apisix-apisix-1 | 172.21.0.1 - - [27/Mar/2023:07:14:11 +0000]
127.0.0.1:9080 "POST /grpctest?name=world HTTP/1.1" 501 5 0.041 "-"
"curl/7.86.0" 192.168.65.2:50051 200 0.009 "grpc://127.0.0.1:9080"
```
### Expected Behavior
Have the same behavior as
[here](https://apisix.apache.org/docs/apisix/next/plugins/grpc-transcode/#example-usage)
without the Stand-Alone mode.
### Error Logs
````
docker-apisix-apisix-1 | 2023/03/27 07:14:11 [error] 136#136: *5231 [lua]
grpc-transcode.lua:146: phase_func(): proto load error: failed to find proto by
id: 1, client: 172.21.0.1, server: _, request: "POST /grpctest?name=world
HTTP/1.1", host: "127.0.0.1:9080"
docker-apisix-apisix-1 | 172.21.0.1 - - [27/Mar/2023:07:14:11 +0000]
127.0.0.1:9080 "POST /grpctest?name=world HTTP/1.1" 501 5 0.041 "-"
"curl/7.86.0" 192.168.65.2:50051 200 0.009 "grpc://127.0.0.1:9080"
````
### Steps to Reproduce
1. Checkout [apisix-docker](https://github.com/apache/apisix-docker/tree)
and in the example folder edit this files:
- config.yaml:
```
apisix:
node_listen:
- port: 9080
enable_http2: false
- port: 9084
enable_http2: true # APISIX listening port
enable_ipv6: false
enable_control: true
control:
ip: "0.0.0.0"
port: 9092
deployment:
role: data_plane
role_data_plane:
config_provider: yaml
plugin_attr:
prometheus:
export_addr:
ip: "0.0.0.0"
port: 9091
```
- apisix.yalm:
```
protos:
-
id: 1
key: "/apisix/protos/1",
content: "syntax = \"proto3\";\npackage helloworld;\nservice Greeter
{\nrpc SayHello (HelloRequest) returns (HelloReply) {}\n}\nmessage HelloRequest
{\nstring name = 1;\n}\nmessage HelloReply {\nstring message = 1;\n}"
routes:
-
id: 1
uri: "/grpctest"
upstream:
scheme: "grpc"
nodes:
"host.docker.internal:50051": 1
type: roundrobin
scheme: "grpc"
methods: ["POST", "GET"]
plugins:
grpc-transcode:
method: "SayHello"
proto_id: 1
service: "helloworld.Greeter"
#END
```
- docker-compose-arm64.yml:
```
version: "3"
services:
apisix:
image: apache/apisix:3.1.0-debian
restart: always
volumes:
- ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
- ./apisix_conf/apisix.yaml:/usr/local/apisix/conf/apisix.yaml:ro
ports:
- "9180:9180/tcp"
- "9083:9083/tcp"
- "9084:9084/tcp"
- "9080:9080/tcp"
- "9091:9091/tcp"
- "9443:9443/tcp"
- "9092:9092/tcp"
networks:
apisix:
networks:
apisix:
driver: bridge
```
2. docker-compose -p docker-apisix -f docker-compose-arm64.yml up
3. curl -i -XPOST "http://127.0.0.1:9080/grpctest?name=world"
### Environment
https://github.com/apache/apisix-docker/tree/master/example
--
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]