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

The error message when clientViaApplicationDefaultCredentials fallbacks to reading metadata servers (and failing) is cryptic #572

Open
rrousselGit opened this issue Oct 11, 2023 · 3 comments · May be fixed by #574

Comments

@rrousselGit
Copy link

Context for this issue: invertase/dart_firebase_admin#6

It appears that if a user tries to create a client with clientViaApplicationDefaultCredentials, yet have neither the environment nor gcloud/application_default_credentials.json setup, then google_apis_auth fallbacks to reaching out to metadata.google.internal.

The problem is that if that endpoint is unavailable (which is likely the case if the user made a mistake and did want to login using the other options), then we end-up with a "Failed host lookup: 'metadata.google.internal'" error.

This is likely confusing, and a better error message could make it more intuitive to understand what the issue is.

@kevmoo
Copy link
Collaborator

kevmoo commented Oct 11, 2023

Yup. A good place to do a catch and rethrow w/ something more helpful!

@rrousselGit
Copy link
Author

Would you be open to have a PR for this?

@kevmoo
Copy link
Collaborator

kevmoo commented Oct 16, 2023

Would you be open to have a PR for this?

ABSOLUTELY!

rrousselGit added a commit to rrousselGit/googleapis.dart that referenced this issue Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants