Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#664 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
backend, databases

调研方向

从 db.reference(...).listen(exampleFunc) 使用的 Python Realtime Database 监听器路径,以及数据库更新后报告的 requests.exceptions.HTTPError 502 响应开始。将监听器设置以及所有可用的项目 ID 和时间戳与服务器端日志进行对照检查。完成的标准是确定一个可复现的原因,或记录应如何处理该间歇性故障。

由索引模型根据 Issue 内容生成。

描述

needs-triage
[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('<listening location 1>').listen(exampleFunc)
listener2=db.reference('<listening location 2>').listen(exampleFunc)
主要语言
Python
星标
1.2k
派生
359
平均合并
3 天 9 小时
30 天内合并 PR
3

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/firebase-admin-python 的其他 Issue

查看 firebase/firebase-admin-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。