New Error in 5.8.0: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379

After upgrading I noticed that my preloader would not resolve. I thought this may have been due to testing an externally hosted redis db, but am seeing it in Docker-hosted redis environments as well. The site seems to function properly in general but this error appears constantly in the web server logs.

[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)

Any ideas?

After some additional testing - the error does seem to be preventing Server Connect components that have the “Live Refresh from Sockets” dynamic attribute enabled from successfully resolving and rendering results on the page.

I am also getting redis and socket connection errors in 5.8.0. Perhaps these are related to the error you are getting. There are no errors in the dev console except in the web server logs and the web page is not rendering any content.

We don’t use ioredis, did you change the redis package to ioredis yourself? The redis client failed to connect to the redis server, that is also causing the other errors since the sockets depend on the redis server.

Hi Patrick, in my case, there’s no change to the redis package. I’m using native redis package.

It seems that the client got a timeout when trying to connect to the redis server. Do you use redis in a docker container, was it perhaps not yet started while the node server started. Try restarting the node server.

Timeout certainly seems to be the reason for this error. I think it’s happened right after I saved a content page in Wappler and refreshed the page in the browser. The web page loads correctly once I close and reopen Wappler.

I definitely didn’t make a conscious change to ioredis. I’m using the Bull queue extension could that where it was introduced?

I was also experimenting with hosted redis on digital ocean ( though not in production where I’m also seeing the issue. Seems similar to this: https://stackoverflow.com/questions/65645805/how-to-fix-the-econnreset-ioredis-error-in-adonisjs-during-deployment I’ll continue to investigate

Concerning the server where this particular error occurs, where is Redis server running? Is it running as a Docker container? Or have you installed it by yourself on the server?

It’s trying to connect to 127.0.0.1, which is incorrect if it’s running inside a Docker container

The ioredis error was due to a conflict between the new Wappler version and the bull queues extensions. A hotfix for both bull queues extensions just went out.

1 Like

Thanks Tobias. I’m still hitting the above error after updating the package. However, I’m unsure why it’s attempting to connect to 127.0.0.1. I’ll keep investigating.

Hey guys, just waking up over here. :coffee:

@tbvgl thanks for the hotfix.

I had the same issue when I upgraded the redis client to version 4, it is the default host where it is connecting to. In our case it was that the options for the client changed, in version 3 it was new Redis("redis://redis") and in version 4 it became new Redis({ url: "redis://redis" }). So it looks that in your case also the options for the redis client is probably incorrect.

1 Like

Thanks! Do you know where I should look to check those settings?

I found the issue. It was still the bull extension, and the issue lies in operator precedence. I applied a fix to V2 and will push that to GitHub. I won’t have time to update V1.

The new Wappler update handles the config a little differently. I guess that was done so that it works with the new Redis client, but it breaks Ioredis connections:

1 Like

Frank, what are the details of your setup that is not working? Bull v1 uses either env variables or the redis client from Wappler. I can’t find a use case where it breaks, using the hotfix from Tobias.

Right now I receive the [idredis] error just about every second in all of my project environments. I don’t think at this point that I have any configuration or customizations that I’ve made. I updated the wappler-bull-queues extension via npm. It’s possible that I didn’t perform the upgrade from v1 to v2 of wappler-bull-queues correctly but things look ok when comparing files.

I find references to config.redis in two files: config.js and redis.js my config.js looks the same as Tobias’s screen shot. However redis.js still has the old syntax

I manually updated it to match the config.js and it didn’t make a difference, but I’m not sure whether this is indicative of other issues with the project.

So you are now using Bull v2? If so, I’ll leave that for @tbvgl.

1 Like