Reputation: 25
I'm trying to use firebase init with package firebase, firebase-admin and firebase-tools. I've downloaded the json file from the firebase console and I've put it on the server, then i run firebase init
function. there i choose realtime database and use existing project
but after that function run i get error
Error: HTTP Error: 403, Permission denied to get service [firebasedatabase.googleapis.com]
Help Token: ***this is help token***
here are the details of the results of the firebase init that I did
root@api:/var/www/api/public_html# firebase init
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
/var/www/api/public_html
Before we get started, keep in mind:
* You are currently outside your home directory
? Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter to confirm your choices. Realtime Databas
e: Configure a security rules file for Realtime Database and (optionally) provision default instance
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? Please select an option: Use an existing project
? Select a default Firebase project for this directory: api (Api)
i Using project api (Api)
=== Database Setup
i database: ensuring required API firebasedatabase.googleapis.com is enabled...
Error: HTTP Error: 403, Permission denied to get service [firebasedatabase.googleapis.com]
Help Token: ***this is help token***
Upvotes: 1
Views: 4743
Reputation: 749
Check if your service account has the right access rights. Try below.
https://console.cloud.google.com/iam-admin/iam?project=api
Find the member that ends with "@appspot.gserviceaccount.com", and click "edit".
Give it "Editor Role", or attach "Firebase Realtime Database Admin".
Upvotes: 1