Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bkendall opened this issue Aug 19, 2024 · 10 comments
Assignees

Comments

@bkendall
Copy link
Contributor

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.

@bkendall
Copy link
Contributor Author

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.

@bkendall bkendall 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 Aug 19, 2024
@bkendall
Copy link
Contributor Author

Thanks for the fix!

@ifielker
Copy link
Contributor

You're welcome :)

@CarltonK
Copy link

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

@steveoh
Copy link

steveoh commented Oct 1, 2024

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]

@Schmale97
Copy link

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

@delebakare
Copy link

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

@ixjamesyoo
Copy link

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

@ifielker
Copy link
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.

@ixjamesyoo
Copy link

ixjamesyoo commented Nov 14, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants