Websocket server time out

Hi! I am getting an error after a while running the web page. The error says the following:

Exception happened during processing of request from (‘192.168.1.133’, 46686)
Traceback (most recent call last):
File “/usr/lib/python2.7/SocketServer.py”, line 599, in process_request_thread
self.finish_request(request, client_address)
File “/usr/lib/python2.7/SocketServer.py”, line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File “/usr/local/lib/python2.7/dist-packages/websocket_server/websocket_server.py”, line 136, in init
StreamRequestHandler.init(self, socket, addr, server)
File “/usr/lib/python2.7/SocketServer.py”, line 655, in init
self.handle()
File “/usr/local/lib/python2.7/dist-packages/websocket_server/websocket_server.py”, line 149, in handle
self.read_next_message()
File “/usr/local/lib/python2.7/dist-packages/websocket_server/websocket_server.py”, line 161, in read_next_message
b1, b2 = self.read_bytes(2)
File “/usr/local/lib/python2.7/dist-packages/websocket_server/websocket_server.py”, line 153, in read_bytes
bytes = self.rfile.read(num)
File “/usr/lib/python2.7/socket.py”, line 384, in read
data = self._sock.recv(left)
timeout: timed out

What this does is that the connection with the web page is lost and I have to reinitialize everything. Any solution?

Regards

Yes @Vlad.95 , even I have faced the same error. I think its mostly because of performance issue as RADI Containers aren’t fully optimised yet to take full advantage of the compute resources. But I am sure this will be resolved quickly.

Until then you can solve the exercise directly without using web templates. You can still use the RADI container by using something like this

## For Nvidia Container
xhost +
docker run -it --rm \
	-e DISPLAY=${DISPLAY} \
	-v ${XSOCK}:${XSOCK} \
	-v ${HOME}/.Xauthority:/root/.Xauthority \
	--privileged  --net=host --gpus all \
    --name container_name \
	docker_academy:latest /bin/bash
## For CPU container
xhost +
docker run -it --rm \
	-e DISPLAY=${DISPLAY} \
	-v ${XSOCK}:${XSOCK} \
	-v ${HOME}/.Xauthority:/root/.Xauthority \
	--net=host  \
    --name container_name \
	docker_academy:latest /bin/bash
1 Like

Thanks for the reply @Jovian-Dsouza!

@Vlad.95, can you post the exact terminal commands that you executed when you got the timeout error? One of the possible reasons could be not mapping all the required ports.

I used this command docker run -it -p 8080:8080 -p 7681:7681 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 jderobot/robotics-academy python3.8 manager.py

The simulation would work normally on startup and get stuck all of sudden and throw a time out error.

@trunc8 What system are you using ?

Yeah, that has been mentioned at some places but is incorrect. You should also include -p 1108:1108. Let me know if it works correctly for you.
My system specs

Ahh , Thanks @trunc8 , I will tried running the simulation by adding port 1108, but still getting “timed out error” error

172.17.0.1 - - [12/Apr/2021 05:19:45] 172.17.0.1: Plain non-SSL (ws://) WebSocket connection
172.17.0.1 - - [12/Apr/2021 05:19:45] 172.17.0.1: Path: '/websockify'
172.17.0.1 - - [12/Apr/2021 05:19:45] connecting to: localhost:5900
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 599, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/lib/python2.7/dist-packages/websocket_server/websocket_server.py", line 136, in __init__
    StreamRequestHandler.__init__(self, socket, addr, server)
  File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__
    self.handle()
  File "/usr/local/lib/python2.7/dist-packages/websocket_server/websocket_server.py", line 149, in handle
    self.read_next_message()
  File "/usr/local/lib/python2.7/dist-packages/websocket_server/websocket_server.py", line 161, in read_next_message
    b1, b2 = self.read_bytes(2)
  File "/usr/local/lib/python2.7/dist-packages/websocket_server/websocket_server.py", line 153, in read_bytes
    bytes = self.rfile.read(num)
  File "/usr/lib/python2.7/socket.py", line 384, in read
    data = self._sock.recv(left)
timeout: timed out

Also, What FPS are you getting on your system ?