firebase / firebase/firebase-admin-python

ECONNRESET connecting to Firebase auth emulator from functions emulator with grpc imported

Abierto
#945 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
1.2k
Forks
359
Merge medio
5 d 6 min
PR fusionados (30 d)
2

Descripción

### [READ] Step 1: Are you in the right place?

I’m not sure that the root cause of this issue is, but this repo seems like the most likely culprit. Other possibilities: gRPC, firebase-tools, firebase-functions.

### [REQUIRED] Step 2: Describe your environment

* Operating System version: macOS 15.7.4 (24G517)
* Firebase SDK version: 7.4.0
* Firebase Product: auth
* Python version: 3.11.15
* Pip version: uv 0.11.6

### [REQUIRED] Step 3: Describe the problem

#### Steps to reproduce:

[danielparks/firebase-emulator-auth-hang-up](https://github.com/danielparks/firebase-emulator-auth-hang-up) is minimal test repo with more exhaustive details including a workaround.

Within a Python cloud function that has `grpc` or `firebase_admin.firestore` imported, call an `auth` method, e.g. `auth.create_user(...)`, or make a GET request to the auth endpoint, e.g. `requests.get("http://127.0.0.1:9099/", timeout=1)`.

The function will fail with `ECONNRESET` (“Error: socket hang up”).

#### Relevant Code:

Simplified example (see [the repo above](https://github.com/danielparks/firebase-emulator-auth-hang-up) for a functional example):

```python
from firebase_admin import initialize_app
from firebase_functions import https_fn
import requests

import grpc
# or, import firebase_admin.firestore

initialize_app()

@https_fn.on_call()
def connect(req):
# Make a simple GET request to the auth emulator endpoint:
return repr(requests.get("http://127.0.0.1:9099/", timeout=1))
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.