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."
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
- Open IAM for the project in the Google Cloud console.
- Add the service account with a role such as Firebase Admin (or narrower roles for the resources you deploy).
- Re-run the deploy with the correct
--projectid.
firebase deploy --project my-real-project-id --non-interactiveVerify the project id
List the projects the identity can see and confirm the id matches your .firebaserc or --project flag.
firebase projects:listHow to prevent it
- Grant the CI service account explicit access to each project it deploys.
- Pass
--projectwith the exact project id in CI. - Keep
.firebasercaliases in sync with real project ids.