I’m attempting to use the App platform to deploy a GraphQL API made with Apollo Server as a web service. When Adding in System ENV vars, I get this error message:
Error: getaddrinfo ENOTFOUND https://osdm-api-r44fl.ondigitalocean.app/api
osdm-api | 08:46:54 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26)
osdm-api | 08:46:54 Emitted 'error' event on Server instance at:
osdm-api | 08:46:54 at GetAddrInfoReqWrap.doListen [as callback] (net.js:1499:12)
osdm-api | 08:46:54 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:17) {
osdm-api | 08:46:54 errno: 'ENOTFOUND',
osdm-api | 08:46:54 code: 'ENOTFOUND',
osdm-api | 08:46:54 syscall: 'getaddrinfo',
osdm-api | 08:46:54 hostname: 'https://osdm-api-r44fl.ondigitalocean.app/api'
osdm-api | 08:46:54 }
I’m using $_self.PUBLIC_URL to grab the URL at build time. I’m able to get PRIVATE_PORT & PUBLIC_ROUTE_PATH without any issue.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
It looks like you’re application code is trying to run a getaddrinfo call against the string “https://osdm-api-r44fl.ondigitalocean.app/api”. getaddrinfo expects a clean hostname (without the https:// prefix and /api route). You may want the ${APP_DOMAIN} binding instead of $APP_URL or ${service.PUBLIC_URL}.
If you’re trying to determine which addressed to bind your service to, you should be able to use “0.0.0.0:$PORT” which listens on all interfaces, and selects the port based on the $PORT variable which is passed in.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.