Firebase 502 服务器错误:网关错误

dan*_*iel 5 python firebase

当我不时通过 python 将数据发布到 firebase 时,我收到错误:

HTTPError: 502 Server Error: Bad Gateway
Run Code Online (Sandbox Code Playgroud)

这似乎是随机的。我无法确定原因。有时我也遇到通过 C# 从 firebase 获取数据的问题。重试几次后就可以了。

Kar*_*k R -1

(作为答案添加 - 无法添加评论 - 缺乏声誉)

这是一个非常古老的问题,但以防万一有人正在寻找类似的东西。

我使用 python 时遇到了类似的问题 - 主要是 firebase 的随机错误,但后来我看到它发生在其他网络操作期间 - 一次在 elasticsearch 上进行操作,一次在尝试发送电子邮件时看到与 firebase 相关的错误

502 Server Error: Bad Gateway for url: **********/created.json
Reason: Internal server error

OR 


HTTPSConnectionPool(host='stylemates-int.firebaseio.com', port=443): Max retries exceeded with url: *******************
Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fa8baf54198>: Failed to establish a new connection: [Errno -2] Name or service not known',)).
Run Code Online (Sandbox Code Playgroud)

这是在 AWS EC2 上运行的 ubuntu 实例上。在发生错误的同时检查系统日志显示操作系统正在尝试更新IP。这对应于每次出现 firebase 错误或任何其他 n/w 错误时此 Linux 实例用于在具有动态 IP 的 AWS EC2 上进行开发测试。我希望为这个 Linux 实例设置静态 IP 可以解决这个问题。由于机器目前无法重置,我几天内无法尝试此操作。我尝试后会发布结果。

Ubuntu 日志

$ sudo journalctl --since "2019-05-13 09:50:00" --until "2019-05-13 09:50:59"
-- Logs begin at Sat 2019-03-16 22:22:42 UTC, end at Mon 2019-05-13 13:37:41 UTC. --
May 13 09:50:09 ip-172-32-1-88 dhclient[930]: DHCPREQUEST of 172.32.1.88 on eth0 to 172.32.0.1 port 67 (xid=********)
May 13 09:50:09 ip-172-32-1-88 dhclient[930]: DHCPACK of 172.32.1.88 from 172.32.0.1
May 13 09:50:09 ip-172-32-1-88 systemd[1]: Stopping Network Name Resolution...
May 13 09:50:09 ip-172-32-1-88 systemd[1]: Stopped Network Name Resolution.
May 13 09:50:09 ip-172-32-1-88 systemd[1]: Starting Network Name Resolution...
May 13 09:50:10 ip-172-32-1-88 systemd-resolved[11278]: Positive Trust Anchors:
May 13 09:50:10 ip-172-32-1-88 systemd-resolved[11278]: . IN *****
May 13 09:50:10 ip-172-32-1-88 systemd-resolved[11278]: . IN *****
May 13 09:50:10 ip-172-32-1-88 systemd-resolved[11278]: Negative trust anchors: *****
May 13 09:50:10 ip-172-32-1-88 systemd-resolved[11278]: Using system hostname 'ip-172-32-1-88'.
May 13 09:50:10 ip-172-32-1-88 systemd[1]: Started Network Name Resolution.
May 13 09:50:10 ip-172-32-1-88 systemd[1]: Starting resolvconf-pull-resolved.service...
May 13 09:50:10 ip-172-32-1-88 systemd[1]: Started resolvconf-pull-resolved.service.
May 13 09:50:10 ip-172-32-1-88 dhclient[930]: bound to 172.32.1.88 -- renewal in 1517 seconds.

Run Code Online (Sandbox Code Playgroud)