Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

firestore CREDENTIALS Error when deploying firebase cloud function written in python

Đang mở
#126 17 bình luận 3 reaction 1 người được giao Xem trên GitHub

@cabljac đang làm issue này rồi.

Từ ngày 21/8/2025.

  • #6274 của @colerogers — đang mở
  • #9028 của @cabljac — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug reproduced

[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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của firebase/firebase-functions-python

Tất cả issue của firebase/firebase-functions-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.