gpt4 book ai didi

python - Firebase 502 服务器错误 : Bad Gateway

转载 作者:太空宇宙 更新时间:2023-11-03 12:03:48 26 4
gpt4 key购买 nike

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

HTTPError: 502 Server Error: Bad Gateway

这似乎是随机的。我无法确定原因。有时我也有通过 C# 从 firebase 获取数据的问题。经过一些重试后,它起作用了。

最佳答案

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

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

我在使用 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',)).

这是在 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.

关于python - Firebase 502 服务器错误 : Bad Gateway,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39154381/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com