firestore CREDENTIALS Error when deploying firebase cloud function written in python
@cabljac đang làm issue này rồi.
Từ ngày 21/8/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
[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
- Ngôn ngữ chính
- Python
- Star
- 167
- Fork
- 36
- Merge trung bình
- 4 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/firebase-functions-python
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
HttpsError.__init__ does not pass message to super().__init__()Có thể đã có người làm @Aayush99910 đã nhận 2 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
firebase/firebase-functions-python#314 · 1 bình luận ·
-
Add support for VPC direct connectCó thể đã có người làm @IzaakGough đã nhận 107 ngày trước. Đang mởfeature-request
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
firebase/firebase-functions-python#275 · 1 bình luận · 1 reaction ·
-
feature-request
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
firebase/firebase-functions-python#271 · 3 bình luận ·
-
[Bug] stability_digest_payload_from_ce_payload fails with AttributeError: 'dict' object has no attribute 'split'Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug unable to reproduce
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
firebase/firebase-functions-python#260 · 6 bình luận ·
Tất cả issue của firebase/firebase-functions-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Multi-day events show "Ended" while still in progressCó thể đã có người làm @tarunagnihotri534 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
data-umbrella/du-event-board#231 · 2 bình luận ·
-
avl_automation: the generated control surface block isn't valid XML (typo in avl_out_parse.py)Có thể đã có người làm @brksol đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
PX4/PX4-gazebo-models#164 ·