Skip to content

Functions deploy fails with 403 on Extensions API when no extensions are used #9987

Closed

Description

@devotedabilities

Description

firebase deploy --only functions fails with a 403 error on the Firebase Extensions API (firebaseextensions.googleapis.com) even when the project uses zero extensions.

Steps to Reproduce

  1. Create a Firebase project with Cloud Functions (2nd gen, Node 22) and no extensions
  2. Ensure firebase.json has no extensions key
  3. Ensure no code imports from firebase-functions/extensions
  4. Run firebase deploy --only functions

Expected Behavior

Deploy succeeds — extensions check is skipped when no extensions are defined.

Actual Behavior

i  extensions: ensuring required API firebaseextensions.googleapis.com is enabled...
Error: Request to https://firebaseextensions.googleapis.com/v1beta/projects/<project>/instances?pageSize=100&pageToken= had HTTP Error: 403, The caller does not have permission

Root Cause

In lib/deploy/functions/prepare.js line 70:

if (Object.values(wantBuilds).some((b) => b.extensions)) {

The firebase-functions SDK runtime loader always includes an extensions key in the build output — even when no extensions are defined, it returns extensions: {}. Since {} is truthy in JavaScript, the check passes and prepareDynamicExtensions is called, which then hits listInstances on the Extensions API.

Fix

Change the check to also verify the extensions object is non-empty:

if (Object.values(wantBuilds).some((b) => b.extensions && Object.keys(b.extensions).length > 0)) {

Environment

  • Firebase CLI: 15.8.0 (also reproduced on 13.x and 14.x)
  • firebase-functions: ^6.3.0
  • Node: 22
  • OS: macOS (Darwin 25.2.0)

Activity

  1. SammyDiqs commented on Feb 27, 2026

    @SammyDiqs

    This is also happening with me, working fine throughout the day started happening around 6 pm EST

  2. cjoy commented on Feb 27, 2026

    @cjoy

    This has also started happening for me as well

  3. mike-cao commented on Feb 27, 2026

    @mike-cao

    This just started happening for me too. Running firebase-functions ^6.3 and firebase-tools ^14.27. This has caused us to not be able to deploy an update today

  4. kingsurf commented on Feb 27, 2026

    @kingsurf

    +1 Happening for me, upgraded firebase-tools

    "firebase-functions": "^7.0.5",
    "firebase-tools": "^15.7.0",
    
  5. mike-cao commented on Feb 27, 2026

    @mike-cao

    @kingsurf did upgrading fix it for you or is it still happening with those versions?

  6. kingsurf commented on Feb 27, 2026

    @kingsurf

    @kingsurf did upgrading fix it for you or is it still happening with those versions?

    No, it continues to fail

  7. shariqkhwaja commented on Feb 27, 2026

    @shariqkhwaja

    Confirming this issue. Additional data points:

    • firebase-tools: 15.7.0 (also tested 15.8.0, same failure)
    • firebase-functions: 6.x
    • Node: 20.18.2
    • OS: macOS (local) + Ubuntu 24.04 (GitHub Actions CI)

    Timeline: Deploys with the exact same CLI version (15.7.0), same service account, same project, and same permissions were succeeding on Feb 25 but started failing on Feb 27. This points to a backend change on Google's side rather than a CLI regression.

    Key details:

    • The project has an extensions/ directory with BigQuery export configs (.env files), but the deploy command uses --only functions,firestore,storage — extensions are not being deployed.
    • The service account has roles/firebaseextensions.admin — confirmed via gcloud projects get-iam-policy.
    • The firebaseextensions.googleapis.com API is enabled on the project — confirmed via gcloud services list.
    • Even a project Owner account gets the same 403 when calling the endpoint directly:
    curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      "https://firebaseextensions.googleapis.com/v1beta/projects/<project>/instances?pageSize=100"
    # Returns: {"error":{"code":403,"message":"The caller does not have permission"}}
    

    Workaround: Removing/renaming the extensions/ directory before deploying bypasses the check entirely and the deploy succeeds. We've added rm -rf extensions as a CI step for now.

  8. kingsurf commented on Feb 27, 2026

    @kingsurf

    we are not using extensions and are not referencing extensions in our project at all, any idea how to bypass this extension check?

  9. kingsurf commented on Feb 27, 2026

    @kingsurf

    Yes thank you adding this step above the deploy works

            - rm -rf extensions
            - npm run firebase -- deploy --only functions:my-apis
    
  10. qlereboursFR commented on Feb 27, 2026

    @qlereboursFR

    There's a workaround mentioned in a related issue, closed since a long time but reactivated yesterday: firebase/firebase-functions#1596

  11. aalej commented on Feb 27, 2026

    @aalej
    Contributor

    Sorry for the issue here folks. It looks like the issue should be fixed, I tried deploying functions and did not encounter any issues. The 403 error from the Extensions API seems to be related to a backend issue, if you're still encountering this, please reach out to our Firebase Support team.

    Though, I do understand that we could improve this behavior on firebase-tools. I'll try asking our engineering team to see if we could skip the Extensions API calls if there are no extension in the codebase

  12. qlereboursFR commented on Feb 27, 2026

    @qlereboursFR

    Sorry for the issue here folks. It looks like the issue should be fixed, I tried deploying functions and did not encounter any issues. The 403 error from the Extensions API seems to be related to a backend issue, if you're still encountering this, please reach out to our Firebase Support team.

    Though, I do understand that we could improve this behavior on firebase-tools. I'll try asking our engineering team to see if we could skip the Extensions API calls if there are no extension in the codebase

    I confirm that it's fixed for me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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