Can’t connect to Yandex Cloud Postgres DB from Vercel – getaddrinfo ENOTFOUND
Current versus Expected behavior
- Current behavior:
When trying to connect to a Yandex Cloud Postgres database from my Vercel project, I receive the error:
getaddrinfo ENOTFOUND rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net
This results in a 500 error for all API calls that access the database.
DNS resolution for the Yandex host fails inside Vercel’s environment. - Expected behavior:
The Vercel backend should be able to resolve the Yandex Cloud Postgres hostname and connect successfully, as it works in my colleague’s project with the same setup.
Code, configuration, and steps that reproduce this issue
- Code / Config
I am using standard Postgres connection in Node.js / Next.js API routes (see code snippets below, if required).
My environment variables:
ini
КопироватьРедактировать
POSTGRES_HOST=rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net
POSTGRES_PORT=5432
POSTGRES_DB=FERMA
POSTGRES_USER=lolmeteor
POSTGRES_PASSWORD=********
No custom networking or DNS code.
The DB cluster is in Yandex Cloud, open for external connections (public host).
- Steps to reproduce:
- Deploy backend project on Vercel.
- Configure environment variables for Yandex Cloud DB (as above).
- Deploy and call any API endpoint that queries the database.
- Observe error 500 and log message:
[Error: getaddrinfo ENOTFOUND rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net]
Project information (URL, framework, environment, project settings)
- Vercel project URL:
https://v0-magaz-supabase.vercel.app
(also tried on test deployments) - Framework:
Next.js / Node.js API routes - Environment:
Vercel Serverless Functions, default region - Project settings:
No custom DNS, using standard Vercel/Next.js deployment
Additional notes:
- My colleague has an identical project on Vercel, using the same Yandex Cloud DB cluster and hostname, and everything works fine for him.
- I already checked firewall, whitelists, credentials, public accessibility, and DNS from my local machine (all OK).
- I spent $20+ troubleshooting this without result.
- Please have a real human support engineer review my issue (not an automated reply).
Logs:
Jun 04 14:35:51.89
GET
200
v0-magaz-supabase.vercel.app
/product/t-shirt-1747811562277
Jun 04 14:35:51.89
GET
200
v0-magaz-supabase.vercel.app
/product/t-shirt-1748420095791
Jun 04 14:35:51.89
GET
200
v0-magaz-supabase.vercel.app
/product/t-shirt-1747811660556
Jun 04 14:35:19.45
POST
500
v0-magaz-supabase.vercel.app
/api/yandex-db/users/create
3
Error creating user: [Error: getaddrinfo ENOTFOUND rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net] { errno: -3008, code: ‘ENOTFOUND’, syscall: ‘getaddrinfo’, hostname: ‘rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net’ }
Jun 04 14:35:18.59
GET
200
v0-magaz-supabase.vercel.app
/profile
Jun 04 14:35:18.59
GET
200
v0-magaz-supabase.vercel.app
/cart
Jun 04 14:35:18.46
POST
500
v0-magaz-supabase.vercel.app
/api/yandex-db/users/by-telegram-id
3
Error in users/by-telegram-id: [Error: getaddrinfo ENOTFOUND rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net] { errno: -3008, code: ‘ENOTFOUND’, syscall: ‘getaddrinfo’, hostname: ‘rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net’ }
Jun 04 14:35:15.49
GET
200
v0-magaz-supabase.vercel.app
/
Jun 04 14:33:14.13
GET
200
v0-magaz-supabase-qmppzyyxo-lolmeteor-gmailcoms-projects.vercel.app
/cart
Jun 04 14:33:14.13
GET
200
v0-magaz-supabase-qmppzyyxo-lolmeteor-gmailcoms-projects.vercel.app
/profile
Jun 04 14:33:12.36
GET
200
v0-magaz-supabase-qmppzyyxo-lolmeteor-gmailcoms-projects.vercel.app
/
Jun 04 14:33:12.34
GET
200
v0-magaz-supabase-qmppzyyxo-lolmeteor-gmailcoms-projects.vercel.app
/
Creating user with Telegram ID: 5137953484
Ошибка выполнения запроса к Yandex DB: [Error: getaddrinfo ENOTFOUND rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net] {
errno: -3008,
code: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net’
}
Error creating user: [Error: getaddrinfo ENOTFOUND rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net] {
errno: -3008,
code: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net’
}
Fetching user with Telegram ID: 5137953484
Ошибка выполнения запроса к Yandex DB: [Error: getaddrinfo ENOTFOUND rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net] {
errno: -3008,
code: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net’
}
Error in users/by-telegram-id: [Error: getaddrinfo ENOTFOUND rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net] {
errno: -3008,
code: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘rc1a-hhvlknmp5l43fk7n.mdb.yandexcloud.net’
}
End of template.