2
votes

I am trying to upload .mp3 files via Firebase-storage but I am running into an issue with the permissions/rules. Every time I upload I get a console warning

"FIREBASE WARNING: update at / failed: permission_denied"

and

"firebase.js:478 Uncaught (in promise) Error: PERMISSION_DENIED: Permission denied"

Despite these errors, I still find the file in Firebase-storage. However, these errors prevent my code from running smoothly. I have found that changing the rules in my Firebase-Database allows me to upload with no issues.

By changing the rules in the Firebase-Database to be:

{
    "rules": {
       ".read": "true",
       ".write": "true"
     }
 }

I am able to upload the .mp3 with no issues. Obviously for security reasons I can't have these rules always being true.

My storage rules are

match /{allPaths=**} {
  allow read, write: if request.auth != null;
}

Does anyone know if there is a connection between Firebase-Storage and the Firebase-Database/rules? Or how to resolve my permissions errors?

1
That lead me on the correct path, thanks a ton @DineshBraxton Young

1 Answers

0
votes

Turns out the issue I was having was not related to the Storage. I had not supplied a rule for part of the data I was posting to the database. That is why the errors would not show up if I added a ".write": "true".