1

I am using firebase CLI to initialize a local firebase project directory from an existing firebase project. This existing project does have firestore with 100% certainty (there is tonnes of data in it). It is definitely firestore and not real time db.

I am running..

firebase init firestore

Then I pick the existing project from the list, and I get...

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

Is there potentially a permission issue here?

Scorb
  • 1,654
  • 13
  • 70
  • 144
  • It [seems](https://stackoverflow.com/questions/64962297/) this error will appear only when the project you selected has not had Firebase enabled on it. Is there any message when you visit the URL shown in the error? There might also be a file named `firebase-debug.log` in the directory in which you are trying to initialize the project, and it would be useful to share to further see what is failing. You can take a look into [how GCP and Firebase projects](https://medium.com/google-developers/whats-the-relationship-between-firebase-and-google-cloud-57e268a7ff6f) relate to each other. – ErnestoC Dec 04 '21 at 00:13

1 Answers1

9

I came here looking for the answer to this question and whilst your issue may be different, I found that I had no default resource location set for my firebase project.

In the firebase console go to cog icon > project settings > general. the fourth option down is 'Default GCP resource location'. This was not set, so editing it (pencil icon) and clicking done (There was only one option for me) fixed the issue.

Discussion around this topic can be found here: https://github.com/firebase/firebase-tools/issues/4254#issuecomment-1310619259

Jompra
  • 91
  • 1
  • 3