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.

ConnectionTimeoutError: Connection timeout

See original GitHub issue

I get this error and I don’t understand why:

How do I get more details about this:

/mnt/c/dev/client-adapter/node_modules/redis/dist/lib/socket.js:157
            socket.setTimeout(__classPrivateFieldGet(this, _RedisSocket_options, "f").connectTimeout, () => socket.destroy(new errors_1.ConnectionTimeoutError()));
                                                                                                                           ^
ConnectionTimeoutError: Connection timeout
    at Socket.<anonymous> (/mnt/c/dev/client-adapter/node_modules/redis/dist/lib/socket.js:157:124)
    at Object.onceWrapper (node:events:513:28)
    at Socket.emit (node:events:394:28)
    at Socket.emit (node:domain:475:12)
    at Socket._onTimeout (node:net:486:8)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7)
[nodemon] app crashed - waiting for file changes before starting...

Environment

─❯ node -v 
v16.6.2

─❯ redis-server -v 
Redis server v=5.0.7 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=636cde3b5c7a3923

─❯ lsb_release -a   
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:22

github_iconTop GitHub Comments

8reactions
Chocobozzzcommented, Jan 4, 2022

Hello,

We had this issue on our project. The root cause is that we try to .connect(), and then require many node modules blocking the node loop with sync calls. The socket is blocked and the timeout is thrown. I suggest you to profile your applications to find if it’s the same kind of error.

1reaction
depak379mandalcommented, Nov 24, 2022

Got the may Be,

According to me this is issue because of race condition of async tasks. So to overcome that we can just go with await or we can connect to socket or server after

 redisClient.connect().then(() => {
 // other tasks
})

May be this solves issues then I am glad.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ConnectionTimeoutError: Connection timeout #1656 - GitHub
I get this error and I don't understand why: How do I get more details about this: ...
Read more >
redis not working ConnectionTimeoutError: Connection timeout
Generally when you get a connection timeout error, it's due to connection problem usually network related. It will be helpful if you could ......
Read more >
Redis::TimeoutError: Connection timed out Error -Rails cache
We are experiencing crashes in our app due to redis connection timeout.We have three app servers and use phusion passenger.
Read more >
Set the connection timeout when using Node.js - Google Cloud
Configure a connection timeout when connecting to Cloud SQL for MySQL by using the Node.js npm mysql module.
Read more >
What Does a Server Connection Timeout Mean?
A server connection timeout error does little to tell you what went wrong or why the error happened: it just identifies that the...
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