Skip to content

firebase-tools v11.3.0 deploy fails for gen2 Cloud Functions #5334

@metadiego

Description

@metadiego

[REQUIRED] Environment info

firebase-tools: 11.3.0

Platform: macOS

[REQUIRED] Test case

A firebase project with gen2 cloud functions and local version of firebase-tools === 11.3.0. Firebase deploy fails.

[REQUIRED] Steps to reproduce

  1. Install the latest version of Firebase CLI: npm install -g [email protected]
  2. Create a firebase project: firebase init
  3. Add a gen2 cloud function
  4. Run firebase deploy

[REQUIRED] Expected behavior

Firebase deploy success.

[REQUIRED] Actual behavior

Deploy fails with following error: Error: Failed to fetch Run service undefined.

If we run firebase deploy --debug, we get:

[2022-12-14T15:01:42.800Z] FirebaseError: Failed to make request: Cannot read properties of undefined (reading 'startsWith')
    at Client.request (/Users/user/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/apiv2.js:111:19)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.getService (/Users/user/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/gcp/run.js:17:26)
    at async Promise.all (index 0)
    at async loadExistingBackend (/Users/user/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/backend.js:197:28)
    at async Object.existingBackend (/Users/user/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/backend.js:173:9)
    at async prepare (/Users/user/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/functions/prepare.js:110:115)
    at async chain (/Users/user/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/index.js:33:9)
    at async deploy (/Users/user/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/index.js:68:5)

Temporary Fix:

In order to fix the error, I had to remove Firebase tools (v 11.3.0) from my system and install Firebase tools v11.18.0. Deploy succeeds.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions