Skip to content
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

TypeOrmHealthIndicator always returning up (with no mongodb connection) #547

Closed
j3bb9z opened this issue Feb 4, 2020 · 3 comments
Closed

Comments

@j3bb9z
Copy link

j3bb9z commented Feb 4, 2020

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

TypeOrmHealthIndicator always returns positive result, whether it is connected to MongoDB, or not.

options passed:

    {
      url: '/health',
      healthIndicators: [
        async () => this.db.pingCheck('database', { timeout: 200 }),
      ],
    }

health result:

{"status":"ok","info":{"database":{"status":"up"}},"details":{"database":{"status":"up"}}}

Expected behavior

It should return error if there is no connection to the MongoDB.

Minimal reproduction of the problem with instructions

I prepared basic example here:
https://github.com/jacob87o2/nest/tree/terminus-typeorm-health-issue-reproduction/sample/13-mongo-typeorm

After downloading/cloning the repo, go to the folder above and:

  1. Install dependencies (npm install)
  2. Run mongodb (docker-compose up -d)
  3. Run NestJS (nest start)
  4. Stop mongodb (in separate terminal - docker-compose down)
  5. Check health endpoint (go to http://localhost:3000/health)

What is the motivation / use case for changing the behavior?

Environment


[Nest Information]
terminus version         : 6.5.5
typeorm version          : 6.2.0
common version           : 6.7.2
core version             : 6.7.2

@BrunnerLivio
Copy link
Member

Thank you for this report, I can reproduce the error. Will fix asap!

@BrunnerLivio
Copy link
Member

Fixed in 6.5.6 🎉

@j3bb9z
Copy link
Author

j3bb9z commented Feb 9, 2020

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants