firestore CREDENTIALS Error when deploying firebase cloud function written in python
@cabljac arbeitet bereits daran.
Seit 21.8.2025.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
[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
- Vorherrschende Sprache
- Python
- Sterne
- 167
- Forks
- 36
- Ø Merge
- 4 T. 3 Std.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus firebase/firebase-functions-python
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
-
HttpsError.__init__ does not pass message to super().__init__()Evtl. vergeben @Aayush99910 hat das vor 5 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
firebase/firebase-functions-python#314 · 1 Kommentar ·
-
Add support for VPC direct connectEvtl. vergeben @IzaakGough hat das vor 110 Tagen übernommen. Offenfeature-request
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
firebase/firebase-functions-python#275 · 1 Kommentar · 1 Reaktion ·
-
feature-request
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
firebase/firebase-functions-python#271 · 3 Kommentare ·
-
[Bug] stability_digest_payload_from_ce_payload fails with AttributeError: 'dict' object has no attribute 'split'Evtl. vergeben @hardikkaurani hat das vor 17 Tagen übernommen. Offenbug unable to reproduce
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
firebase/firebase-functions-python#260 · 6 Kommentare ·
Alle Issues in firebase/firebase-functions-python
Ähnliche Issues
-
bug Triage-Needed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
FuRongJun-1999/dsh-memory#170 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
521xueweihan/HelloGitHub#3940 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100