Redis in 5.8.0 on Mac anyone having this behaviour?

I have been getting similar errors. If you are using Docker, try stopping and restarting the local Docker node server. If that doesn’t work, restart Wappler. There seems to be a timing issue with Redis not restarting when node server restarts after a page is saved.

Ok, so we also need to see your Docker dashboard, to see if the Redis container is running. If not using Docker Desktop, the docker ps command also works

P.S.: To clarify guptast’s post above, Redis never restarts after you save a page, that’s just NodeJS. What could be happening is NodeJS tries to use Redis stuff before it has a chance to connect to it (race condition). However, because we’re seeing a timeout in the NodeJS logs, this can’t be a race condition issue

1 Like

Here is my Docker Dashboard containers for this project:

I’ve exhausted all my help abilities regarding this issue. Good luck :wink:

(probably a bug)

Thanks all for taking a look ill convert this topic into a bug report for the team to have a look over :slight_smile:

Can you share your connection string?

And you can try if this helps Socket Error in Library Actions

Have you executed “deploy” on this target so that the new node modules get installed? Or at least “install node modules” command from the bottom publishing toolbar.

I tried installing updating deploying etc

I’ll have a look at this and get the string when I’m near my Mac again in a little bit if it is still needed by then :grin:

Updated my socket file with Patricks solution in: Socket Error in Library Actions still getting the same error as before in Web server logs:

Here is the connection string
redis://redis

At this point I wonder if the Wappler team changed something in the docker-compose files, namely the network configuration label(s)

Okay I have been doing some more tests and what I seem to be finding is when I deploy it tends to give the error, if I restart the containers using the restart in Wappler it occasionally will start working seems to work more often with debug mode off but could be coincidence.

However if I deploy and get the error simply toggling debug mode in server connect settings either way seems to be getting it working pretty much every time. Thought I’d share incase this was of any use this could all be coincidence etc but worth a shot

Try to edit the docker-compose.yml file, it should be located in .wappler/targets/{target_name}.

The file lists all the docker services, under web it has a section depends_on, add redis to it.

    depends_on:
      - 'db'
      - 'redis'

we will add the dependency automatically in the next update

Edited my docker-compose unfortunately i still receive the same error when i hit deploy

Does it make a connection when you only restart the web-1 image? It just looks like the redis server didn’t start completely when the node server tries to connect to it.

You can test with setting the timeout higher, the default timeout is only 5 seconds.

In the file setup/config.js line 86, change it to:

const client = createClient({
  url: config.redis === true ? 'redis://redis' : config.redis,
  socket: {
    connectTimeout: 30000
  }
});

That should set a timeout of 30 seconds.

Just tested this it manages to connect a lot more now but it did fail once, I have also noticed that a lot of times at the very start of the web server logs there is this error:

This error message below however has only showed once so far with the 30 seconds and tends to now be a successful connect even thought at the very start of the logs is the error (I cleared the logs before each deploy)

What now normally shows even though at the top of the logs has the error (this is very bottom of the logs):

1 Like

I’ve seen the same errors intermittently with the latest release.

I will set the timeout to 60 seconds for the next update, that should be more than enough for some slow starting redis server.