Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "firestore: quota exceeded error while uploading rules"

I am getting an error when deploying rules using the deploy command in CI

firebase deploy --only firestore:rules --non-interactive

Output:

i  deploying firestore
i  firestore: checking firestore.rules for compilation errors...
✔  firestore: rules file firestore.rules compiled successfully
i  firestore: uploading rules firestore.rules...
i  firestore: quota exceeded error while uploading rules
? You have 2501 rules, do you want to delete the oldest 10 to free up space? (y/N)

I can fix the problem temporarily by deleting the last 10 manually, but will hit the limit again soon. Is there an easier way to purge the rules history using cli?

like image 495
Mike De Marco Avatar asked May 08 '19 23:05

Mike De Marco


2 Answers

using -f option the rules are deployed without asking to delete using firebase-tools 6.9.2

firebase deploy --only firestore:rules --non-interactive -f

UPDATE

this is not working anymore with firebase-tools 7.0.0

Workaround found

echo y | firebase deploy  --only firestore:rules 
like image 104
Mike De Marco Avatar answered Sep 22 '22 13:09

Mike De Marco


The helpful firebase support also sent us the below advice to deal with this issue.

It looks like you are hitting the rule set deployment limit. As of the moment, I can only suggest the manual deletion of old rules.

If you're deploying your app and you have no changes in your Firestore security rules, I recommend doing a partial deployment to avoid hitting the rule set limit.

You can also use the Firebase Rules API to list or delete the rule sets of your project.

There is already an existing Feature Request on how to handle this issue. However, I cannot provide an exact timeline for our releases. I will suggest visiting our blog page or release notes for the latest news.

like image 30
dunchunter Avatar answered Sep 24 '22 13:09

dunchunter