I got an issue with gRPC service. I'm using grpc-web on my client side Angular application.
I constantly receiving CORS error:
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
and also sometimes I do receive the following message on the grpc server:
transport: loopyWriter.run returning. connection error: desc = "transport is closing"
and the logging shows that grpc request received but no response sent back to the client app
Here are my configs:
Consul LDS:
[{
"name": "listener_0",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 8080
}
},
"filter_chains": [{
"filters": [{
"name": "envoy.http_connection_manager",
"config": {
"codec_type": "auto",
"stat_prefix": "ingress_http",
"route_config": {
"name": "local_route",
"virtual_hosts": [{
"name": "local_service",
"domains": [
"*"
],
"routes": [{
"match": {
"prefix": "/App.Grpc.MyApp1"
},
"route": {
"cluster": "main_service",
"max_grpc_timeout": "0s"
}
}],
"cors": {
"allow_origin": [
"*"
],
"allow_methods": "GET, PUT, DELETE, POST, OPTIONS",
"allow_headers": "keep-alive, user-agent, cache-control, content-type, content-transfer-encoding, Authorization, x-ip, x-accept-content-transfer-encoding, x-accept-response-streaming, x-user-agent, x-grpc-web, grpc-timeout",
"max_age": "1728000",
"expose_headers": "grpc-status, grpc-message",
"enable": true
}
}]
},
"http_filters": [{
"name": "envoy.cors"
},
{
"name": "envoy.grpc_web"
},
{
"name": "envoy.router"
}
]
}
}]
}]
}]
Consul CDS:
[{
"name": "MyApp1",
"connect_timeout": "0.25s",
"type": "logical_dns",
"lb_policy": "round_robin",
"http2_protocol_options": {},
"hosts": [{
"socket_address": {
"address": "host.docker.internal", # also tried docker service name my_app
"port_value": 50053
}
}]
}]
When I'm running envoy and go service without Pilot, everything works fine with exactly same configs, trying to figure out how to update envoy dynamically. Any help would be appreciated!
I got an issue with gRPC service. I'm using grpc-web on my client side Angular application.
I constantly receiving CORS error:
and also sometimes I do receive the following message on the grpc server:
and the logging shows that grpc request received but no response sent back to the client app
Here are my configs:
Consul LDS:
Consul CDS:
When I'm running envoy and go service without Pilot, everything works fine with exactly same configs, trying to figure out how to update envoy dynamically. Any help would be appreciated!