Repository navigation
Description
[REQUIRED] Environment info
firebase-tools:12.4.2
Platform:macOS
[REQUIRED] Test case
I'm trying to deploy Firebase extensions while authorized with a service account on a GH Action workflow and am getting the following error:
i extensions: ensuring required API firebaseextensions.googleapis.com is enabled...
✔ extensions: required API firebaseextensions.googleapis.com is enabled
i extensions: ensuring required API secretmanager.googleapis.com is enabled...
✔ extensions: required API secretmanager.googleapis.com is enabled
i extensions: ensuring required API compute.googleapis.com is enabled...
✔ extensions: required API compute.googleapis.com is enabled
The following extension instances will be configured:
firestore-bigquery-export (firebase/[email protected])
firestore-send-email (firebase/[email protected])
i extensions: By installing an extension instance onto a Firebase project, you accept the Firebase Extensions User Terms of Service: https://firebase.google.com/terms/extensions/user
Error: HTTP Error: 403, Firebase Extensions Terms of Service Private API has not been used in project XXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firebaseextensionstos-pa.googleapis.com/overview?project=XXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
Error: Process completed with exit code 1.
Trying to access https://console.developers.google.com/apis/api/firebaseextensionstos-pa.googleapis.com/overview?project=XXX (with my project id) gives an error: "Failed to load".
I'm not sure why it asks for accepting terms of service, as I accepted the terms while deploying locally with my Google account logged in.
I've also tried deploying extensions locally, which worked when Firebase CLI is logged in with my Google account (Firebase project owner) but fails with the service account with a different error:
Error: Errors while reading 'extensions' in 'firebase.json'
- HTTP Error: 403, Your application is authenticating by using local Application Default Credentials. The firebaseextensions.googleapis.com API requires a quota project, which is not set by default. To learn how to set your quota project, see https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds.
- HTTP Error: 403, Your application is authenticating by using local Application Default Credentials. The firebaseextensions.googleapis.com API requires a quota project, which is not set by default. To learn how to set your quota project, see https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds.
How can I use a service account to deploy Firebase including extensions?
[REQUIRED] Steps to reproduce
On GH Actions:
Deploy a firebase project with extensions enabled on GH Actions with a service account:
name: Deploy to Firebase Staging
on:
push:
branches:
- staging
jobs:
deploy:
name: Deploy Firebase
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: w9jds/[email protected]
with:
tools-version: 12.4.2
gcp_sa_key: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
- run: firebase deploy --except hosting --project staging
working-directory: firebase
Locally:
- Open your firebase project with extensions enabled in terminal.
- Log out of Firebase CLI:
firebase logout - Authenticate with a service account key:
export GOOGLE_APPLICATION_CREDENTIALS='path/to/key.json' - Run
firebase deploy --only extensions --project staging
[REQUIRED] Expected behavior
I would expect the service account to be able to deploy the whole Firebase project including extensions.
[REQUIRED] Actual behavior
Deploying with service account fails on GH action with:
Error: HTTP Error: 403, Firebase Extensions Terms of Service Private API has not been used in project XXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firebaseextensionstos-pa.googleapis.com/overview?project=XXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
Error: Process completed with exit code 1.
and locally with:
Error: Errors while reading 'extensions' in 'firebase.json'
- HTTP Error: 403, Your application is authenticating by using local Application Default Credentials. The firebaseextensions.googleapis.com API requires a quota project, which is not set by default. To learn how to set your quota project, see https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds.
Activity
aalej commentedon Jun 30, 2023
Hi @abegehr, thanks for the detailed report. The issue regarding deploying extensions via GitHub actions seems to be similar to #5855.
With regard to locally deploying, I consulted with our team, and they think that a call to
firebaseextensions.googleapis.comis failing which is causing the error. To help us with investigating the issue, would it be okay if you could provide the contents of yourfirebase-debug.logafter runningfirebase deploy --only extensions --project staginglocally? This will give us a better overview of what causing this error:Please remove any PII (personal identifiable information) if needed.
KoheiKanagu commentedon Jul 6, 2023
I think I'm experiencing the same issue.
I'm attaching detailed logs.
According to the logs, the error occurred because I don't have the
firebaseextensions.instances.listpermission.Details
My service account has the following roles:
roles/firebase.developAdminroles/cloudfunctions.serviceAgentroles/cloudconfig.adminIt seems that firebaseextensions was updated in #2232, but I couldn't find the
firebaseextensions.instances.listrole even after checking IAM.gwp-rob commentedon Jul 6, 2023
I got the same error using Google Cloud Build using Stripe extension:
following extension instances will be configured:
firestore-stripe-payments (stripe/[email protected])
i extensions: By installing an extension instance onto a Firebase project, you accept the Firebase Extensions User Terms of Service: https://firebase.google.com/terms/extensions/user
Error: HTTP Error: 403, Firebase Extensions Terms of Service Private API has not been used in project 835040529702 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firebaseextensionstos-pa.googleapis.com/overview?project=835040529702 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
KoheiKanagu commentedon Jul 7, 2023
#6060 (comment)
After adding
roles/firebase.admin,I also got the error
Firebase Extensions Terms of Service Private API has not been used in project XXX before or it is disabled.I'm attaching detailed logs.
Details
abegehr commentedon Jul 10, 2023
@aalej, I have tried this again with the latest cli (12.4.3) and a service account that has the following roles:
Running this command:
export GOOGLE_APPLICATION_CREDENTIALS=./service-account-key.json && firebase deploy --only extensions --project stagingThis time locally I got the same ToS issue as on GH actions:
No
firebase-debug.logis generated.davidstanke commentedon Jul 13, 2023
I've got the same issue, invoking via an Ubuntu worker on Cloud Build (using this config). Here's a log snippet:
LMK if there's any other info I can provide that may be of use. Thanks!
samatcolumn commentedon Jul 24, 2023
@joehan is there a way I can accept the TOS via the console?
HuskerSam commentedon Jul 22, 2024
HuskerSam commentedon Nov 4, 2024
ArpadGBondor commentedon Nov 4, 2024
Thank you for the quick response, I deleted my comment, because I found a solution.
The project I'm working on is a legacy project still running on node 16, and it was using [email protected]
The project uses firebase extensions, and they are supposed to deploy through a bitbucket-pipeline, so removing the property was not an option for me.
Updating to [email protected] solved the problem for me.
paulpv commentedon Mar 21, 2025
Might this guide help anyone having this [or a related problem] set up the service account correctly?
See also:
Especially:
fix(ci): set GOOGLE_CLOUD_QUOTA_PROJECT to fix serviceusage 403