firebase / firebase/firebase-tools
Functions deployment to Google Cloud Projects fails with unspecific error
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 84
Description
## Description
When running deploy of functions to a Google Cloud Project that doesn't have Firebase added you get a very unspecific 403 error. It would be nice to fail with something a bit more user friendly like "Error: Cannot deploy to project as it doesn't support Firebase. You can add Firebase support to this project in the Firebase Console."
## Repro steps
1. Create a new project in Google Cloud Console
2. Enable billing
3. In a terminal, create a folder and initialize:
`firebase init functions`
4. Try to deploy:
`firebase deploy --only functions --project
Expected result: Deployment succeeds, or a nice error is shown
Actual result: A hard to understand 403 error:
```
=== Deploying to 'test1-493612'...
i deploying functions
i functions: preparing codebase default for deployment
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
i artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
⚠ functions: missing required API cloudbuild.googleapis.com. Enabling now...
⚠ functions: missing required API cloudfunctions.googleapis.com. Enabling now...
✔ artifactregistry: required API artifactregistry.googleapis.com is enabled
Error: Request to https://firebase.googleapis.com/v1beta1/projects/test1-493612/adminSdkConfig had HTTP Error: 404, Requested entity was not found.
```
I propose we at least update the error message to be easier to read, e.g.:
"Error: Cannot deploy to project as it doesn't support Firebase. You can add Firebase support to this project in the Firebase Console."
Contributor guide
Assessment
This issue has not been assessed yet.