google-auth-library-nodejs: Unsuccessful response status code. Request failed with status code 404

I am using the google-auth-library to run v2 Firebase task functions as per the documentation. After I deployed today, I was getting this error everytime another function tried to queue a task:

Error: Unsuccessful response status code. Request failed with status code 404
    at Gaxios._request (/workspace/node_modules/gcp-metadata/node_modules/gaxios/build/src/gaxios.js:141:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async metadataAccessor (/workspace/node_modules/gcp-metadata/build/src/index.js:110:21)
    at async GoogleAuth._GoogleAuth_getUniverseFromMetadataServer (/workspace/node_modules/google-auth-library/build/src/auth/googleauth.js:777:26)
    at async GoogleAuth.getUniverseDomain (/workspace/node_modules/google-auth-library/build/src/auth/googleauth.js:186:168)
    at async GoogleAuth.getApplicationDefaultAsync (/workspace/node_modules/google-auth-library/build/src/auth/googleauth.js:252:42)
    at async GoogleAuth.getClient (/workspace/node_modules/google-auth-library/build/src/auth/googleauth.js:674:17)
    at async getFunctionUrl (/workspace/lib/helpers/taskQueue.js:37:20)
    at async enqueueTask (/workspace/lib/helpers/taskQueue.js:55:23)
    at async Promise.all (index 0)

The issue seems to have been introduced by #1692 (cc @danielbankhead).

It suddenly appeard for me because Firebase doesn’t respect your lockfile when deploying. My package.json specified "google-auth-library": "^9.2.0" but I was getting the latest 9.4.0 when deploying. I can resolve this issue by instead fixing my dependency to "google-auth-library": "9.2.0". The error when goes away and I am able to queue tasks correctly.

Environment details

  • OS: macOS
  • Node.js version: 18.18.2
  • npm version: 9.8.1
  • google-auth-library version: 9.4.0

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Reactions: 3
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Thanks for the quick turn around. Just to confirm that when I upgrade to 9.4.1 everything works as expected 👍

@sebasrobert this will be released immediately upon approval. This should happen shortly as soon as the team is available. Alternatively, pinning to v9.2.0 of this library should work just fine.

Thanks for getting this fixed so quick!

We’re also seeing this issue when deploying an App Engine instance with Firebase after updating several packages. Manually installing google-auth-library@9.2.0 as a dependency also worked for us.

Here’s our readout of npm ls gaxios gcp-metadata google-auth-library before doing the manual install:

+-- @google-cloud/logging-winston@6.0.0
| +-- @google-cloud/logging@11.0.0
| | +-- gcp-metadata@6.1.0
| | | `-- gaxios@6.1.1
| | `-- google-auth-library@9.4.0 deduped
| `-- google-auth-library@9.4.0
|   +-- gaxios@6.1.1
|   +-- gcp-metadata@6.1.0 deduped
|   `-- gtoken@7.0.1
|     `-- gaxios@6.1.1
+-- @google-cloud/pubsub@4.0.7
| +-- google-auth-library@9.4.0 deduped
| `-- google-gax@4.0.5
|   `-- google-auth-library@9.4.0 deduped
+-- @google-cloud/speech@6.1.0
| `-- @google-cloud/common@5.0.1
|   `-- google-auth-library@9.4.0 deduped
`-- firebase-admin@11.11.1
  +-- @google-cloud/firestore@6.8.0
  | `-- google-gax@3.6.1
  |   `-- google-auth-library@8.9.0
  |     +-- gaxios@5.1.3 deduped
  |     +-- gcp-metadata@5.3.0
  |     | `-- gaxios@5.1.3 deduped
  |     `-- gtoken@6.1.2
  |       `-- gaxios@5.1.3 deduped
  `-- @google-cloud/storage@6.12.0
    +-- gaxios@5.1.3
    `-- google-auth-library@8.9.0
      +-- gaxios@5.1.3 deduped
      +-- gcp-metadata@5.3.0
      | `-- gaxios@5.1.3 deduped
      `-- gtoken@6.1.2
        `-- gaxios@5.1.3 deduped