Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCP Firestore API is not available for Cloud Datastore projects

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 ?

like image 737
Charles Zhan Avatar asked Sep 18 '19 23:09

Charles Zhan


People also ask

Is the Cloud Firestore API available for datastore Mode Projects?

I had The Cloud Firestore API is not available for Datastore Mode projects with an empty Firestore. Open Firestore in your web browser. Create at least one collection. Sadly, Google error messages are useless, as you see by this example.

What is the use of @datastore mode?

Datastore mode disables Firestore features that are not compatible with Datastore: The project will accept Datastore API requests and deny Firestore API requests. The project will use Datastore indexes instead of Firestore indexes.

How to integrate Google Cloud Firestore API with NuGet?

Interact with this API in your browser using the APIs Explorer for the Cloud Firestore API. Install the NuGet package: Google.Apis.Firestore.v1. Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License.

What happens when a Cloud Firestore request fails?

When a Cloud Firestore request succeeds, the Cloud Firestore API returns an HTTP 200 OK status code and the requested data. When a request fails, the Cloud Firestore API returns an HTTP 4xx or 5xx status code and a response with information about the error.


2 Answers

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

like image 116
Yanan C Avatar answered Sep 29 '22 23:09

Yanan C


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.

like image 42
Nairum Avatar answered Sep 29 '22 22:09

Nairum