question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CacheModule kills app if theres no redis connection

See original GitHub issue

I’m submitting a…


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

Current behavior

Currently when i’m using CacheModule.register and redis connection fails, the server exits with an error:

Error: Redis connection to redis:6379 failed - getaddrinfo ENOTFOUND redis redis:6379
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)

Expected behavior

Handle the error to just log the error and not break the entire app, maybe add a retry exponentially.

Minimal reproduction of the problem with instructions

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

Environment


Nest version: 5.4.0

 
For Tooling issues:
- Node version: v10.6.0  
- Platform: Mac 

Others:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kamilmysliwieccommented, May 10, 2019

I think we should keep this opened to solve this problem out-of-the-box

1reaction
yogevlahyanicommented, May 10, 2019

@atte-backman I tried it but inside a service, seems that inside the AppModule it doesn’t breaks the app, Thanks!! 💯

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kill nestjs - node.js process while lost redis connection ...
It means that the app will be still alive and nothing happen if the redis connection will be restored, I won't be able...
Read more >
What if Redis Stops Working - How Do I Keep My App Running
An interesting question came up on the CacheManager repository in issue 146. What do I do, if the Redis server dies and might...
Read more >
express-redis-cache-ee-bug-fix - npm
A module to make Express interact with Redis (create, get, delete). You can automatically cache all your most popular routes in Redis.
Read more >
Advanced NestJS techniques — Part 4 — Logging Redis ...
In our quest to log every call to services our NestJS app depends on, today we'll look at how to log Redis commands....
Read more >
Teleport Changelog | Teleport Docs
When accepting Application Access requests, Teleport did not sufficiently validate client ... Teleport 9 added Redis protocol support to Database Access.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found