Kodingan Anak Muda
Kodingan Anak Muda

Reputation: 25

firebase init Error: HTTP Error: 403, Permission denied to get service [firebasedatabase.googleapis.com]

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

Answers (1)

Ziwon
Ziwon

Reputation: 749

Check if your service account has the right access rights. Try below.

  1. Follow link

https://console.cloud.google.com/iam-admin/iam?project=api

  1. Find the member that ends with "@appspot.gserviceaccount.com", and click "edit".

  2. Give it "Editor Role", or attach "Firebase Realtime Database Admin". enter image description here

Upvotes: 1

Related Questions