googleapis / googleapis/google-cloud-node

gcp-metadata: Internal error log is printed - "MetadataLookupWarning: received unexpected error = All promises were rejected"

Open
#7,668 3 comments 6 reactions 0 assignees View on GitHub
library: google-cloud-node-core type: bug
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

### Please make sure you have searched for information in the following guides.

- [x] Search the issues already opened: https://github.com/googleapis/google-cloud-node-core/issues
- [x] Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- [x] Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node-core/blob/main/docs/troubleshooting.md
- [x] Check our FAQ: https://github.com/googleapis/google-cloud-node-core/blob/main/docs/faq.md
- [x] Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- [x] Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- [x] Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
- [x] Check the API's issue tracker: https://cloud.google.com/support/docs/issue-trackers

### Link to the code that reproduces this issue. A link to a **public** Github Repository or gist with a minimal reproduction.

https://gist.github.com/yoshigev/c3ab7122f306757744b1e0e919ae65d0

### A step-by-step description of how to reproduce the issue, based on the linked reproduction.

Just run `isAvailable()` method as shown in the gist, in **non GCP** environment.

The console output will show `MetadataLookupWarning: received unexpected error = All promises were rejected` warning.

### A clear and concise description of what the bug is, and what you expected to happen.

The bug was probably introduced by https://github.com/googleapis/google-cloud-node-core/commit/dd0012aec2c011a066b5f6cfe9bc1be95c5650b1.

The new code changed the thrown error of `fastFailMetadataRequest` - as explained in the comment there, the new error is `AggregateError`. The problem is, that this error is not masked in `isAvailable` as the other known errors.

cc @Dhoni77

### A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

There is no reason for this error to appear, as this is not a real problem.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.