Skip to content
Latchkey

Firebase "Failed to get Firebase project ... permission" in CI

The CLI authenticated but the identity it used cannot read the named project. Either the project id is wrong, or the service account has not been granted access to that Firebase project.

What this error means

A command fails with "Error: Failed to get Firebase project my-project. Please make sure the project exists and your account has permission to access it."

firebase
Error: Failed to get Firebase project my-project. Please make sure the project exists and your account has permission to access it.

Common causes

The service account lacks access to the project

The authenticated service account is not a member of the project, so listing or reading it returns nothing the CLI can use.

A wrong or misspelled project id

The --project value or .firebaserc alias does not match a real project id the account can see.

How to fix it

Grant the service account project access

  1. Open IAM for the project in the Google Cloud console.
  2. Add the service account with a role such as Firebase Admin (or narrower roles for the resources you deploy).
  3. Re-run the deploy with the correct --project id.
Terminal
firebase deploy --project my-real-project-id --non-interactive

Verify the project id

List the projects the identity can see and confirm the id matches your .firebaserc or --project flag.

Terminal
firebase projects:list

How to prevent it

  • Grant the CI service account explicit access to each project it deploys.
  • Pass --project with the exact project id in CI.
  • Keep .firebaserc aliases in sync with real project ids.

Frequently asked questions

What causes ""Failed to get Firebase project""?
The authenticated service account is not a member of the project, so listing or reading it returns nothing the CLI can use.
How do I fix "Failed to get Firebase project"?
Grant the service account project access

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card