firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 929 forks source link

firebase init fails: project id already exists #5233

Open Deleplace opened 1 year ago

Deleplace commented 1 year ago

[REQUIRED] Environment info

firebase-tools: 11.12.0

Platform: MacOS Monterey 12.6

[REQUIRED] Test case

Project creation from scratch

[REQUIRED] Steps to reproduce

% firebase init

     ######## #### ########  ######## ########     ###     ######  ########
     ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
     ######    ##  ########  ######   ########  #########  ######  ######
     ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
     ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

  /Users/myuser/myfolder

? Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter to confirm your choices. Firestore: Configure security rules and indexes files for Firestore, Functions: Configure a Cloud Functions directory and its files, Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys, Storage: Configure a security rules file for Cloud Storage, Emulators: Set up local emulators for Firebase products

=== Project Setup

First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add, 
but for now we'll just set up a default project.

? Please select an option: Create a new project
i  If you want to create a project in a Google Cloud organization or folder, please use "firebase projects:create" instead, and return to this command when you've created the project.
? Please specify a unique project id (warning: cannot be modified afterward) [6-30 characters]:
 helloworld
? What would you like to call your project? (defaults to your project ID) 
✖ Creating Google Cloud Platform project

Error: Failed to create project because there is already a project with ID helloworld. Please try again with a unique project ID.

When the failure occurred, I had already manually selected 4 Firebase features out of 8, which I will have to start over and select again.

[REQUIRED] Expected behavior

[REQUIRED] Actual behavior

The process fails on existing Project ID, and exits with an error code.

christhompsongoogle commented 1 year ago

I discussed this with the team - thanks for the feedback. Right now we don't have resources to look at this immediately but it's a valid issue we could look at in the future.