0

Trying to migrate some resources from Cloud functions to App Engine.

Problem: When I send a request from another Nodejs server to app deployed to App Engine,

await axios.get("https://project-id.uc.r.appspot.com/hey")

it gives error:

(node:13088) UnhandledPromiseRejectionWarning: Error: getaddrinfo ENOTFOUND
project-id.uc.r.appspot.com project-id.uc.r.appspot.com:443
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)

What I've tried and verified:

  1. Requests from Nodejs -> App Engine fail
  2. Requests from Browser -> App Engine pass
  3. Replaced Axios with node-fetch, still same error.

Update:

Everything seems to be working as expected when I connected custom domain name.

A problem with Nodejs not being able to resolve "x.y.z.appspot.com" domain? Kinda sus.

itsam
  • 301
  • 2
  • 10
  • Are those App Engine services deployed in standard environment or flexible environment? – Jofre Nov 02 '20 at 15:15
  • Standard environment (F2) – itsam Nov 02 '20 at 16:16
  • Is you other node server also in App Engine? Or where is it running? If it's running on App Engine, you can try to call the explicit version and service as indicated on [the docs](https://cloud.google.com/appengine/docs/standard/nodejs/communicating-between-services) `https://VERSION_ID-dot-SERVICE_ID-dot-PROJECT_ID.REGION_ID.r.appspot.com`. – Jofre Nov 02 '20 at 17:02
  • Cloud functions as well as localhost (Express), same error in both environments. – itsam Nov 03 '20 at 10:47
  • Can you try npm install express? – v1gnus Nov 26 '20 at 22:24

0 Answers0