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

Unhelpful/Misleading Error Message when Credentials File is Empty #1527

Open
theGOTOguy opened this issue Mar 2, 2023 · 0 comments
Open
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@theGOTOguy
Copy link

Environment details

  • OS: Alpine
  • Node.js version: 18.12.0
  • npm version: 8.19.2
  • @googleapis/google-auth-library-nodejs version: 8.7.0

Steps to reproduce

  1. Create an empty gcp_credentials.json file for your gcloud_project with your gcloud_storage_bucket.
  2. Use, e.g.:
  const storage = new Storage({
      projectId: gcloud_project,
      keyFilename: 'gcp_credentials.json'
  });

  const bucket = storage.bucket(gcloud_storage_bucket);
  const [metadata] = await bucket.getMetadata();
  1. Receive unhelpful error message "TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type boolean (true)"

It would be reasonable to sanity-check the key file and return a more illuminating error message.

@theGOTOguy theGOTOguy added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant