Calling a gRPC service results in status code 2: "No status received"
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 716
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 10
Description
### Problem description
Error occurs when calling a gRPC service which is behind the istio gateway:

But it's ok if I use go client to request exactly the same gRPC service. Is there any difference on implementing go/node clients?
Below are the results for all possible situations:
go client => gRPC service ✅
node client => gRPC service ✅
go client => gateway => gRPC service ✅
node client => gateway => gRPC service ❌
### Reproduction steps
server: any valid server
gateway:
```yaml
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: gateway-isolated
namespace: default
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- k8s-demo-grpc.internal.sample.com
port:
name: grpc
number: 80
protocol: GRPC
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: k8s-demo-grpc-isolated
namespace: stage-c1
spec:
hosts:
- k8s-demo-grpc.internal.sample.com
gateways:
- default/gateway-isolated
http:
- route:
- destination:
host: k8s-demo-grpc
```
node client:
```js
const proto = './helloworld.proto'
const address = 'k8s-demo-grpc.internal.sample.com:80'
const service = 'Greeter'
const method = 'sayHello'
const data = { name: 'world' }
const deadline = Date.now() + 1000
const grpc = require('grpc')
const protoLoader = require('@grpc/proto-loader')
const packageDefinition = protoLoader.loadSync(proto, {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
})
const pack = grpc.loadPackageDefinition(packageDefinition).helloworld
function main() {
const client = new pack[service](address, grpc.credentials.createInsecure())
client[method](data, { deadline }, (err, response) => {
if (err) return console.log(err)
console.log('response:', response)
})
}
main()
```
### Environment
- OS name, version and architecture: any
- Node version: 10.15.3
- Node installation method: docker image registry.cn-hangzhou.aliyuncs.com/aliyun-node/alinode:4.7.2-alpine
- If applicable, compiler version: unknown
- Package name and version: grpc@1.24.3
Contributor guide
Assessment
This issue has not been assessed yet.