googleapis / google-auth-library-nodejs

🔑 Google Auth Library for Node.js
Apache License 2.0
1.73k stars 383 forks source link

error: {"message":"request to https://oauth2.googleapis.com/token failed, reason: ","type":"system","errno":"ETIMEDOUT","code":"ETIMEDOUT"} #1855

Closed wenshan closed 2 months ago

wenshan commented 2 months ago

config: {"retry":true,"retryConfig":{"httpMethodsToRetry":["GET","PUT","POST","HEAD","OPTIONS","DELETE"],"currentRetryAttempt":2,"retry":3,"noResponseRetries":2,"statusCodesToRetry":[[100,199],[429,429],[500,599]]},"method":"POST","url":"https://oauth2.googleapis.com/token","data":"<<REDACTED> - SeeerrorRedactoroption ingaxiosfor configuration>.","headers":{"Content-Type":"application/x-www-form-urlencoded","User-Agent":"google-api-nodejs-client/9.14.0","x-goog-api-client":"gl-node/20.11.0"},"body":"<<REDACTED> - SeeerrorRedactoroption ingaxios` for configuration>.","responseType":"unknown"} response: undefined error: {"message":"request to https://oauth2.googleapis.com/token failed, reason: ","type":"system","errno":"ETIMEDOUT","code":"ETIMEDOUT"} code: "ETIMEDOUT" headers: {"Access-Control-Allow-Origin":"http://127.0.0.1:8000","Access-Control-Allow-Credentials":"true","vary":"Origin"} headerSent: true name: "ETIMEDOUTError" pid: 73113 hostname: hou-vedeMacBook-Pro.local

2024-08-27 19:59:45,665 ERROR 73113 [-/undefined/-/227762ms POST /api/googleOauth/getToken] nodejs.ETIMEDOUTError: request to https://oauth2.googleapis.com/token failed, reason: at Gaxios._request (/Users/hou/work/affiliate-traffic-service/node_modules/gaxios/build/src/gaxios.js:149:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async OAuth2Client.getTokenAsync (/Users/hou/work/affiliate-traffic-service/node_modules/google-auth-library/build/src/auth/oauth2client.js:158:21) at async GoogleOauthController.getTokenLibrary (/Users/hou/work/affiliate-traffic-service/app/controller/googleOauth.js:135:26) at async /Users/hou/work/affiliate-traffic-service/node_modules/egg-development/app/middleware/egg_loader_trace.js:9:50 at async xframe (/Users/hou/work/affiliate-traffic-service/node_modules/egg-security/lib/middlewares/xframe.js:7:5) at async xssProtection (/Users/hou/work/affiliate-traffic-service/node_modules/egg-security/lib/middlewares/xssProtection.js:7:5) at async nosniff (/Users/hou/work/affiliate-traffic-service/node_modules/egg-security/lib/middlewares/nosniff.js:8:5) at async noopen (/Users/hou/work/affiliate-traffic-service/node_modules/egg-security/lib/middlewares/noopen.js:8:5) at async session (/Users/hou/work/affiliate-traffic-service/node_modules/koa-session/index.js:41:7) config: {"retry":true,"retryConfig":{"httpMethodsToRetry":["GET","PUT","POST","HEAD","OPTIONS","DELETE"],"currentRetryAttempt":2,"retry":3,"noResponseRetries":2,"statusCodesToRetry":[[100,199],[429,429],[500,599]]},"method":"POST","url":"https://oauth2.googleapis.com/token","data":"< - See errorRedactor option in gaxios for configuration>.","headers":{"Content-Type":"application/x-www-form-urlencoded","User-Agent":"google-api-nodejs-client/9.14.0","x-goog-api-client":"gl-node/20.11.0"},"body":"< - See errorRedactor option in gaxios for configuration>.","responseType":"unknown"} response: undefined error: {"message":"request to https://oauth2.googleapis.com/token failed, reason: ","type":"system","errno":"ETIMEDOUT","code":"ETIMEDOUT"} code: "ETIMEDOUT" headers: {"Access-Control-Allow-Origin":"http://127.0.0.1:8000","Access-Control-Allow-Credentials":"true","vary":"Origin"}`

This is the error in the node framework. This problem has occurred many times, why hasn't it been addressed.

wenshan commented 2 months ago

The problem has been found. The Chinese government has blocked all Google services. The only option is to change the server.