Disclosure: App369 publishes this guide and sells a fixed-price App Fix Ticket for single bugs like these.
Key takeaways
- Firestore checks a query against the rules before running it, so a query must filter the same way the rule does, even if every document would pass.
- A query that filters on one field and sorts or ranges on another needs a composite index. The link to create it is in the error message.
- Without billing, Firestore allows 50,000 document reads and 20,000 writes a day, and the quota resets around midnight Pacific time.
- Deploying Cloud Functions needs the Blaze pricing plan, and deploys on Node.js 14 or 16 are disabled.
- An FCM "registration-token-not-registered" error means the token is dead: remove it from your database and stop sending to it.
Pricing an app? Try the free app cost calculator or get a range for your project in the instant quote.
Short answer: Firebase backend errors come from three places: Firestore and Storage, where security rules, indexes and quotas decide what runs; Cloud Functions, where deploys, CORS and memory fail; and the services around them, such as App Check, push notifications and API keys. Find your error below; each one links to a full fix page checked against the Firebase or Google Cloud documentation.
Firestore and Cloud Functions errors are easiest to fix once you know which service refused the request. The 11 errors below stop Firebase apps from reading, saving, deploying or sending pushes. Facts come from the vendors’ own documentation, as checked on the linked fix page; the advice on what to do and in which order is App369’s. For sign-in errors, see the Firebase Auth errors guide.
Firestore and Storage errors
These five errors come from Firestore and Cloud Storage for Firebase. Security rules cause three of them; the other two are an index and a daily quota.
“FirebaseError: Missing or insufficient permissions”
The request doesn’t pass the deployed rules. The query has to filter on the same field the rule checks, reads have to wait until a user is signed in, and rules that compare request.time with a fixed date stop allowing anything after it. Test the exact request in the Rules Playground. Full steps: Missing or insufficient permissions.
“Your Cloud Firestore database isn’t properly secured”
Firebase sends this alert when rules let people read or change data they shouldn’t. The Firebase docs warn that with open rules “anyone who guesses your project ID can steal, modify, or delete the data.” Let each signed-in user reach only their own documents, and test before deploying. Full steps: Firebase insecure rules alert.
“FAILED_PRECONDITION: The query requires an index”
A filter on one field with a sort or range on another needs a composite index. The link to create it is in the full error message, the index takes a few minutes to build, and one made in your development project doesn’t exist in production. Keep every index in firestore.indexes.json. Full steps: Firestore query requires an index.
Firestore quota exceeded
Without billing, Firestore allows 50,000 document reads, 20,000 writes and 20,000 deletes a day. The Firestore quotas page says “Quotas are applied daily and reset around midnight Pacific time.” Find the code behind the reads, such as listeners that reconnect or queries with no limit, before enabling billing. Full steps: Firestore quota exceeded.
Firebase Storage “storage/unauthorized”
The Storage rules refuse the action, the path doesn’t match the rule, or the upload starts before sign-in has finished. On that last cause, the Firebase docs note that “currentUser might also be null because the auth object has not finished initializing.” Wait for onAuthStateChanged to report a user. Full steps: Firebase Storage unauthorized.
Cloud Functions errors
These three errors come from Cloud Functions for Firebase: calling a function from a browser, deploying it, and running it.
Cloud Function blocked by CORS policy
The Firebase docs say “By default, HTTP functions don’t have CORS configured, meaning that any cross-origin request to your function results in this error”. Set cors to the domains that call it. Callable functions allow all origins by default, so a CORS error there can hide a wrong name or region, a failed deploy or a crash. Full steps: Firebase Functions CORS error.
firebase deploy fails for Cloud Functions
According to Firebase’s getting started guide, “to deploy functions, your project must be on the Blaze pricing plan”. Deploys on Node.js 14 or 16 are disabled. “Could not build the function” points at build permissions, and “Container Healthcheck failed” means the code failed to start. Full steps: Firebase Functions deploy failed.
Cloud Function runs out of memory
Raise the memory in the function’s options, and stream large files instead of loading them whole. Temporary files count too: the Firebase tips page says “Local disk storage in the temporary directory is an in-memory filesystem.” Delete each one when you are done with it. Full steps: Firebase Functions memory limit exceeded.
App Check, push notifications and API keys
These three problems sit around the database and functions: who may call them, where pushes go, and who can spend on your project.
App Check is blocking the app’s requests
Use the debug provider on localhost and in CI, and make sure App Check is set up before other Firebase calls. The App Check metrics docs warn that “Enforcing App Check on a released app will break prior app versions that are not integrated with the App Check SDK.” Check the metrics before enforcing. Full steps: Firebase App Check blocking requests.
FCM “registration-token-not-registered”
The token is dead: the app was uninstalled, or the token expired or was replaced. The FCM ErrorCode reference says “For all these cases, remove this registration token from the app server and stop using it to send messages.” Save the token each time the app receives a new one. Full steps: FCM registration token not registered.
Unexpected Gemini API charges on a Firebase project
Firebase API keys ship inside your app, so a key allowed to call Gemini can be used by anyone. The Firebase API keys docs say to “never include the Gemini Developer API in the allowlist for a publicly accessible API key”. Call Gemini from your server, and know that budget alerts don’t pause services. Full steps: Unexpected Gemini API charges.
Which to check first
Start with the exact error code and the service that returned it: Firestore, Storage, Cloud Functions or Messaging. App369’s full order for a Firebase app that just broke:
- Note which service failed and whether it fails for every user or only some.
- For a permissions error, read the deployed rules, not the file on your laptop, and test the request in the Rules Playground.
- For a Cloud Function, read its logs in the console before changing code.
- Open the Usage tab and the billing page to rule out a quota or a spending problem.
- Check what changed since it last worked: rules, indexes, App Check enforcement, the Node.js version.
The Firebase errors and fixes page lists every Firebase fix. The free Firebase Security Rules checker flags open paths in a pasted rules file.
Need a hand?
App369 fixes single Firebase backend bugs at a fixed price. If one bug is the whole problem, the App Fix Ticket covers it in two fixed-price steps: a $450 diagnosis that finds the root cause and gives you a fixed quote for the fix, then the fix itself. If the rules themselves need work, the Firebase Security Rules Audit + Fix PR is $950: it tests your Firestore and Storage rules the way an attacker would, on the emulator, and fixes what fails. For a bill that keeps growing, the Firebase Cost-Cut Audit is $750. Or describe the problem and get a written quote.
Frequently asked questions
- How do I fix FirebaseError: Missing or insufficient permissions?
- Make the request match a rule that allows it. Filter the query on the same field the rule checks, start reads after the auth state listener reports a signed-in user, and paste the deployed rules into the Rules Playground to test the exact request.
- Why does my Firestore query require an index?
- It filters on one field and sorts or ranges on another, which needs a composite index. Open the link in the full error message to create it, wait for it to finish building, and keep it in firestore.indexes.json so production gets it too.
- Why is my Cloud Function blocked by CORS?
- HTTP functions have no CORS configured by default, so set the cors option to the domains that call it. For a callable function, which allows all origins by default, a CORS error can hide a wrong function name or region, a failed deploy or a crash.
- Can App369 fix a Firestore or Cloud Functions error for me?
- Yes. The App Fix Ticket covers one reproducible bug in two fixed-price steps: a $450 diagnosis that finds the root cause and gives you a fixed quote for the fix, then the fix itself.
Sources
- Firebase docs, Securely query data
- Firebase docs, Fix insecure rules
- Firebase docs, Manage indexes in Cloud Firestore
- Firebase docs, Usage and limits for Cloud Firestore
- Firebase docs, Call functions via HTTP requests
- Firebase docs, Manage functions
- Firebase docs, Enable App Check enforcement
- Firebase docs, FCM error codes
Related Resources
Related guides
AI API Errors: 7 OpenAI, Claude, Gemini and MCP Fixes (2026)
AI feature broken by a 401, 429 or 529, or an MCP connector that won't connect? 7 OpenAI, Anthropic, Gemini and MCP errors, what each means and how to fix it.
Read moreApp Store and Google Play Rejections: 13 Fixes (2026)
App rejected by Apple or Google Play? 13 rejections, from Guidelines 2.1, 4.3 and 5.1.1 to Play's Data safety form and 12-tester rule, and how to fix each.
Read more