Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase init fails at Firestore Setup for new project #5230

Closed
Deleplace opened this issue Nov 9, 2022 · 1 comment · Fixed by #5261
Closed

firebase init fails at Firestore Setup for new project #5230

Deleplace opened this issue Nov 9, 2022 · 1 comment · Fixed by #5261
Assignees

Comments

@Deleplace
Copy link

[REQUIRED] Environment info

firebase-tools: 11.12.0

Platform: MacOS Monterey 12.6

[REQUIRED] Test case

Project creation from scratch

[REQUIRED] Steps to reproduce

  • Run firebase init in an empty folder
  • Select feature: Firestore
  • Firebase project: Create a new project
% firebase init

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

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

  /Users/myuser/supercoolstorage

? 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

=== 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]:
 supercoolstorage
? What would you like to call your project? (defaults to your project ID) 
✔ Creating Google Cloud Platform project
✔ Adding Firebase resources to Google Cloud Platform project

🎉🎉🎉 Your Firebase project is ready! 🎉🎉🎉

Project information:
   - Project ID: supercoolstorage
   - Project Name: supercoolstorage

Firebase console is available at
https://console.firebase.google.com/project/supercoolstorage/overview
i  Using project supercoolstorage (supercoolstorage)

=== Firestore Setup

Error: It looks like you haven't used Cloud Firestore in this project before. Go to https://console.firebase.google.com/project/supercoolstorage/firestore to create your Cloud Firestore database.

[REQUIRED] Expected behavior

  • No error, creating the Firestore database should be part of the normal process, be it in the command line or in the web console.
  • Please complete the Firebase initialization of my current folder (firebase.json, etc.) instead of crashing and letting me go to the web console to create a database, and then run firebase init again but this time selecting existing project.

[REQUIRED] Actual behavior

Error "you haven't used Cloud Firestore in this project before"

Of course I haven't, this is a new project to be created, per the last question.

Process exits with code 1

The current folder is not initialized, zero files were created (no firebase.json, etc.)

The new project supercoolstorage seems to be created server-side, though.

@Deleplace Deleplace added the bug label Nov 9, 2022
@Deleplace Deleplace changed the title firebase init fails: project id already exists firebase init fails at Firestore Setup for new project Nov 9, 2022
@DerKO9
Copy link

DerKO9 commented Nov 10, 2022

I am also having this problem with version 11.16.0. I just made my project, initialized firestore database in the firebase console, and tried "firebase init" in VSCode.
Logging in with --no-localhost flag did not help

Here is the debug log. I replaced my project id with "XXX", the project does exist

=== Firestore Setup
[2022-11-10T01:34:59.523Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/XXX/services/firestore.googleapis.com [none]
[2022-11-10T01:34:59.524Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/XXX/services/firestore.googleapis.com x-goog-quota-user=projects/XXX
[2022-11-10T01:34:59.841Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/XXX/services/firestore.googleapis.com 200
[2022-11-10T01:34:59.841Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/XXX/services/firestore.googleapis.com [omitted]
[2022-11-10T01:34:59.841Z] >>> [apiv2][query] GET https://appengine.googleapis.com/v1/apps/XXX [none]
[2022-11-10T01:35:00.243Z] <<< [apiv2][status] GET https://appengine.googleapis.com/v1/apps/XXX 404
[2022-11-10T01:35:00.243Z] <<< [apiv2][body] GET https://appengine.googleapis.com/v1/apps/XXX {"error":{"code":404,"message":"App does not exist.","status":"NOT_FOUND"}}
[2022-11-10T01:35:00.244Z] error getting database typeHTTP Error: 404, App does not exist. {"name":"FirebaseError","children":[],"context":{"body":{"error":{"code":404,"message":"App does not exist.","status":"NOT_FOUND"}},"response":{"statusCode":404}},"exit":1,"message":"HTTP Error: 404, App does not exist.","status":404}
[2022-11-10T01:35:00.244Z] database_type: undefined

Error: It looks like you haven't used Cloud Firestore in this project before. Go to https://console.firebase.google.com/project/XXX/firestore to create your Cloud Firestore database.

EDIT: It looks like appengine is returning a 404 because Firebase did not initialize an app when I created the project. In the Google Cloud console, I had to manually initialize the app which is something I never had to do before
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants