Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase storage returning 412 error even after enabling storage API

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?

like image 847
Athulya Ratheesh Avatar asked Sep 07 '26 13:09

Athulya Ratheesh


1 Answers

I just fixed this for my self.

  1. Create a bucket in Cloud Storage
  2. Get your projectname and bucket name
  3. Go here: https://firebase.google.com/docs/reference/rest/storage/rest/v1beta/projects.buckets/addFirebase
  4. Press Try IT
  5. Fill in your projectname en bucket name. Press Execute é voila!

See my screenshot here

like image 68
HerbertV Avatar answered Sep 11 '26 03:09

HerbertV



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!