Redis Error: getaddrinfo EAI_AGAIN redis

Wappler v5.5.3, NodeJS, Linode Docker Deployment, MSSQL

I’m still getting this Redis error when Redis is enabled in the Server Connect settings for the remotely deployed project. The remote project fails to run with this setting. The project runs if I deploy the remote project with Redis disabled in the Server Connect settings.

The bug seems to have been resolved in v5.5.2. Do I need to make any other change to the remote docker deployment for this to work with Redis enabled in the Server Connect settings?

Screen Shot 2023-03-24 at 10.22.31 am

Can you try to open the target settings and save? This will regenerate the docker-compose file

1 Like

That did the trick! The project is running correctly after re-saving / re-deploying the target settings. Thanks @Apple :slightly_smiling_face:

Hi @Apple I hope you had a great Christmas and New Year.

I’m re-igniting this as I’m having the same issue as guptast, my server logs is continuously reporting the same error and I’m a little lost as to resolve it. I’ve tried re-saving the target and then deploying again without any luck. Any chance you might have some additional insights that I can look into?

I’m using Digital Ocean - I also note that the Redis DB does not show up in the DO dashboard, so it’s not a ‘Managed Redis’ DB i’m assuming but one deployed on the server?

Hi @mgaussie,

Thanks for the kind words! Likewise!

Correct.

Any chance you can find a way to check if Redis is running? I suspect Redis could be crashing, so the NodeJS app can’t find Redis. You could try checking Redis logs through Wappler:

Most obvious cause for crashing would be lack of free disk space on the server.

Thank you for the replies Apple! I really appreciate it - I’ve not been able to make any progress and need an external Redis so I can scale horizontally.

I can confirm that Redis is running, logs are clear without error and if I ping the Redis CLI I get ‘Pong’ in return, so there doesn’t appear to be any crashing. It’s just my server logs reported the connection issue.

The error appears to be a networking/auth issue - or perhaps there is a conflict as Wappler appears to be running two Redis containers (I noted as much here in this post: Setting up Managed Redis External DB for prod - having issues, please help! while looking for team support). I’m a bit stuck as I’m not a professional developer, so knowing where or what to look for during more advanced debugging is a challenge!

Destroy everything you created from this tutorial and never follow it again (because it can create confusion when troubleshooting/other people trying to help you):

The way it should be, your project’s docker-compose should have Redis on it, and your NodeJS app will connect to that Redis. Each target has its own docker-compose, so you should double-check. Wappler automatically puts Redis in that docker-compose file once you enable Redis in the project settings (I think). Each project of yours will have its own Redis, instead of a single global Redis for every project (the tutorial I told not to follow)

If in doubt, post the docker-compose file here so we can verify it

Ok, good to know, thank you - my original post (linked) found 3 or 4 different ways to try and set redis up in the Wappler UI. I had no luck, or support on that so chose to follow Wappler documentation. I’ll delete the service created during this Wappler guide.

Here is my current docker-compose:

version: '3'
services:
  web:
    ports:
      - '80:3000'
    restart: 'always'
    stdin_open: true
    tty: true
    logging:
      options:
        max-file: '5'
        max-size: '10m'
    build:
      context: '../../../'
      dockerfile: '.wappler/targets/prod-do-syd/web/Dockerfile'
    depends_on:
      - 'redis'
  redis:
    image: 'redis:alpine'
    hostname: 'redis'
    restart: 'always'
volumes:
  redis-volume: ~

I then have on the prod target ‘Cloud Database’ selected, and the redis service setup selected in the drop down (and then saved) that I created by following the guide.

What I thought I may be able to do was to create a DO Managed Redis DB, and then add the connection parameters and config somewhere, so that production only, would connect to this, instead of the Docker Redis.

I feel you, the docs aren’t the best :frowning:

The docker-compose file looks good, can’t see any obvious problem.

I didn’t understand, I’ll need a screenshot

I’m afraid this exceeds my knowledge, and I lack the time to research this further :frowning:

I think maybe @Cheese uses managed Redis? Maybe he can give you a pointer

Thanks Apple, it doesn’t need to be a fully managed Redis DB, if I can get an external Redis service running as this should achieve the same outcome (scaling horizontally) - I am just hitting a bit of a wall trying to implement this within Wappler, with the error I’m getting.

I wonder if Wappler is causing the issue by setting up a docker containerised Redis as well as trying to connect to the external service setup within the Wappler UI? here is a screenshot of the containers running:

Oh, that would be great re Cheese or anyone that has implemented this. I hope it’s something super simple and obvious that I’m missing.

Just to clarify something, I was focusing on getting the project’s Redis to work, the standard one, not an external one. If the goal is to put the standard Redis to work, the settings in the screenshot you posted need to be changed.

If you’re trying to setup the external Redis, maybe my past instructions don’t apply :sweat_smile:

Good luck! Hope Cheese (or someone else) can help you

1 Like

Got it - thank you Apple for trying to help. I do appreciated it.

Yep, it’s an external service, or externally managed Redis DB that I need running on production target.

I’ll keep chipping away at the problem and hope someone comes to my rescue!

Here is a basic guide:

1 Like

Thanks for the acknowledgement but I’m unfortunately no expert with Redis. It is one of the few things we outsourced privately. One as am overloaded with work and two because I tried and entirely messed it up to the point whereby I had no idea what I had done hahaha.

:slight_smile:

1 Like