Rendering Large Images Causes A ChunkedEncodingerror
It seems that having a large image causes some timeout to happen server-side which kills the connection, resulting in this error.
-- Saving Image 'Renders/Simulation39_Region0_Slice0.bmp'
Warning, Attempt 0 Has Failed, Retrying Query https://api.braingenix.org:443/NES/VSDA/EM/GetImage?SimulationID=39&ImageHandle=Renders/Simulation39_Region0_Slice0.bmp&AuthKey=MyVerySecureToken
Python Reports Error: ('Connection broken: IncompleteRead(12976019 bytes read, 9393796 more expected)', IncompleteRead(12976019 bytes read, 9393796 more expected))
Warning, Attempt 1 Has Failed, Retrying Query https://api.braingenix.org:443/NES/VSDA/EM/GetImage?SimulationID=39&ImageHandle=Renders/Simulation39_Region0_Slice0.bmp&AuthKey=MyVerySecureToken
Python Reports Error: ('Connection broken: IncompleteRead(11616147 bytes read, 10753668 more expected)', IncompleteRead(11616147 bytes read, 10753668 more expected))
Warning, Attempt 2 Has Failed, Retrying Query https://api.braingenix.org:443/NES/VSDA/EM/GetImage?SimulationID=39&ImageHandle=Renders/Simulation39_Region0_Slice0.bmp&AuthKey=MyVerySecureToken
Python Reports Error: ('Connection broken: IncompleteRead(10518419 bytes read, 11851396 more expected)', IncompleteRead(10518419 bytes read, 11851396 more expected))
Warning, Attempt 3 Has Failed, Retrying Query https://api.braingenix.org:443/NES/VSDA/EM/GetImage?SimulationID=39&ImageHandle=Renders/Simulation39_Region0_Slice0.bmp&AuthKey=MyVerySecureToken
Python Reports Error: ('Connection broken: IncompleteRead(12730259 bytes read, 9639556 more expected)', IncompleteRead(12730259 bytes read, 9639556 more expected))
Traceback (most recent call last):
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/urllib3/response.py", line 712, in _error_catcher
yield
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/urllib3/response.py", line 833, in _raw_read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
urllib3.exceptions.IncompleteRead: IncompleteRead(10387347 bytes read, 11982468 more expected)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/requests/models.py", line 816, in generate
yield from self.raw.stream(chunk_size, decode_content=True)
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/urllib3/response.py", line 934, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/urllib3/response.py", line 905, in read
data = self._raw_read(amt)
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/urllib3/response.py", line 811, in _raw_read
with self._error_catcher():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/urllib3/response.py", line 729, in _error_catcher
raise ProtocolError(f"Connection broken: {e!r}", e) from e
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(10387347 bytes read, 11982468 more expected)', IncompleteRead(10387347 bytes read, 11982468 more expected))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/BrainGenix/NES/Client/RequestHandler.py", line 27, in MakeQuery
Response = requests.get(f"{self.URIBase}{_URIStub}")
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/requests/sessions.py", line 747, in send
r.content
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/requests/models.py", line 899, in content
self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/requests/models.py", line 818, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(10387347 bytes read, 11982468 more expected)', IncompleteRead(10387347 bytes read, 11982468 more expected))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tom/Documents/PythonClient/Test/SimpleTest.py", line 134, in <module>
main()
File "/home/tom/Documents/PythonClient/Test/SimpleTest.py", line 128, in main
ImageData = VSDAEMInstance.GetImage(Image)
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/BrainGenix/NES/VSDA/EM/EM.py", line 59, in GetImage
Response = self.RequestHandler.MakeAuthenticatedQuery(f"/NES/VSDA/EM/GetImage?SimulationID={self.SimulationID}&ImageHandle={_ImageHandle}")
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/BrainGenix/NES/Client/RequestHandler.py", line 46, in MakeAuthenticatedQuery
return self.MakeQuery(URIStub)
File "/home/tom/Documents/PythonClient/TestEnv/lib/python3.10/site-packages/BrainGenix/NES/Client/RequestHandler.py", line 31, in MakeQuery
raise ConnectionError("Error Communicating With API, An IncompleteRead Has Occured!")
ConnectionError: Error Communicating With API, An IncompleteRead Has Occured!