nestjs/terminus

TypeORM health check during uploading files causes application restart

rodewitsch opened this issue · 1 comments

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

TypeOrmHealthIndicator causes crash of application when there is no node_modules directory.

When I release new version of my projects I clean target directory, upload new version and reload application. After it I can restart application without downtime when I have at least two instances of it (one by one). But in this case request of health check during update breaks application.

Minimum reproduction code

Here is simple project with http://localhost:3000/health request.
https://github.com/rodewitsch/health

If you rename or delete typeorm folder from node_modules and make /health request you application crashes.

Steps to reproduce

  1. npm i
  2. npm run start
  3. http://localhost:3000/health
  4. rename node_modules/typeorm to node_modules/typeorm1
  5. http://localhost:3000/health
  6. application crash

Expected behavior

Health check request must not be cause of application craches.

Package version

10.2.3

NestJS version

10.0.0

Node.js version

20.10.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

This is not something that I’d priotize to fix. I’d suggest changing the deployment process instead.

This is rather “risky” from my personal point of view to have a node application running and deleting the node_modules folder. You may will experience other unexpected issues outside of @nestjs/terminus with this deployment process.