Datastore emulator causes firebase admin to hang
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- authentication, databases
Piste de recherche
Commencez par exécuter les commandes de l’émulateur datastore du rapport ainsi que le script Python fourni, en vous concentrant sur la transition de datastore_client.context() vers auth.get_user_by_email(). Comparez le comportement lorsque les trois lignes de contexte datastore sont supprimées. Le travail est considéré comme terminé lorsque la recherche Firebase Auth renvoie normalement alors que l’émulateur datastore est en cours d’exécution, et que le processus reste interruptible.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
[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)
- Langage dominant
- Python
- Étoiles
- 1.2k
- Forks
- 359
- Merge moyen
- 3 j 9 h
- PR mergées (30 j)
- 3
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de firebase/firebase-admin-python
-
api: remoteconfig
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
firebase/firebase-admin-python#957 · 1 commentaire ·
-
api: database type: feature request
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
firebase/firebase-admin-python#978 · 1 commentaire ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) Ouverteapi: auth
firebase/firebase-admin-python#949 · 2 commentaires · 1 réaction · 1 personne assignée ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 43/100
firebase/firebase-admin-python#945 · 1 commentaire · 1 réaction ·
Toutes les issues de firebase/firebase-admin-python
Issues similaires
-
essnmx good first issue
Difficulté 1/5 Moins d'une heure Accessibilité débutants 95/100
-
[Feature] 奇物选择添加优先级 Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Giskard-AI/giskard-oss#2840 · 1 commentaire ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Ouvertearea: repo bug perceived difficulty: 2
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
yeti-platform/yeti#1380 ·