Skip to content

v5.1.0 requires firebaseextensions.googleapis.com when Extensions are unused in a project #1596

Closed

Description

@bkendall

Related issues

[REQUIRED] Version info

node:

v20.16.0

firebase-functions: v5.1.0

firebase-tools: v13.15.2

firebase-admin: v12.1.1

[REQUIRED] Test case

[REQUIRED] Steps to reproduce

After updating firebase-functions from 5.0.1 to 5.1.0, deploying no longer works.

[REQUIRED] Expected behavior

Successful deploy.

[REQUIRED] Actual behavior

I now get an error that the Extensions API isn't enabled, even though it's unused by the project.

[2024-08-19T22:29:41.411Z] >>> [apiv2][query] GET https://firebaseextensions.googleapis.com/v1beta/projects/XXXXX/instances pageSize=100&pageToken=
[2024-08-19T22:29:41.624Z] <<< [apiv2][status] GET https://firebaseextensions.googleapis.com/v1beta/projects/XXXXX/instances 403
[2024-08-19T22:29:41.624Z] <<< [apiv2][body] GET https://firebaseextensions.googleapis.com/v1beta/projects/XXXXX/instances {"error":{"code":403,"message":"Firebase Extensions API has not been used in project XXXXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firebaseextensions.googleapis.com/overview?project=XXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.","status":"PERMISSION_DENIED","details":[{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Google developers console API activation","url":"https://console.developers.google.com/apis/api/firebaseextensions.googleapis.com/overview?project=XXXXX"}]},{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"SERVICE_DISABLED","domain":"googleapis.com","metadata":{"service":"firebaseextensions.googleapis.com","consumer":"projects/XXXXX"}}]}}

Were you able to successfully deploy your functions?

No.

Activity

  1. bkendall commented on Aug 19, 2024

    @bkendall
    ContributorAuthor

    When I'm deploying locally, I see that issue above.

    When I deploy via GH Action, I actually get a different API that isn't enabled (I assume because it's deploying with a workload identity instead):

    Error: HTTP Error: 403, Cloud Billing API has not been used in project XXXXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudbilling.googleapis.com/overview?project=XXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
    
  2. changed the title [-]v5.1.0 requires Extensions API when Extensions are unused in a project[/-] [+]v5.1.0 requires firebaseextensions.googleapis.com when Extensions are unused in a project[/+] on Aug 19, 2024
  3. bkendall commented on Aug 20, 2024

    @bkendall
    ContributorAuthor

    Thanks for the fix!

  4. ifielker commented on Aug 20, 2024

    @ifielker
    Contributor

    You're welcome :)

  5. CarltonK commented on Aug 21, 2024

    @CarltonK

    Updating firebase-tools to the latest version worked for me
    13.15.3

  6. steveoh commented on Oct 1, 2024

    @steveoh

    I'm getting the firebaseextensions.googleapis.com and cloudbilling.googleapis.com errors in my ci with the following dependencies. From some other issues it sounds like this is normal and expected now?

    ├── [email protected]
    ├── [email protected]

  7. Schmale97 commented on Nov 12, 2024

    @Schmale97

    This looks to have been re-introduced, currently getting the error for
    [email protected]
    [email protected]

  8. delebakare commented on Nov 14, 2024

    @delebakare

    Worked for me with [email protected] and [email protected]

  9. ixjamesyoo commented on Nov 14, 2024

    @ixjamesyoo

    This looks to have been re-introduced, currently getting the error for [email protected] [email protected]

    Can confirm the issue was re-introduced on my end as well.

    [email protected] [email protected]

    Reverted [email protected], and deployment worked fine again

  10. ifielker commented on Nov 14, 2024

    @ifielker
    Contributor

    The firebaseextensions.instance.list permission is now required for any firebase deploy that includes functions. This is expected. It is because we have launched new features that allow you to define extension instances in your functions codebase and deploy them that way. See https://firebase.google.com/docs/extensions/install-extensions?interface=sdk) for details.

    This means that when we deploy functions we will always be checking if you have extension instances in your project that were defined using an autogenerated SDK in a deploying codebase. So we need to list the current extension instances in your project to determine if there is anything to potentially delete or configure or update.

    Consider enabling the Firebase Extensions Viewer permission which includes the ability to list extension instances.

  11. ixjamesyoo commented on Nov 14, 2024

    @ixjamesyoo

    @ifielker Thanks for the quick response.

    This was helpful context -- I initially understood the function deployment failures as a regression in the firebase-functions dependency because our codebase is not leveraging extensions, and so the error messages during deployment were not easily understood. Even though I intuited the potential solution of adding the stated Firebase Extensions Viewer role to our deployment service account, the reasons behind doing so were unclear and I was hesitant to do so.

    Couldn't we mitigate these errors in projects where the Extensions api is not explicitly enabled? (e.g. in such projects, the extension api not being enabled can signal that there's no need for the features checking against existing extensions, or installing extension instances defined in the codebase)

    Otherwise a more detailed error message during deployment explaining the above could help out. Docs don't seem to be up to date in this regard

  12. ArjunIsCool commented on Dec 4, 2025

    @ArjunIsCool

    Is there some way to circumvent this error without having to grant extension permissions? Sorry for necro.

  13. bdlgq-mike commented on Feb 26, 2026

    @bdlgq-mike

    I am getting this error today, no changes to my setup. it was working, then all of a sudden i was getting the

    Error: Request to https://firebaseextensions.googleapis.com/v1beta/projects/XXXXXXX/instances?pageSize=100&pageToken= had HTTP Error: 403, The caller does not have permission

  14. 5 remaining items

  15. EIleven commented on Feb 26, 2026

    @EIleven

    Same here, seems to be a general problem

  16. m-rios commented on Feb 26, 2026

    @m-rios

    mee too 🙄

  17. EIleven commented on Feb 26, 2026

    @EIleven

    They apparently posted a faulty update to the CLI in the last few hours that politely checked the Extensions API worldwide, blocking deployments globally with this false "Error 403".

  18. dnathe4th commented on Feb 27, 2026

    @dnathe4th

    Thumbs up if claude sent you here

  19. EIleven commented on Feb 27, 2026

    @EIleven

    I literally had to search GitHub/Stack Overflow, like the old-timers did.

  20. stefon-rentor commented on Feb 27, 2026

    @stefon-rentor

    Can confirm this issue is happening as well. Been deploying for two weeks. No changes. Randomly getting this 403 despite being an Owner with every possible thing done. Signing out. Signing back in. Disabling and Reenabling Extenstions API, etc.

    It seems the only solution may be to manually patch the buggy CLI to allow it to skip this useless check it's doing. Most of us have no use for Extenstions at all yet it still forces this check.

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

    Which then blocks us from deploying due to Googles bug despite us not even using Extenstions due to this well known bug so we shouldn't be forced to suffer those bugs...

    [2026-02-26T23:44:23.379Z] Error Context: { "body": { "error": { "code": 403, "message": "The caller does not have permission", "status": "PERMISSION_DENIED" } }, "response": { "statusCode": 403 } }

    EDIT: I spent two hours troubleshooting. The fix is actually easy and takes 5min to enable a feature Google should have done before since Extenstions check is useless for us without them. All you have to do is manually patch the buggy CLI to allow you to skip the useless extenstions check.

    Fix for Firebase CLI Extensions API 403 Error

    Issue: Firebase CLI v14+ requires Extensions API permissions during deployment, even if you're not using Firebase Extensions. This causes a 403 error whenever Google decides to introduce a bug.

    Workaround: Patch the Firebase CLI to skip the Extensions API check.

    Step 1: Find your Firebase CLI installation
    npm root -g
    This will output something like: /home/username/.nvm/versions/node/v20.9.0/lib/node_modules

    Step 2: Edit the prepare.js file
    Open this file in your editor:
    <npm-root-from-step-1>/firebase-tools/lib/deploy/extensions/prepare.js

    Step 3: Apply the patches

    Patch 1 (around line 125-129):

    // BEFORE:
    await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);
    await (0, requirePermissions_1.requirePermissions)(options, ["firebaseextensions.instances.list"]);
    let haveExtensions = await planner.haveDynamic(projectId);
    
    // AFTER:
    // PATCHED: Skip Extensions API check to avoid 403 error
    // await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);
    // await (0, requirePermissions_1.requirePermissions)(options, ["firebaseextensions.instances.list"]);
    let haveExtensions = []; //await planner.haveDynamic(projectId);
    

    Patch 2 (around line 146-148):

    // BEFORE:
    await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);
    await (0, requirePermissions_1.requirePermissions)(options, ["firebaseextensions.instances.list"]);
    
    // AFTER:
    // PATCHED: Skip Extensions API check to avoid 403 error
    // await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);
    // await (0, requirePermissions_1.requirePermissions)(options, ["firebaseextensions.instances.list"]);
    

    Patch 3 (around line 155-156):

    // BEFORE:
    const haveExtensions = await planner.have(projectId);
    
    // AFTER:
    const haveExtensions = []; // PATCHED: Skip fetching existing extensions to avoid 403
    
  21. dnathe4th commented on Feb 27, 2026

    @dnathe4th

    Also came back to suggest a work around. After some exploration with Claude we just early returned prepare and prepareDynamicExtensions directly and am able to deploy function. Claude says:

    In node_modules/firebase-tools/lib/deploy/extensions/prepare.js, two functions were patched with early returns:

    1. prepare (line 140) — runs when extensions is in the deploy target list. Checks extensions API is enabled, verifies firebaseextensions.instances.list permission, then diffs what extensions you want vs have.
    2. prepareDynamicExtensions (line 120) — called from the functions deploy path if any function build references extensions. Does the same API/permission checks before processing dynamic extension configs.

    Both hit the firebaseextensions.googleapis.com/v1beta/projects/{id}/instances endpoint which is currently returning 403 across many projects due to a Google-side issue (#1596). The patch is safe since you don't use extensions — these functions do nothing useful for your project. Note that npm install -g firebase-tools will overwrite the patch.

  22. gunnarmein-ts commented on Feb 27, 2026

    @gunnarmein-ts

    I have the same issue. I don't see how the workaround will work for our GitHub-based deployment.

  23. gunnarmein-ts commented on Feb 27, 2026

    @gunnarmein-ts

    @ifielker (the only name I see here) can we get this reopened?

  24. Andrew-Hopkins-Akcelo commented on Feb 27, 2026

    @Andrew-Hopkins-Akcelo

    @stefon-rentor 's workaround succeeded for me, allowing me to manually deploy the functions.

    Note: You will want to apply this update to either your global firebase-tools install, or your applications firebase-tools module itself

    Here's a terminal command you can run to apply stefon's workaround

    You will want to run this from either

    • /home/<username>/.nvm/versions/node/<INSERT NODE VERSION>/lib/node_modules/firebase-tools ( Global Install )
    • webapp-root/node_modules/firebase-tools/ ( Local Application Install )
    # Apply workaround using sed
    sed -i \
      -e 's|await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);|//await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);|g' \
      -e 's|await (0, requirePermissions_1.requirePermissions)(options, \["firebaseextensions.instances.list"\]);|//await (0, requirePermissions_1.requirePermissions)(options, ["firebaseextensions.instances.list"]);|g' \
      -e 's|let haveExtensions = await planner.haveDynamic(projectId);|let haveExtensions = []|g' \
      -e 's|const haveExtensions = await planner.have(projectId);|const haveExtensions = []|g' \
      lib/deploy/extensions/prepare.js
    
    

    Note:

    • I am just a random dev sharing a workaround to this bug.
    • I am NOT an official Firebase developer
    • This should be used as a temporary fix until the Firebase team actually implement a proper fix.
    • This code is not malicious, but with that being said, please use at your own risk.
      • I take no responsibility if this code destroys your pc, grows legs, gains sentience, or attempts to destroy humanity.
  25. aderderian commented on Feb 27, 2026

    @aderderian

    Still happening for me right now

  26. risalfajar commented on Feb 27, 2026

    @risalfajar

    Seems like a regression, please reopen @bkendall

  27. RyanCarrier commented on Feb 27, 2026

    @RyanCarrier

    Here is the temporary patch as a CI step

        - name: Patch firebase-tools extensions check (temp workaround)
          shell: bash
          run: |
            # Workaround for https://github.com/firebase/firebase-functions/issues/1596
            # Firebase CLI 403 on Extensions API - skip check since we don't use extensions
            PREPARE_JS="$(npm root -g)/firebase-tools/lib/deploy/extensions/prepare.js"
            SED="sed"; [[ "$OSTYPE" == darwin* ]] && SED="gsed"
            $SED -i \
              -e 's|await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);|//await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);|g' \
              -e 's|await (0, requirePermissions_1.requirePermissions)(options, \["firebaseextensions.instances.list"\]);|//await (0, requirePermissions_1.requirePermissions)(options, ["firebaseextensions.instances.list"]);|g' \
              -e 's|let haveExtensions = await planner.haveDynamic(projectId);|let haveExtensions = [];|g' \
              -e 's|const haveExtensions = await planner.have(projectId);|const haveExtensions = [];|g' \
              "$PREPARE_JS"
    
  28. ArjunIsCool commented on Feb 27, 2026

    @ArjunIsCool
  29. qlereboursFR commented on Feb 27, 2026

    @qlereboursFR

    According to this comment, this is fixed. It's working for me now

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions