assistant-sdk-nodejs icon indicating copy to clipboard operation
assistant-sdk-nodejs copied to clipboard

Error: 14 UNAVAILABLE: Getting metadata from plugin failed with error: invalid_client

Open itachiRedhair opened this issue 6 years ago • 2 comments

In the project credentials are retrieved from home directory as follows:

const homedir = require('homedir');
const deviceCredentials = require(`${homedir()}/.config/google-oauthlib-tool/credentials.json`);

What I am trying to do is populating deviceCredentials Directory in the code itself:

const deviceCredentials = {
  client_secret: 'xxxxxxxxxxx',
  refresh_token: 'xxxxxxxxxxx',
  scopes: ['https://www.googleapis.com/auth/assistant-sdk-prototype'],
  client_id: 'xxxxxxxxxxxxxxx',
  token_uri: 'https://accounts.google.com/o/oauth2/token',
};

I am getting following error:

Auth error:Error: invalid_client
{ Error: 14 UNAVAILABLE: Getting metadata from plugin failed with error: invalid_client
    at Object.exports.createStatusError (/home/akshay/Desktop/Workspace/assistant-sdk/remoteAssistant/node_modules/grpc/src/common.js:87:15)
    at ClientDuplexStream._emitStatusIfDone (/home/akshay/Desktop/Workspace/assistant-sdk/remoteAssistant/node_modules/grpc/src/client.js:235:26)
    at ClientDuplexStream._receiveStatus (/home/akshay/Desktop/Workspace/assistant-sdk/remoteAssistant/node_modules/grpc/src/client.js:213:8)
    at Object.onReceiveStatus (/home/akshay/Desktop/Workspace/assistant-sdk/remoteAssistant/node_modules/grpc/src/client_interceptors.js:1290:15)
    at InterceptingListener._callNext (/home/akshay/Desktop/Workspace/assistant-sdk/remoteAssistant/node_modules/grpc/src/client_interceptors.js:564:42)
    at InterceptingListener.onReceiveStatus (/home/akshay/Desktop/Workspace/assistant-sdk/remoteAssistant/node_modules/grpc/src/client_interceptors.js:614:8)
    at /home/akshay/Desktop/Workspace/assistant-sdk/remoteAssistant/node_modules/grpc/src/client_interceptors.js:1110:18
  code: 14,
  metadata: Metadata { _internal_repr: {} },
  details:
   'Getting metadata from plugin failed with error: invalid_client' }
Error: Error: 14 UNAVAILABLE: Getting metadata from plugin failed with error: invalid_client
    at getAssistantResponse (/home/akshay/Desktop/Workspace/assistant-sdk/remoteAssistant/server.js:34:11)

itachiRedhair avatar Jul 18 '18 03:07 itachiRedhair

How are you obtaining the deviceCredentials values? There may be an issue with how you obtained the client_id.

Fleker avatar Jul 18 '18 17:07 Fleker

have you solve this issue?

jawwadturabi avatar May 17 '19 11:05 jawwadturabi