Firestore Security Rules: Error running simulation –An unknown error occurred

155 Views Asked by At

Screenshot from the Firebase Console with the error

These are my security rules for Cloud Firestore:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /Feedback/{feedback} {
       allow read: if resource.data.uid == request.auth.uid;
    }
  }
}

It appears that I have a weird bug. When I try to access the documents in the "Feedback" collection, I get with my client a "permissioned denied" error. Using the Firestore Security Rules Playground, I get "Firestore Security Rules: Error running simulation –An unknown error occurred". I don't see where the issue with the security rules is.

I don't see any logs in my browser console. Already disabled uBlock Origin.

If I only use allow read: if request.auth.uid != null it works. However, I do something with resouce.data it throws an unknown error.

I already had a look into Error running simulation — An unknown error occurred. However, there is no solution to the problem.

3

There are 3 best solutions below

1
Frank van Puffelen On BEST ANSWER

firebaser here

Our console engineering team has confirmed the issue, and is rolling back a recent change.

  • March 6, 9:42AM PT: We've only seen reports of this affecting the rules playground. No other access (such as from SDKs) seems to be affected.
  • March 6, 10:40AM PT: Our console engineering team has confirmed the issue, and is rolling back a recent change.
  • March 7, 6:30AM PT: The engineering is rollout out a fix today.
0
umd On

I think it has something to do with default database being null. It says "/databases/null/documents" under "Rules Playground" title.

0
Leonel Riera On

That's because the resource.data.uid is null. I'm going through the same but instead getting the error "The path ... is improperly formatted. Paths should start with "/databases/$(database)/documents/". I think @umd is right, we are not pointing to the DB correctly, but have no idea how to change that null in the Location.

Mar 8: Firebase rolled out a fix for it