Help with ENOTFOUND error on first time deploy of Strapi v4

Hi! This is my first time deploying Strapi v4 on render.

Combining information from the Strapi on Render deployment guide and the Strapi v4 documentation, I believe that I have everything configured correctly to have Strapi v4 deployed on render.

However, I am running into a consistent error when running yarn start:
Error: getaddrinfo ENOTFOUND dpg-c8pv9nfh8vl7rvmq45gg at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)

I looked into the error, and I believe that is it DNS related. the dpg... string is in fact the name of my db instance for this project, and it appears to be saying that node cannot resolve the hostname.

I did a test by adding some logic to my project that would log on build:

const dnscheck = dns.lookup('dpg-c8pv9nfh8vl7rvmq45gg', function (err, addresses, family) {
  console.log(`dns err: ${err}`);
  console.log(`dns address: ${addresses}`);
});

This code uses Node’s dns module directly to attempt to look up the name of my database, and when I ran this code, it also returned the same ENOTFOUND error.

This leads me to believe that Render is not properly presenting the name of my db server to my node application. How do I address this?

Hey there,
First thing I’d ask you to check is that both your services are in the same region. We don’t yet have cross regional support so it’s likely that your services have accidentally been deployed into different regions and your API is not able to resolve the PG DB name as it’s in a different region

Let me know

1 Like

Ah, that is very likely the cause then.

In my render.yaml, I specified the Ohio region for my node service, but I did not specify it for my database, and I see that it is deployed in Oregon. Please allow me a few minutes to try setting the region on the DB and re-deploying. I will update this thread with the results.

That follows - the default region is Oregon if it’s not specified. You’ll need to make sure you specify it for all services in the blueprint so it matches.

John B

1 Like

Thank you so much for the fast reply, as soon as I fixed the regions, the deploy was successful and I could reach my app!

Hope you have a great day, and I look forward to experimenting more and eventually going live on Render :slight_smile:

2 Likes