firebase / firebase/firebase-admin-python

Python Firebase Admin SDK Listener sometimes throws Bad Gateway errors after DB is updated

Đang mở
#664 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
needs-triage
Ngôn ngữ chính
Python
Star
1.2k
Fork
359
Merge trung bình
5 ngày 6 phút
Pull request đã merge (30 ngày)
2

Mô tả

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

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

* Operating System version: cos-stable-101-17162-40-5
* Firebase SDK version: latest?
* Firebase Product: realtime database, admin SDK
* Python version: 3.8
* Pip version: latest?

### [REQUIRED] Step 3: Describe the problem
I have a database with customers data in it. When a new customer is added, a Firebase function triggers and updates '' to [user.uid]: to represent credits in my system. I have a google cloud VM that has an admin sdk database listener setup. Every month or so, after a new customer signs up, all of my listeners will randomly throw an error. The error I am seeing is:
**requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://-default-rtdb.firebaseio.com/.json**

I am using the realtime listener described in this stack overflow post top answer:
https://stackoverflow.com/questions/49863708/python-firebase-realtime-listener

#### Steps to reproduce:
Hard to reproduce, but I can also provide my project ID and exact times for the issue so that the Firebase team can look into server-side logs to see what the issue might be.

#### Relevant Code:
```
from firebase_admin import db
def exampleFunc(event):
try:
print(event)
except Exception as e:
return

#in startup function
listener1=db.reference('').listen(exampleFunc)
listener2=db.reference('').listen(exampleFunc)
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

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

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.