Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unable to Delete a Firestore Database After Cross-Region Restore

Hello Google Cloud community,

I recently encountered an issue while trying to delete a Firestore database, and I'm seeking your assistance in resolving it.

Here's a summary of the situation:

  1. Initially, I deleted a Firestore database.

  2. Subsequently, I created a new Firestore database in a different region.

  3. I attempted to restore data to the new database from a backup, but I encountered difficulties due to the different regions.

  4. Now, I find myself unable to delete the new database, and I receive the following error message: "ERROR: (gcloud.alpha.firestore.databases.delete) FAILED_PRECONDITION: Precondition check failed."

I suspect that the issue might be related to the cross-region restore or some lingering configurations. I'd appreciate any guidance on how to properly delete this database and resolve this issue.

renanpk_0-1695776767784.png

 

Thank you in advance for your help!

 

 

0 1 573
1 REPLY 1

The error message "FAILED_PRECONDITION: Precondition check failed" indicates that Firestore was unable to delete the database because it did not meet a certain precondition. This could potentially be related to the cross-region restore or some lingering configurations.

Steps to Resolve the Issue:

  1. Check for Remaining Documents:

    • Inspect the database for any undeleted documents. Use the Firestore console or SDK to perform this check. If any documents are found, delete them manually.
  2. Delete Any Indexes:

    • Ensure no indexes are preventing the deletion.Again, use the Firestore console or SDK to delete any existing indexes on the database.
  3. Attempt Deletion from Google Cloud Console:

    • Try to delete the database again from the Google Cloud console. Navigate to the Firestore page, select the database, and click the Delete button.

Additional Tips:

  • Ensure you are targeting the correct database for deletion.
  • Verify that your account has the necessary permissions to perform the deletion.
  • If using third-party tools, ensure their compatibility with Firestore.
  • Remember that database deletion is irreversible, and data cannot be recovered post-deletion.

Specific to Your Situation:

Given the difficulties faced during the data restoration due to different regions, it's possible that lingering configurations are causing the issue.

Additional Steps:

  1. Check for Active Operations:

    • Ensure no active operations,such as backup or restore,are in progress on the Firestore database.
  2. Use the Correct gcloud Command:

    • If using the command-line tool, use the correct syntax:

    •  

      gcloud firestore databases delete YOUR_DATABASE_ID
      
  3. Review Additional Error Messages:

    • Look for any additional error messages or codes for more specific information about the failed precondition.
  4. Inspect Regional Settings:

    • In the Firestore page in the Google Cloud console, click the Settings tab and look for any settings like a Regional retention policy or a Ruleset that may be preventing the deletion. Disable such settings and attempt the deletion again.

By following these comprehensive steps and ensuring all settings and configurations are appropriately checked, you should be able to proceed with the deletion of the Firestore database. If the issue persists, Google Cloud Support will be the most reliable point of contact for a resolution.

Additional Notes:

  • It is important to be patient when deleting a Firestore database. It may take some time for the deletion to complete, especially if the database is large.
  • If you are still having trouble deleting the database, please contact Google Cloud Support for assistance.