Hello,
I have a problem sending a request to a local gRPC server from Extensible Service Proxy v2. The gRPC server works when requested via
GRPC UI, but when requested though ESP, the request is not processed, and the gRPC server prints error:
E1123 21:13:45.264632366 9 http_server_filter.cc:299] GET request without QUERY
All I know is that this is related to base64 padding (
https://github.com/grpc/grpc/commit/ce0fd978e1f93a54d97d882562e9d47487b34ef0 and
https://medium.com/better-software/interface-grpc-with-web-using-grpc-web-and-envoy-possibly-the-best-way-forward-3ae9671af67). I'm not even sure if the cause is on the side of the ESP or the gRPC server.
The gRPC server is executed from Python.
The docker-compose.yaml:
=================================================================
version: '3.7'
services:
grpc:
image: esptest:latest
container_name: esptest_grpc
build:
context: ./
dockerfile: ./Dockerfile
ports:
- "4000:8080"
volumes:
- $GOOGLE_APPLICATION_CREDENTIALS:/usr/local/etc/google-application-credentials.json:ro
environment:
- GOOGLE_APPLICATION_CREDENTIALS=/usr/local/etc/google-application-credentials.json
- GRPC_TRACE=all
- GRPC_VERBOSITY=DEBUG
esp:
image:
gcr.io/endpoints-release/endpoints-runtime:2 container_name: esptest_esp
ports:
- "4002:8082"
volumes:
- $GOOGLE_APPLICATION_CREDENTIALS:/usr/local/etc/google-application-credentials.json:ro
- ./api_config.json:/usr/local/etc/api_config.json:ro
command:
- "--service_json_path=/usr/local/etc/api_config.json"
- "--listener_port=8082"
- "--backend=grpc://grpc:8080"
- "--backend_dns_lookup_family=v4only"
- "--cors_preset=basic"
- "--non_gcp"
- "--enable_debug"
environment:
- GOOGLE_APPLICATION_CREDENTIALS=/usr/local/etc/google-application-credentials.json
depends_on:
- grpc
=================================================================
Here is the api_config.json:
=================================================================
{
"apis": [
{
"methods": [
{
"name": "Ping",
"options": [
{
"name": "google.api.http",
"value": {
"@type": "
type.googleapis.com/google.api.HttpRule",
"get": "/ping"
}
}
],
"requestTypeUrl": "
type.googleapis.com/esptest.proto.common.Empty",
"responseTypeUrl": "
type.googleapis.com/esptest.proto.common.Empty"
}
],
"name": "esptest.proto.ping_service.Ping",
"sourceContext": {
"fileName": "services/ping_service/ping_service.proto"
},
"syntax": "SYNTAX_PROTO3",
"version": "v1"
}
],
"authentication": {
"providers": [
{
"audiences": "
https://api-dev.example.com",
"id": "google_id_token",
"issuer": "
https://accounts.google.com"
}
],
"rules": [
{
"requirements": [
{
"audiences": "
https://api-dev.example.com",
"providerId": "google_id_token"
}
],
"selector": "esptest.proto.ping_service.Ping.Ping"
}
]
},
"configVersion": 3,
"control": {
"environment": "
servicecontrol.googleapis.com"
},
"endpoints": [
{
"name": "
api-dev.example.com"
}
],
"http": {
"rules": [
{
"get": "/ping",
"selector": "esptest.proto.ping_service.Ping.Ping"
}
]
},
"id": "2020-11-23",
"name": "
api-dev.example.com",
"producerProjectId": "esptest-dev",
"title": "Endpoints",
"types": [
{
"name": "esptest.proto.common.Empty",
"sourceContext": {
"fileName": "services/common/common.proto"
},
"syntax": "SYNTAX_PROTO3"
}
],
"usage": {
"rules": [
{
"allowUnregisteredCalls": true,
"selector": "esptest.proto.ping_service.Ping.Ping"
}
]
}
}