We have already used firebase storage for storing the images and files in our application. Recently our files seem to bee not loading in the application and once cross-checking I found the following error.
{
"error": {
"code": 412,
"message": "A required service account is missing necessary permissions. Please resolve by visiting the Storage page of the Firebase Console and re-linking your Firebase bucket or see this FAQ for more info: https://firebase.google.com/support/faq#storage-accounts"
}
}
After further investigation, I found a solution in the below-related FAQ.
https://firebase.google.com/support/faq/index#storage-accounts
As per the documentation, I have created a new service account with the I am admin role as Cloud Storage for Firebase Service Agent. It created a service account called service account name service-PROJECT_NUMBER@PROJECT_id.iam.gserviceaccount.com
. Also, I have enabled the IAM admin policies for managing services. But still but storage URL is not loading.
Do I need to add any more changes to storage permissions? How can I use the existing storage bucket data with the new updates?
4
Answers
I fixed the issue with the following steps. After setting the IAM policies in storage admin I tried with AddFirebaseAPI function using postman by passing the project id and storage bucket name. But it returns a not found error for me. I tried it with both project number as well as id. Both given the same error. About the error using Postman and the URL this should be working it solved by using
Here is an example of the HTTP call that the playground gives you
It will returns your bucket instance. Also it may takes a few mins to reflect the changes.
I just fixed this for my self.
See my screenshot here
As mentioned in this github.
If you open
firebase-storage
inconsole.firebase.google.com
,it gives you an alert saying
attach permission
. If you click on it, problem should be fixed automatically.If it doesn’t solve, then follow this Github
If you don’t find
project number @gcp-sa-firebasestorage.iam.gserviceaccount.com
in console permission, then make sure you click onattach permission
dialog in firebase storage.This is how my problem was solved.