Short answer
Usually the query asks for more than the rules allow. Firestore rules are not filters: if a query could return even one document the user can’t read, the whole query fails. Add the same conditions to the query that the rule checks. Next most likely: no user is signed in yet when the request runs.
The usual causes, and the fix
01
The query doesn’t match the rule
If the rule only allows documents where ownerId equals the user’s ID, the query must filter on ownerId too. A query for the whole collection fails even if every document in it happens to be the user’s. The same goes for limits: if the rule checks request.query.limit, the query needs a limit that passes.
// rule: allow read: if resource.data.ownerId == request.auth.uid; query(collection(db, 'projects'), where('ownerId', '==', user.uid));02
No user is signed in yet
Rules that check request.auth.uid fail when the request runs before sign-in finishes, or after the session ends. Start Firestore reads after the auth state listener reports a signed-in user, not on page load.
03
The rules really do deny it
Check the deployed rules, not the file on your laptop. If they compare request.time with a fixed date, they stop allowing anything once that date passes. Then try the exact request in the Rules Playground in the Firebase console, which tests the rules in its editor, so start from the deployed version. Unit tests against the emulator work too. After you deploy new rules, allow up to a minute for new queries and up to 10 minutes for open listeners.
04
App Check enforcement is on
Once App Check enforcement is on for Firestore, requests without a valid App Check token are rejected. If the error started when enforcement was turned on, set up App Check in the client, including a debug token for local testing.
Checked against the vendor’s docs on : Firebase docs: Securely query data; Firebase docs: Get started with Cloud Firestore Security Rules; Firebase docs: Quickly validate Firebase Security Rules; Firebase docs: Enable App Check enforcement.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.See scope and start
Related: Free Firebase rules checker