Apps
Apps

Reputation: 3389

Dialogflow NodeJS library issue

I'm working on a dialogflow POC where I'm trying to invoke the v2 API provided by DialogFlow. While trying the NodeJS code example provided here, I'm getting the below error

{ Error: EHOSTUNREACH undefined: Getting metadata from plugin failed with error: request to https://www.googleapis.com/oauth2/v4/token failed, reason: connect EHOSTUNREACH 0.0.38.172:80 - Local (192.168.0.103:51468)
    at Object.callErrorFromStatus (/Users/devuser/Development/workspaces/df-poc/node_modules/@grpc/grpc-js/build/src/call.js:30:26)
    at Http2CallStream.call.on (/Users/devuser/Development/workspaces/df-poc/node_modules/@grpc/grpc-js/build/src/client.js:96:33)
    at Http2CallStream.emit (events.js:203:15)
    at process.nextTick (/Users/devuser/Development/workspaces/df-poc/node_modules/@grpc/grpc-js/build/src/call-stream.js:75:22)
    at process._tickCallback (internal/process/next_tick.js:61:11)
  code: 'EHOSTUNREACH',
  details:
   'Getting metadata from plugin failed with error: request to https://www.googleapis.com/oauth2/v4/token failed, reason: connect EHOSTUNREACH 0.0.38.172:80 - Local (192.168.0.103:51468)',
  metadata: Metadata { internalRepr: Map {}, options: {} } }

I have imported GOOGLE_APPLICATION_CREDENTIALS and point the environment variable to the credentials. The invocation works fine if I try the REST API route with the Authorization header. Kindly let me know if there is something which I'm missing here.

Upvotes: 1

Views: 122

Answers (1)

Thoth
Thoth

Reputation: 2276

This means EHOST (the remote host of the files you are requesting) are unreachable. They are either down, or your computer cannot access them due to some other restriction, such as location, which can be solved with a VPN.

Upvotes: 1

Related Questions