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
- 平均合併
- 5 天 11 小時
- 30 天內合併 PR
- 3
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
firebase/firebase-functions-python 的其他 Issue
-
identity_fn.AuthBlockingEvent is still missing auth_type and resource可能已有人在做 @IzaakGough 於 1 天前認領。 未關閉bug reproduced
難度 2/5 1-3 小時 新手友好度 84/100
firebase/firebase-functions-python#316 · 1 則留言 ·
-
Add support for VPC direct connect可能已有人在做 @IzaakGough 於 111 天前認領。 未關閉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'可能已有人在做 @hardikkaurani 於 19 天前認領。 未關閉bug unable to reproduce
難度 3/5 1-2 天 新手友好度 55/100
firebase/firebase-functions-python#260 · 6 則留言 ·
-
feature-request
難度 5/5 一週以上 新手友好度 25/100
firebase/firebase-functions-python#249 · 2 則留言 ·
查看 firebase/firebase-functions-python 的全部 Issue
相似的 Issue
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunk可能已有人在做 @rodricksz4h5 今天認領。 未關閉area/streaming comp/gateway P2 type/security
難度 2/5 1-3 小時 新手友好度 78/100
NousResearch/hermes-agent#138245 ·
維護者通常 1 天內回覆
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS step可能已有人在做 @github-actions 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 66/100
維護者通常 1 天內回覆
-
correction metadata
難度 2/5 1 小時以內 新手友好度 68/100
acl-org/acl-anthology#10378 · 1 則留言 ·
維護者通常 1 天內回覆
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom name可能已有人在做 @12YYCCYY16 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
prowler-cloud/prowler#13033 ·
維護者通常 1 天內回覆
-
enhancement
難度 1/5 1-3 小時 新手友好度 88/100
graygarbage/HermesKey#23 ·