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

Error: connect ETIMEDOUT #462

Open
jeffminsungkim opened this issue Mar 16, 2023 · 1 comment
Open

Error: connect ETIMEDOUT #462

jeffminsungkim opened this issue Mar 16, 2023 · 1 comment

Comments

@jeffminsungkim
Copy link

Your issue may already be reported!
Please search on the issue tracker before creating one.

Expected Behavior

AWS ElasticCache connection should be established without having an issue.

Current Behavior

AWS Security Group's inbound rule is open to public (0.0.0.0).


RedisModule.forRootAsync({
    imports: [ConfigModule],
    inject: [ConfigService],
    useFactory: (config: ConfigService) => ({
      config: {
        host: 'aws-elastic-cache-url',
        port: config.get('REDIS_PORT') || 6379,
        password: config.get('REDIS_PASSWORD'),
      },
    }),
  }),

I'm facing the following error.

[Nest] 77739  - 03/16/2023, 5:50:05 PM   ERROR [RedisModule] default: connect ETIMEDOUT +10056ms
Error: connect ETIMEDOUT
    at Socket.<anonymous> (/Users/x/Projects/workspace/backend/node_modules/ioredis/built/Redis.js:170:41)
    at Object.onceWrapper (node:events:627:28)
    at Socket.emit (node:events:513:28)
    at Socket._onTimeout (node:net:562:8)
    at listOnTimeout (node:internal/timers:564:17)
    at processTimers (node:internal/timers:507:7)

If I try with my localhost redis, it works fine.

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • Version used: 9.0.5
  • NestJS version: 9
  • Node.js version: 18.12
  • Operating System and version (macOS, Windows, Linux): macOS
  • Link to your project:
@jeffminsungkim
Copy link
Author

I've heard that the Elasticache is a service designed to be used internally to a specific VPC. Is this the possible reason why the connection issue occurred?

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

No branches or pull requests

1 participant