【问题标题】:firebase init Error: HTTP Error: 403, Permission denied to get service [firebasedatabase.googleapis.com]firebase init 错误:HTTP 错误:403,获取服务的权限被拒绝 [firebasedatabase.googleapis.com]
【发布时间】:2021-09-06 05:51:53
【问题描述】:

我正在尝试将 firebase init 与 firebase、firebase-admin 和 firebase-tools 包一起使用。我已经从 firebase 控制台下载了 json 文件并将其放在服务器上,然后我运行 firebase init 函数。那里我选择realtime database and use existing project

但在该函数运行后我得到错误

Error: HTTP Error: 403, Permission denied to get service [firebasedatabase.googleapis.com]
Help Token: ***this is help token***

这里是我所做的 firebase init 的结果的详细信息

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***

【问题讨论】:

    标签: firebase firebase-realtime-database firebase-authentication firebase-cli


    【解决方案1】:

    检查您的服务帐户是否具有正确的访问权限。试试下面。

    1. 点击链接

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

    1. 找到以“@appspot.gserviceaccount.com”结尾的成员,点击“编辑”。

    2. 给它“编辑角色”,或附加“Firebase 实时数据库管理员”。

    【讨论】:

    • 不为我工作,先生您还有其他建议吗?
    • 可能需要检查几件事。 1. 运行firebase login 并查看您是否以正确的用户身份登录。 2.运行firebase projects:list,你的目标项目就在那里。
    • 如何在ubuntu终端运行firebase login
    • 嗯.. 你是如何运行 firebase init 的?
    • 我的毛囊谢谢你!这就是我一直在寻找的!
    猜你喜欢
    • 1970-01-01
    • 2016-04-21
    • 2016-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-30
    • 1970-01-01
    • 2022-11-11
    相关资源
    最近更新 更多