GCP Firestore API is not available for Cloud Datastore projects

11,439

Solution 1

If you have an empty Cloud Datastore database and you never executed a write to the database, you can upgrade to Cloud Firestore in Datastore mode or Native mode, by clicking the ‘’UPGRADE TO FIRESTORE’ button on the ‘Datastore/Entities’ page.

If you do not receive the option, then your database instance will be automatically upgraded at a future date(link). If you upgrade from Cloud Datastore to Cloud Firestore in Datastore mode or from Datastore mode to Native mode, you cannot undo the operation.

Here is the link to the Doc: https://cloud.google.com/datastore/docs/upgrade-to-firestore

Solution 2

I had The Cloud Firestore API is not available for Datastore Mode projects with an empty Firestore.

I've solved the error with the steps:

  1. Open Firestore in your web browser.
  2. Create at least one collection.

Sadly, Google error messages are useless, as you see by this example.

Share:
11,439

Related videos on Youtube

Charles Zhan
Author by

Charles Zhan

Updated on June 04, 2022

Comments

  • Charles Zhan
    Charles Zhan almost 2 years

    I was trying to use the GCP filestore, following the simple quick example in the product website and get an error: "google.api_core.exceptions.FailedPrecondition: 400 The Cloud Firestore API is not available for Cloud Datastore projects."

    I did use the datastore before in the same project, I then disabled the datastore api in the project and try out the example, still get the same error any one can suggest what to do other than creating a new project ?

  • Charles Zhan
    Charles Zhan over 4 years
    I am not trying to upgrade it. I do have non-empty Cloud datastore db. I tried to delete all the entities and disabled the datastore api, and it still won't allow me to use firestore api. I actually just want to throw the data away there (POC data) and try to use firestore, seems like I was locked out because I used datastore before.
  • Charles Zhan
    Charles Zhan over 4 years
    So can you recommend what I should do here in order to use firestore ?
  • Yanan C
    Yanan C over 4 years
    Currently there is nothing you could do to upgrade your Datastore database to Firestore in your existing project but to wait for the automatic upgrade from GCP. Since the mode you picked is locked in for the project.
  • Charles Zhan
    Charles Zhan over 4 years
    Thanks, appreciate your response.
  • Elona Mishmika
    Elona Mishmika over 4 years
    Are there any ways to do this automatically via command line?