library icon indicating copy to clipboard operation
library copied to clipboard

Not containing client_email field

Open HarukiKinoshita opened this issue 4 years ago • 2 comments

Context (Environment)

When starting the local server with npm run watch I got the message saying not containing client_email field. I guess this has to do with Google OAuth. Am I the only one struggling with this error?

v1.4.1 Node: v15.8.0

Expected Behavior

(local server running correctly)

Actual Behavior

debug: updating tree...
warn: failed updating tree 
{
   message: 'The incoming JSON object does not contain a client_email field',
   stack: 'Error: The incoming JSON object does not contain a client_email field\n' +
     '    at JWT.fromJSON (/Users/kinoshitaharuki/dev/library/node_modules/google-auth-library/build/src/auth/jwtclient.js:195:19)\n' +
     '    at GoogleAuth._cacheClientFromJSON (/Users/kinoshitaharuki/dev/library/node_modules/google-auth-library/build/src/auth/googleauth.js:301:16)\n' +
     '    at ReadStream.<anonymous> (/Users/kinoshitaharuki/dev/library/node_modules/google-auth-library/build/src/auth/googleauth.js:336:40)\n' +
     '    at ReadStream.emit (node:events:378:20)\n' +
     '    at endReadableNT (node:internal/streams/readable:1307:12)\n' +
     '    at processTicksAndRejections (node:internal/process/task_queues:81:21)'
}

HarukiKinoshita avatar Oct 11 '21 02:10 HarukiKinoshita

Hi @HarukiKinoshita, would you mind sharing the names of the environment variables you have set in your .env? (Please don't send over the values, those are private!) It seems like something might be slightly misconfigured.

afischer avatar Oct 27 '21 18:10 afischer

Hello @afischer, I've just sorted out the problem! I mistakenly put OAuth credentials, not the service account credentials, into .auth.json. Sorry for that.

~Just one more thing... Heroku builds successfully, but it gets an application error when visiting the application URL. It happens when deploying from my GitHub repo / directly from Heroku CLI. It didn't happen in the initial deploy (from Deploy to Heroku button). Do you have any thoughts?~ Ugh... Fixed it. Must have something to do with npm version difference (specify npm 6.x instead of >=6.5.x)

heroku logs --tail
~~~~~~~~~~
2021-10-29T08:24:37.343147+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=my_heroku_app_name.herokuapp.com request_id=3b2c2052-d456-4674-bbcd-66c6458a14d3 fwd="138.64.64.138" dyno= connect= service= status=503 bytes= protocol=https

HarukiKinoshita avatar Oct 29 '21 03:10 HarukiKinoshita