firebase / firebase-functions

Firebase SDK for Cloud Functions
https://firebase.google.com/docs/functions/
MIT License
1.02k stars 201 forks source link

v5.1.0 Fails to deploy on "firebaseextensions.instances.list" #1598

Open jeffgaynor opened 3 weeks ago

jeffgaynor commented 3 weeks ago

Related issues

n/a

[REQUIRED] Version info

node: v20.16.0

firebase-functions: ^5.1.0

firebase-tools: ^13.15.3

firebase-admin: "^12.3.1"

[REQUIRED] Test case

Run firebase deploy --only functions --force

[REQUIRED] Steps to reproduce

Upgrade Firebase Functions to latest version: 5.1.0

[REQUIRED] Expected behavior

Functions deploy successfully

[REQUIRED] Actual behavior

Functions fail to deploy

Were you able to successfully deploy your functions?

Initial output was:

$ firebase deploy --only functions --force

=== Deploying to 'my-project'...

i  deploying functions
i  functions: preparing codebase default for deployment
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
✔  artifactregistry: required API artifactregistry.googleapis.com is enabled
✔  functions: required API cloudbuild.googleapis.com is enabled
✔  functions: required API cloudfunctions.googleapis.com is enabled
i  functions: Loading and analyzing source code for codebase default to determine what to deploy
Serving at port 8[79](https://github.com/my-repo/actions/runs/10479672777/job/29025902274#step:7:80)0

✔  extensions: required API firebaseextensions.googleapis.com is enabled
i  extensions: ensuring required API firebaseextensions.googleapis.com is enabled...
✔  extensions: required API firebaseextensions.googleapis.com is enabled

Error: An unexpected error has occurred.
Error: Process completed with exit code 2.

Running deploy with debugging shows this detail:

[2024-08-21T14:58:54.306Z] TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at Object.want (/home/runner/work/my-repo/node_modules/firebase-tools/lib/deploy/extensions/planner.js:120:28)
    at prepareDynamicExtensions (/home/runner/work/my-repo/node_modules/firebase-tools/lib/deploy/extensions/prepare.js:122:48)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async prepare (/home/runner/work/my-repo/node_modules/firebase-tools/lib/deploy/functions/prepare.js:62:9)
    at async chain (/home/runner/work/my-repo/node_modules/firebase-tools/lib/deploy/index.js:40:9)
    at async deploy (/home/runner/work/my-repo/node_modules/firebase-tools/lib/deploy/index.js:97:5)

Downgrading identical code to v5.0.1 works. So it's definitely an issue with v5.1.0, which included this: https://github.com/firebase/firebase-functions/pull/1590 related to extensions.

google-oss-bot commented 3 weeks ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

AmilKey commented 2 weeks ago

I got an error "firebase cloud error Failed to load function definition from source" when I upgraded from 5.0.1 to 5.1.0

rendomnet commented 2 weeks ago

Same issue here.

[debug] [2024-08-26T16:42:30.433Z] TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at Object.want (/Users/---/Library/pnpm/global/5/.pnpm/firebase-tools@13.15.3_encoding@0.1.13/node_modules/firebase-tools/lib/deploy/extensions/planner.js:120:28)
christopheramason commented 2 weeks ago

I am seeing an issue when deploying via CI probably due to a similar/related issue with a change made in 5.1.0

✔  extensions: required API firebaseextensions.googleapis.com is enabled
i  extensions: ensuring required API firebaseextensions.googleapis.com is enabled...
✔  extensions: required API firebaseextensions.googleapis.com is enabled

Error: HTTP Error: 403, The caller does not have permission
metabit-goody commented 1 week ago

I was able to resolve this by updating to the latest version of firebase-tools (13.16.0)

exaby73 commented 2 days ago

@jeffgaynor @rendomnet @christopheramason Were you able to solve this as well by upgrading the firebase-tools package?