Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credential error? #14

Closed
zcysxy opened this issue Jan 27, 2024 · 1 comment
Closed

Credential error? #14

zcysxy opened this issue Jan 27, 2024 · 1 comment

Comments

@zcysxy
Copy link

zcysxy commented Jan 27, 2024

Hi! I got the following error when I ran the code. I have enabled the APIs and set up the service account accordingly. Do you have any clues about what's causing the issue? Thanks!

/Users/ce/Downloads/google-indexing-script/node_modules/gaxios/build/src/gaxios.js:148
                : new common_1.GaxiosError(e.message, opts, undefined, e);
                  ^

GaxiosError: request to https://www.googleapis.com/oauth2/v4/token failed, reason:
    at Gaxios._request (/Users/ce/Downloads/google-indexing-script/node_modules/gaxios/build/src/gaxios.js:148:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async GoogleToken.requestToken (/Users/ce/Downloads/google-indexing-script/node_modules/gtoken/build/src/index.js:230:23)
    at async GoogleToken.getTokenAsync (/Users/ce/Downloads/google-indexing-script/node_modules/gtoken/build/src/index.js:137:20)
    at async JWT.refreshTokenNoCache (/Users/ce/Downloads/google-indexing-script/node_modules/google-auth-library/build/src/auth/jwtclient.js:165:23)
    at async JWT.authorizeAsync (/Users/ce/Downloads/google-indexing-script/node_modules/google-auth-library/build/src/auth/jwtclient.js:146:24)
    at async getAccessToken (file:///Users/ce/Downloads/google-indexing-script/src/shared/auth.mjs:20:18)
    at async file:///Users/ce/Downloads/google-indexing-script/src/index.mjs:22:21 {
  config: {
    method: 'POST',
    url: 'https://www.googleapis.com/oauth2/v4/token',
    data: {
      grant_type: '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.',
      assertion: '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.'
    },
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'User-Agent': 'google-api-nodejs-client/9.4.2',
      'x-goog-api-client': 'gl-node/21.1.0',
      Accept: 'application/json'
    },
    responseType: 'json',
    paramsSerializer: [Function: paramsSerializer],
    body: '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.',
    validateStatus: [Function: validateStatus],
    errorRedactor: [Function: defaultErrorRedactor]
  },
  response: undefined,
  error: FetchError: request to https://www.googleapis.com/oauth2/v4/token failed, reason:
      at ClientRequest.<anonymous> (/Users/ce/Downloads/google-indexing-script/node_modules/node-fetch/lib/index.js:1501:11)
      at ClientRequest.emit (node:events:515:28)
      at TLSSocket.socketErrorListener (node:_http_client:495:9)
      at TLSSocket.emit (node:events:515:28)
      at emitErrorNT (node:internal/streams/destroy:151:8)
      at emitErrorCloseNT (node:internal/streams/destroy:116:3)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
    type: 'system',
    errno: 'ETIMEDOUT',
    code: 'ETIMEDOUT'
  },
  code: 'ETIMEDOUT'
}

Node.js v21.1.0
@goenning
Copy link
Owner

It’s a timeout / network error, nothing we can do on the script to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants