firestore CREDENTIALS Error when deploying firebase cloud function written in python
评估
这个 Issue 还没有评估数据。
描述
[REQUIRED] Environment info
firebase-tools:12.4.7
Platform: windows with python version of 3.11
[REQUIRED] Test case
i have code like below in for firebase cloud function in main.py.
when i test function using firebase emulators:start --only functions it worked perfectly
now when i try to deploy it using firebase deploy --only functions it gave me below error while pointing to db = firestore.client()
line in code
error
"""""""""
raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.
"""""""""
code
"""
from firebase_functions import https_fn, options
import firebase_admin
from firebase_admin import firestore
app = firebase_admin.initialize_app()
options.set_global_options(timeout_sec=1000)
db = firestore.client()
firebase function that write something to firestore database is written below
"""
[REQUIRED] Steps to reproduce
use above code in main.py inside functions folder and try to deploy functions you will get same error
[REQUIRED] Expected behavior
credential should be automatically added since i am logged into my account using firebase login and using correct Project ID. it did not ask for credential when i was tasing using firebase emulators:start --only functions and it was working perfectly.
[REQUIRED] Actual behavior
it's asking for credential
- 主要语言
- Python
- 星标
- 167
- 派生
- 36
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/firebase-functions-python 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
-
HttpsError.__init__ does not pass message to super().__init__()可能已有人在做 @Aayush99910 于 4 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
firebase/firebase-functions-python#314 · 1 条评论 ·
-
Add support for VPC direct connect可能已有人在做 @IzaakGough 于 108 天前认领。 未关闭feature-request
难度 4/5 3-5 天 新手友好度 48/100
firebase/firebase-functions-python#275 · 1 条评论 · 1 个 reaction ·
-
feature-request
难度 4/5 3-5 天 新手友好度 35/100
firebase/firebase-functions-python#271 · 3 条评论 ·
-
[Bug] stability_digest_payload_from_ce_payload fails with AttributeError: 'dict' object has no attribute 'split'可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug unable to reproduce
难度 3/5 1-2 天 新手友好度 55/100
firebase/firebase-functions-python#260 · 6 条评论 ·
查看 firebase/firebase-functions-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
NousResearch/hermes-agent#136483 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
[BUG] LazyStackedTensorDictStore zeroes the last byte of a new key set on the last element可能已有人在做 @peterdsharpe 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
pytorch/tensordict#2307 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
GrokModel.generate/a_generate pass an OpenAI-style list-of-dicts to xai_sdk.chat.user(), so every call crashes with a protobuf TypeError before any network I/O可能已有人在做 @Christian-Sidak 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
confident-ai/deepeval#3436 · 1 条评论 ·
维护者通常 1 天内回复