gcloud alpha firestore databases delete --database "(de
fault)"
The database 'projects/hostai-booking-prod-clone/databases/(default)' will be deleted.
Do you want to continue (Y/n)? y
ERROR: (gcloud.alpha.firestore.databases.delete) FAILED_PRECONDITION: Precondition check failed.
So I am now stuck with a database I cannot change to native mode and cannot delete…The error message tells me precondition failed but provides no information on what precondition has failed…
There are a few possible reasons why you might be getting the FAILED_PRECONDITION error when trying to update or delete your Firestore database. It could be related to the database’s current state, permissions, or other factors.
Here are some steps you can take to troubleshoot and resolve the FAILED_PRECONDITION error:
1. Check Permissions
Make sure your account has the necessary permissions to modify or delete the Firestore database. You should have roles like Owner, Editor, or a custom role with sufficient permissions. Verify your permissions in the IAM section of the Google Cloud Console.
2. Use the Web Interface
Attempt to perform the same operations from the Google Cloud Console. The web interface may provide more detailed error messages or additional options to resolve the issue.
Additional Checks
Review the settings of your Firestore database in the Google Cloud Console to ensure there are no configurations preventing the deletion or conversion of the database.
Sometimes, the issue might be temporary. Wait for some time and try the operations again.
Alternative Solution
If the database does not contain any data and you are unable to delete or convert it, consider creating a new Google Cloud project and setting up Firestore in native mode in the new project. This should be considered as a last resort as it might involve additional configuration and setup.
Note:
Ensure to replace any sensitive information before sharing error messages or logs publicly or with support.
If you are still unable to update or delete the database after trying the above steps, creating a new database and migrating any necessary data should be your last resort.
It is not a permissions issue, the account I am using is the Owner account.
The web interface has the delete option disabled and on hover the tooltip tell me I am limited to using the api.
It’s unbelievable to me that the best/only solution here is to create a whole new project!! not something one would expect from an established Google product…
Try opening the database in the Google Cloud console. Select the database from the list of available databases. When a Datastore database is empty, you should see a button to “Switch to Native mode.”
Even in Native mode, it’s not possible to delete the database after creation it seems. I’ve just created this database to test (nothing has been configured, it’s not storing any data):
gcloud alpha firestore databases delete --database=“(default)”
The database ‘projects/xxxxx/databases/(default)’ will be deleted.