Uvicorn error on Amazon EC2 instance gives Receive buffer too long error using fastapi

Viewed 778
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

The APIs are working fine locally but when I run it on EC2, I get the above error, the ports I have used are 7879 for the API server, 6869 for the frontend UI running on react

1 Answers

1.Make sure that the ports that you use are open at your security group settings.

2.Try changing the url from https to http

Related