grpc / grpc/grpc-node

@grpc/grpc-js not working with aws ALB

Open
#2,093 22 comments 5 reactions 0 assignees View on GitHub
package: @grpc/grpc-js
Dominant language
TypeScript
Stars
4.8k
Forks
716
Avg merge
2d 3h
Merged PRs (30d)
10

Description

### Problem description
I was trying to use grpc with ALB, considering this documentation from AWS: https://aws.amazon.com/pt/blogs/aws/new-application-load-balancer-support-for-end-to-end-http-2-and-grpc/

I created the Load balancer, target group, cluster, service and task definition using an ECR image with this [hello-world server example from grpc repo](https://github.com/grpc/grpc/tree/v1.45.0/examples/node ). I tried dynamic and static proto generation and both returned this error:
```
Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: Protocol error
(node:1500234) UnhandledPromiseRejectionWarning: Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: Protocol error
at Object.callErrorFromStatus (/home/gustavosartori/validate-grpc-alb/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
at Object.onReceiveStatus (/home/gustavosartori/validate-grpc-alb/node_modules/@grpc/grpc-js/build/src/client.js:180:52)
at Object.onReceiveStatus (/home/gustavosartori/validate-grpc-alb/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
at Object.onReceiveStatus (/home/gustavosartori/validate-grpc-alb/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
at /home/gustavosartori/validate-grpc-alb/node_modules/@grpc/grpc-js/build/src/call-stream.js:160:78
at processTicksAndRejections (internal/process/task_queues.js:77:11)
```

After that to make sure the error wasn't in my hello-world server I changed the ECR image to another grpc-server(using @grpc/grpc-jt) that I already have working on aws, and the error persists.

To finish I decided to test using the [python hello world example](https://github.com/grpc/grpc/tree/v1.45.0/examples/python/helloworld), and it worked, so I believe the @grpc/grpc-js have some bad interaction with ALB, but I don't know exactly how debug this
### Reproduction steps
- Upload to ECR any grpc server [(I used this hello-world example)](https://github.com/grpc/grpc/tree/v1.45.0/examples/node/dynamic_codegen)
- Create a Cluster making sure to use an security group that allow traffic to the port used in the Dockerfile;
- Create a Target group: type = instance; protocol = http; port = 50051; protocol version = grpc;
- Create an Application Load Balancer configured to listen on 50051 and route to the just created target group;
- Create a task definition using the image uploaded to ECR
- Create a service to this task definition, in the load balancing section select the load balancer and target group created for the test
- Start de client using the dns of the ALB as url

### Environment
- Fedora 35
- Node version 14.18.0]
- Node installation method: asdf
- Package name: "@grpc/grpc-js": "^1.1.0", "@grpc/proto-loader": "^0.5.0"

### Additional context
I tried generate a cert with openssl in order to no use grcp.createInsecure, but it changed nothin

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.