Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot delete a collection with firestore:delete due to HTTP Error 429 #7845

Closed
Desno365 opened this issue Oct 17, 2024 · 1 comment · Fixed by #7863
Closed

Cannot delete a collection with firestore:delete due to HTTP Error 429 #7845

Desno365 opened this issue Oct 17, 2024 · 1 comment · Fixed by #7863

Comments

@Desno365
Copy link

[REQUIRED] Environment info

firebase-tools: 13.22.0

Platform: macOS

[REQUIRED] Test case

When running firebase firestore:delete -r "collectionId" on a very big collection (~100'000 documents) composed of very large documents (~1MB) the command fails.
The error reported is the following:

HTTP Error: 429, This database has exceeded their maximum bandwidth for writes, please retry with exponential backoff.

It becomes impossible to delete the collection.

[REQUIRED] Steps to reproduce

  1. Create a collection composed of many documents (>100'000), where each document has a very large size (~1MB).
  2. Run firebase firestore:delete --debug -r "collectionId"

[REQUIRED] Expected behavior

The expected behavior is that the collection "collectionId" is deleted successfully.

[REQUIRED] Actual behavior

The actual behavior is that the collection is not deleted. At the moment it's impossible to delete the collection.

@NickChittle
Copy link
Contributor

NickChittle commented Oct 22, 2024

Hello, thanks for reporting this, it looks like the Firebase CLIs implementation of delete does not do rampup/retries with exponential backoff on this bandwidth error, which it looks like you would be hitting because the documents you're trying to delete are fairly large.

While we look into this, you could try using one of the recursive delete methods in the SDKs, for example in python: https://github.com/googleapis/python-firestore/blob/3fe727102d1a4f65c9b8767d11015d8baaead355/google/cloud/firestore_v1/client.py#L297

db = firestore.Client(project=PROJECT_ID, client_options=options)
bulk_writer = db.bulk_writer()
coll_ref = db.collection(COLLECTION_ID)
print(f"Deleting {COLLECTION_ID}")
db.recursive_delete(coll_ref, bulk_writer=bulk_writer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy