firebase-tools: Error fetching Firestore indexes

[REQUIRED] Environment info

firebase-tools: 7.13.1

Platform: Windows 10

[REQUIRED] Test case

firebase init

[REQUIRED] Steps to reproduce

Well, firebase init?

[REQUIRED] Expected behavior

I just want to init the Firebase project…

[REQUIRED] Actual behavior

There was error while firebase init.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 20
  • Comments: 32 (9 by maintainers)

Most upvoted comments

Just go to gcloud console and switch back to Native mode in datastore / firestore. then run this command again all works.

@PsychoXIVI thanks for the logs! The error is here:

[2020-02-21T10:38:26.197Z] FirebaseError: HTTP Error: 400, This operation is not available for Cloud Firestore projects in Datastore Mode.

This is a bug, we should catch this configuration earlier. The Firebase CLI is only useful for Firestore in Native mode, not Datastore mode. For now you can get around this by using firebase init but not selecting Firestore as one of your projects.

FYI I did switch to Firestore mode before seeing this problems.

image

My work around is

  1. go to https://console.cloud.google.com/firestore/data
  2. create some foo data.
  3. firebase init again.

and it work now.

When you run firebase init it will ask which features you want to initialize: image

To work around this issue, you should not select “Firestore” from the list.

just create one collection in firestore and run firebase init , it will work.

Hey everyone we have been digging into this over the past day or two and there’s clearly an issue within the Firebase console. It seems that some old projects in which Firestore was never used are being marked as having Firestore in Datastore Mode (rather than having nothing).

It’s not something you need to worry about (you can just switch it over) but it is something we want to fix quickly because it’s a bad experience. I will post an update here when I have one.

Also having the same problem in May 2020. Removed firestore from init and it worked, but obviously that’s not a solution for many people.

Better solution to this problem is to create an empty firestore.indexes.json file and then run firebase init.

Worked for me.

I got this problem and I did not ever put datastore into “datastore” mode.

Just go to gcloud console and switch back to Native mode in datastore / firestore. then run this command again all works.

amigos la solucion esta aqui solo hagan esto en su consola de firebase y ya muchas gracias