googleapis / google-auth-library-nodejs

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

compute: should return a helpful message on request response.statusCode 403 failed #1611

Closed flaky-bot[bot] closed 1 year ago

flaky-bot[bot] commented 1 year ago

Note: #1572 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.


commit: d8e5eb9994d2157a937543ed9f7d911b9e9db413 buildURL: Build Status, Sponge status: failed

Test output
The input did not match the regular expression /A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified. Could not refresh access token./. Input:

'FetchError: request to http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token failed, reason: Nock: No match for request {\n' +
  '  "method": "GET",\n' +
  '  "url": "http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token",\n' +
  '  "headers": {\n' +
  '    "metadata-flavor": [\n' +
  '      "Google"\n' +
  '    ],\n' +
  '    "accept": [\n' +
  '      "*/*"\n' +
  '    ],\n' +
  '    "user-agent": [\n' +
  '      "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"\n' +
  '    ],\n' +
  '    "accept-encoding": [\n' +
  '      "gzip,deflate"\n' +
  '    ],\n' +
  '    "connection": [\n' +
  '      "close"\n' +
  '    ]\n' +
  '  }\n' +
  '}'

AssertionError [ERR_ASSERTION]: The input did not match the regular expression /A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified. Could not refresh access token./. Input:

'FetchError: request to http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token failed, reason: Nock: No match for request {\n' +
  '  "method": "GET",\n' +
  '  "url": "http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token",\n' +
  '  "headers": {\n' +
  '    "metadata-flavor": [\n' +
  '      "Google"\n' +
  '    ],\n' +
  '    "accept": [\n' +
  '      "*/*"\n' +
  '    ],\n' +
  '    "user-agent": [\n' +
  '      "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"\n' +
  '    ],\n' +
  '    "accept-encoding": [\n' +
  '      "gzip,deflate"\n' +
  '    ],\n' +
  '    "connection": [\n' +
  '      "close"\n' +
  '    ]\n' +
  '  }\n' +
  '}'

    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Context. (test/test.compute.ts:158:5)
flaky-bot[bot] commented 1 year ago

Closing as a duplicate of #1606