-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NestJs GRPC Kubernetes: Microservice stuck on Initialization when run inside kubernetes cluster #9726
Comments
Hi @TMInnovations , for this type of question try to use the support discord channel The NestJS Core team uses GitHub to track bug reports, feature requests, and regressions. |
As I found out the issue now, I think this really is a bug. I added a RabbitMQ Transporter to the application. However the url that I provided was wrong. Instead of throwing an error, the initialization process was just stuck. This is horrible to debug in production and happened to me today. |
so to reproduce this we just need to supply any invalid url to |
@TMInnovations, if you can create a minimal reproduction of the issue in a clonable git repository, it would be of great help to the Nest Core Team. |
@micalevisk yes, tried it on local, docker and kubernetes environment. Initialization gets stuck and no error is thrown. really hard to debug if this happens for the first time + on your production server (faulty env var for broker-connection-url) @Tony133 I will do my best to create a minrepo soon. |
@TMInnovations as mentioned by @micalevisk your issue is related to #9749. It seems that when the connection fails within the transport we don't resolve the server promise and therefore the bootstrap of the application hangs. I'll work on a solution for this 😄 |
@TMInnovations unfortunately I was not able to reproduce your issue 😢. Also, your issue is not related to #9749 as we expected, since after further investigation I was able to find out that that issue was only related to how RabbitMQ handles failed connections. Here is what I did to try to reproduce your problem:
Could you help me reproducing it? 😄 |
Oh! Sorry. For some reason I understood that we also had an issue with gRPC 🤦🏻 Regarding RabbitMQ I've already solved that issue on #9751, we're just discussing the optimal way to handle the reconnection, but we're probably going to merge it soon 😄 |
Is there an existing issue for this?
Current behavior
Starting the grpc microservice container with url:
0.0.0.0:5000
in a docker environment produces these logs:
When running it inside a kubernetes cluster the logs seem to be stuck at line 2:
Any ideas why this would happen without an (timeout or similar) error message?
Minimum reproduction code
Steps to reproduce
Run any NestJs GRPC Microservice that provides a grpc package with url:
0.0.0.0:5000
inside a kubernetes cluster.Expected behavior
Microservice should be reachable on Port 5000 from other services. If there is a problem, an error log should be produced.
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
No response
Packages versions
Node.js version
16.14.2
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: