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

🐛 [rtdb, firestore, storage] permission denied errors are unhelpful #11677

Open
lukepighetti opened this issue Oct 6, 2023 · 2 comments
Open
Labels

Comments

@lukepighetti
Copy link
Contributor

lukepighetti commented Oct 6, 2023

Whenever we get a permission denied error (due to Rules), they are unhelpful. The expectation is to see the path and operation that failed, and optionally the JSON payload that was sent

How it works today

RTDB:

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: [firebase_database/permission-denied] 
Client doesn't have permission to access the desired data.

Firestore

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: [cloud_firestore/permission-denied] 
The caller does not have permission to execute the specified operation.

Cloud Storage

FLTFirebaseStorage: An unknown error occurred while calling method Reference#getDownloadURL

Ideal outcome

RTDB:

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: [firebase_database/permission-denied] 
Client doesn't have permission to read /foo/bar/baz.

Firestore

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: [cloud_firestore/permission-denied] 
The caller does not have permission to write /foo/bar/baz with payload {"hello": "world"}

Cloud Storage

FLTFirebaseStorage: An unknown error occurred while calling method Reference#getDownloadURL 
for "gs://foo.appspot.com/foo/bar/baz.jpg"

Resources

Firestore codepaths seem to have enough context to give better error messages without a big lift

Screenshot 2023-10-06 at 9 47 08 AM
@lukepighetti lukepighetti added Needs Attention This issue needs maintainer attention. type: enhancement New feature or request labels Oct 6, 2023
@darshankawar darshankawar added triage Issue is currently being triaged. plugin: cloud_firestore plugin: database plugin: storage and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Oct 9, 2023
@gOzaru
Copy link

gOzaru commented Oct 19, 2023

I also have this error. I used to be able to retrieve data correctly without any error. But now, it denies all my request to ask data from Firestore in latest updated of cloud_firestore. I wonder what happened.

@gOzaru
Copy link

gOzaru commented Oct 20, 2023

Okay, now it is fixed. Thank you team

@Lyokone Lyokone added the platform: all Issues / PRs which are for all platforms. label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 participants