Datastore emulator causes firebase admin to hang
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- authentication, databases
Direzione di ricerca
Inizia eseguendo i comandi dell’emulatore datastore riportati nel report e lo script Python fornito, concentrandoti sulla transizione da datastore_client.context() a auth.get_user_by_email(). Confronta il comportamento rimuovendo le tre righe relative al contesto datastore. Il lavoro è completato quando la ricerca Firebase Auth restituisce normalmente mentre l’emulatore datastore è in esecuzione e il processo rimane interrompibile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
[REQUIRED] Step 2: Describe your environment
- Operating System version: Mac 14.5
- Firebase Product: firebase-admin==6.2.0 and firebase-admin==6.5.0
- Python version: 3.11.4
- Pip version: 24.0
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
This problem started around June 1. Before, I have been doing this for several years without any issues.
The problem is that auth.get_user_by_email() freezes and it is caused by some interaction with running the cloud datastore emulator locally. This happens with either the older emulator (gcloud beta emulators datastore start) or the newer one (gcloud emulators firestore start ). I have tried downgrading gcloud and two versions of firebase-admin listed above.
Run the script below. At auth.get_user_by_email(), the script hangs indefinitely with no output. You can't even ctrl-c to stop the script. You need to kill -9 in a separate terminal window.
If you comment out the three lines starting with with datastore_client.context():, then auth.get_user_by_email() works.
Since the code just freezes, I am at a loss as to how to debug.
Relevant Code:
import os
from google.cloud import ndb
import firebase_admin
from firebase_admin import auth, initialize_app
print('starting')
class User(ndb.Model):
email = ndb.StringProperty(required=True)
os.environ['DATASTORE_DATASET'] = 'my-project'
os.environ['DATASTORE_EMULATOR_HOST'] = 'localhost:8081'
os.environ['DATASTORE_EMULATOR_HOST_PATH'] = 'localhost:8081/datastore'
os.environ['DATASTORE_HOST'] = 'http://localhost:8081'
os.environ['DATASTORE_PROJECT_ID']= 'my-project'
datastore_client = ndb.Client('my-project')
if not firebase_admin._apps:
initialize_app()
email = 'me@example.com'
with datastore_client.context():
user = User.get_by_id(email)
print(user)
# This hangs and you can't even ctrl-c to stop.
# Works if datastore client stuff is commented out.
fb_user = auth.get_user_by_email(email)
print(fb_user)
- Lingua principale
- Python
- Stelle
- 1.2k
- Fork
- 359
- Merge medio
- 3g 9h
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di firebase/firebase-admin-python
-
api: remoteconfig
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
firebase/firebase-admin-python#957 · 1 commento ·
-
api: database type: feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
firebase/firebase-admin-python#978 · 1 commento ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) Apertaapi: auth
firebase/firebase-admin-python#949 · 2 commenti · 1 reazione · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 43/100
firebase/firebase-admin-python#945 · 1 commento · 1 reazione ·
Tutte le issue di firebase/firebase-admin-python
Issue simili
-
essnmx good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
[Feature] 奇物选择添加优先级 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Giskard-AI/giskard-oss#2840 · 1 commento ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Apertaarea: repo bug perceived difficulty: 2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
yeti-platform/yeti#1380 ·