【问题标题】:Uvicorn error on Amazon EC2 instance gives Receive buffer too long error using fastapiAmazon EC2 实例上的 Uvicorn 错误使用 fastapi 给出 Receive buffer too long 错误
【发布时间】:2021-10-29 03:55:43
【问题描述】:
WARNING:  Invalid HTTP request received.
Traceback (most recent call last):
  File "/home/ubuntu/MySQL_UI_Backend/venv/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 136, in handle_events
    event = self.conn.next_event()
  File "/home/ubuntu/MySQL_UI_Backend/venv/lib/python3.8/site-packages/h11/_connection.py", line 432, in next_event
    raise RemoteProtocolError(
h11._util.RemoteProtocolError: Receive buffer too long
WARNING:uvicorn.error:Invalid HTTP request received.
Traceback (most recent call last):
  File "/home/ubuntu/MySQL_UI_Backend/venv/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 136, in handle_events
    event = self.conn.next_event()
  File "/home/ubuntu/MySQL_UI_Backend/venv/lib/python3.8/site-packages/h11/_connection.py", line 432, in next_event
    raise RemoteProtocolError(
h11._util.RemoteProtocolError: Receive buffer too long

API 在本地运行良好,但是当我在 EC2 上运行它时,出现上述错误,我使用的端口是 API 服务器的 7879,运行在 react 上的前端 UI 的端口是 6869

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: python amazon-web-services amazon-ec2 fastapi uvicorn


【解决方案1】:

1.确保您使用的端口在您的安全组设置中处于打开状态。

2.尝试将网址从https更改为http

【讨论】:

    猜你喜欢
    • 2021-04-12
    • 1970-01-01
    • 2023-03-18
    • 2014-05-25
    • 2017-02-18
    • 1970-01-01
    • 2021-08-14
    • 2021-04-12
    • 2017-08-26
    相关资源
    最近更新 更多