-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
after upgraded ioredis from 4.10.0 to 4.11.1 Error: connect ETIMEDOUT #918
Comments
is there any debug info to see what is going on on the behind? because on my laptop it can connect, but with on my server it is giving this error, but when i revert to 4.10.0, it works. so werid! |
Debug info can be enabled by setting the env variable DEBUG=ioredis:* node yourapp.js |
thanks. I connect with 4.11.1, but I cannot connect, no more debug info, so bad:
with using ip and port, same error:
When I revert again to 4.10.0, it works, how come? |
on 4.10.0, my logs shows it is working:
what did i do wrong? |
Can you connect via IP & port successfully? What the debug logs with 4.10.0? |
of course i can connect (ip and porot) even via my laptop. that is what is super weird:
|
all same nodejs 12.5.0 both laptop and server. why does it not give more debug info. it just timeouts, but only with 4.11.1. no one will be able to help with this weird error. this looks right and everything is perfect. |
Yes, that's really strange. The related part is https://github.com/luin/ioredis/blob/v4.11.1/lib/redis/index.ts#L278-L307. We invoke |
how can i debug the actual connecting is not working?
|
where can i see the actual connecting is happening, becuase there is something that is not working. |
it is working up to 4.10.4, there is something that changed since 4.11.0, that is what is start stop working. |
can i compare 4.10.4 vs 4.11.0 connecting? something is wrong |
Listeners for "data" are set up on the "connect" event in v4.11.0. That may not be the reason for that, though, could you please add a
I'd like to confirm that in 4.11.0, did "redis://:[email protected]:6379/0" and "redis+unix://:password@/var/run/redis/redis-server.sock?db=0" both emit timeouts, or only one emited and the other connected successfully?
Could you log the const redis = new Redis(settings.url)
console.log(redis.options) |
the only difference is, that on ubuntu it is working in latest ioredis version, but the server is on debian buster. |
See en the log a werid log
|
of course on debian 4.10.4, it works perfectly. |
i added |
|
oh yes, both ways is timeout (socket vs port), only other error was when, i ran without permission on the boot program and was giving permission error, but i run on server with |
of course on systemd, i use a differen user, that is in the redis group so there is no socket permission problem, but as now i am running it with in cli. i have to run on 4.10.4 on systemd, otherwise it is not working. so weird. i added |
Weird error:
|
Well, this error is pretty hard to debug without a reproducible example. I'll set up a Debian buster on my side to see whether I can reproduce the issue. Let me know for further discoveries if you got time to debug on this issue 😄 . |
there is a docker error, with redacted error, but on docker and ubuntu: |
very rarely, i could connect, but when i control + c, and run again, same timeout error. |
ok i found the error, when i set the host to localhost, instead of 127.0.0.1, it works right away. so weird and with socket is again timeout. so i keep the localhost and via port. |
Did |
ok, that is the issue, not working with socket anymore (v4.10.0) no issues, and if i use an ip address, giving timeout, if i use localhost, then it works fully! |
in 4.10.4 it was working with even socket and 127.0.0.1, with 4.11.1, i could only connect with host and localhost. |
this error is super hard to find the solution, as i have another program and i connect via 192.168.23.54 and it works! |
Are Node.js versions same when switching between 4.10.4 & 4.11.1? |
both nodejs 12.5.0, same versions yes. |
i think it is a warning people for same error, but the code in ioredis is perfect, it is supposed to work and other program it also working any ip address. it is not even worth it trying to fix it as it is correct, just it is a good not for other people that are getting timeouts without any solutions and at least i found that with localhost host it started working. |
I'm having this issue as well, in AWS using lambda to run code, with redis hosted in a single-node cluster in elasticache. I can confirm it breaks between ioredis versions 4.10.4 and 4.11.0. I will try to get a log with debugging turned on shortly. |
Notes:
Here's a log with debugging:
|
@jeremytm Sorry for the late response. It's a little hard to debug without a reproducible example. I tried to test on my side but failed. What the Node.js version did your lambda used? |
I will make a new test function, strip our project back just enough so it's still reproducible and I will provide sample project, and probably a video of how to get it to break. Should be today or tomorrow. |
This actually breaks my tests in the incomplete cluster as well, cant connect indefinitely when upgrading from 4.10.4 to 4.11.x Generally I spin https://hub.docker.com/r/makeomatic/redis-cluster and then try to connect to it using lazyConnect: true & manual connect Unless cluster is stabilized & running (ie enough time had passed for it to start) ioredis will hang indefinitely |
@AVVS try using |
I also noticed ioredis-related script hangs showing up with 4.11.1 with a single local redis server, no cluster or replication on Node.js 12.5.0. It only very rarely shows in my tests, like one in 50 calls of a rather complex integration testing script. Can not reproduce via trivial scripts. Edit: output of
After the |
In my testing today I have whittled it down to being related to the Bluebird promise library, or at least related somehow to promises. If I remove Bluebird and use native promises, ioredis 4.11.x runs fine over 300 connection attempts, every time. With Bluebird it fails easily on one of the connection attempts, and we get ETIMEDOUT. ioredis 4.10.4 works fine with Bluebird promises. So something in ioredis 4.11.x doesn't play nice with Bluebird for sure. I have to wrap up work for this week, but I will finalise the sample code and post it up on Monday. |
@jeremytm thanks so much for you help, because i could not fix it with properly. besides i want to use sockets vs using ports as socket is much faster. but what was weird was that i had to use localhost vs 127.0.0.1 started working, but it was such as ugly fix. |
@jeremytm Thanks for the details and narrowing down the causes to the problem to Bluebird! I have successfully reproduced the issue just now according to your investigation. It turns out that there's a race condition when making connections in 4.11.x, which will happen easier with Bluebird & Unix socks. I'll release a new version to fix this issue today. |
There's a race condition when making connections in 4.11.x, which will happen easier with Bluebird & Unix socks. Thank you to @jeremytm & @p3x-robot. Close #918
There's a race condition when making connections in 4.11.x, which will happen easier with Bluebird & Unix socks. Thank you to @jeremytm & @p3x-robot. Close #918
🎉 This issue has been resolved in version 4.11.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
i have confirmed, it is working now with 4.11.2 via socket! :) |
Confirmed. Thanks heaps! |
## [4.11.2](redis/ioredis@v4.11.1...v4.11.2) (2019-07-13) ### Bug Fixes * ETIMEDOUT error with Bluebird when connecting. ([#925](redis/ioredis#925)) ([4bce38b](redis/ioredis@4bce38b)), closes [#918](redis/ioredis#918)
error:
With 4.10.0 it works.
How I connect:
with 4.10.0 i can connect either url, with 4.11.0 i get timeout.
The text was updated successfully, but these errors were encountered: