Can't resolve DNS of a redis service

Hey Team!

I have a render.yml file which defines two services: node-based web and redis. When the web app tries to access the redis instance I get the following error:

getaddrinfo ENOTFOUND red-ca3njvt0mal8a8sl5kug

I thought that it might be an issue with mixed regions, but my render.yml specifies region for the web app and the redis and the region is the same (Ohio).

Here’s an excerpt from my render.yml (I omitted ENV variables):

previewsEnabled: true
services:
  - type: web
    name: mainApp
    plan: free
    env: node
    region: ohio
    buildCommand: npm ci && npm run build && npm run s3:push-dist && npm run set-git-sha
    startCommand: npm run node-server
    healthCheckPath: /api/status
    envVars:
      - key: REDIS_URL
        fromService:
          type: redis
          name: prReviewApp
          property: connectionString
        # access-keys group is defined in the Render UI. We can't define it here too because
        # this would recreate the group for a preview app and not use the ENVs already defiend.
      - fromGroup: access-keys
  - type: redis
    name: prReviewApp
    ipAllowList: [] # only allow internal connections
    plan: free
    region: ohio

Do I miss something?

Of course, right after posting the question, I was able to identify the issue. It’s not related to the main app not being able to communicate with Redis, looks like that works.

The DNS error shows up when I merge a PR and review app is being decommissioned. Apparently, Redis is torn down faster than the app, and the app loses the connection to the Redis instance, thus raising the error.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.