Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websockets.exceptions.InvalidMessage: did not receive a valid HTTP response #185

Open
zuils opened this issue Jan 16, 2024 · 1 comment
Open

Comments

@zuils
Copy link

zuils commented Jan 16, 2024

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/websockets/legacy/client.py", line 135, in read_http_response
status_code, reason, headers = await read_response(self.reader)
File "/usr/local/lib/python3.8/site-packages/websockets/legacy/http.py", line 122, in read_response
raise EOFError("connection closed while reading HTTP status line") from exc
EOFError: connection closed while reading HTTP status line

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "run.py", line 103, in
asyncio.run(showdown())
File "/usr/local/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "run.py", line 56, in showdown
ps_websocket_client = await PSWebsocketClient.create(
File "/showdown/showdown/websocket_client.py", line 35, in create
self.websocket = await websockets.connect(self.address)
File "/usr/local/lib/python3.8/site-packages/websockets/legacy/client.py", line 650, in await_impl_timeout
return await asyncio.wait_for(self.await_impl(), self.open_timeout)
File "/usr/local/lib/python3.8/asyncio/tasks.py", line 494, in wait_for
return fut.result()
File "/usr/local/lib/python3.8/site-packages/websockets/legacy/client.py", line 658, in await_impl
await protocol.handshake(
File "/usr/local/lib/python3.8/site-packages/websockets/legacy/client.py", line 322, in handshake
status_code, response_headers = await self.read_http_response()
File "/usr/local/lib/python3.8/site-packages/websockets/legacy/client.py", line 141, in read_http_response
raise InvalidMessage("did not receive a valid HTTP response") from exc
websockets.exceptions.InvalidMessage: did not receive a valid HTTP response

This was using nash_equilibrium and building with docker, never happened to me before

@pmariglia
Copy link
Owner

weird error - does this consistently happen to you, or was it a fluke?

did not receive a valid HTTP response does not seem like something that this bot can address

If it keeps happening I'd suggest upgrading to at least python 3.10, and then maybe come back with some more information about what PS server you are connecting to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants