Recently, sometimes when I use eikon.get_data(), it will occur 408 error, and the error kept coming up for the next 30 mins. Then suddenly it can works well again to get the data I want. I want to know why and how can this problem be sovled.
The error show below:
2023-12-13 11:11:03,926 P[9384] [MainThread 8516] HTTP TimeoutException: .
Traceback (most recent call last):
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio\_core\_tasks.py", line 115, in fail_after
yield cancel_scope
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\backends\asyncio.py", line 34, in read
return await self._stream.receive(max_bytes=max_bytes)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio\_backends\_asyncio.py", line 1103, in receive
await self._protocol.read_event.wait()
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\asyncio\locks.py", line 214, in wait
await fut
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\asyncio\futures.py", line 285, in __await__
yield self # This tells Task to wait for completion.
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 304, in __wakeup
future.result()
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\asyncio\futures.py", line 196, in result
raise exc
asyncio.exceptions.CancelledError: Cancelled by cancel scope 2216762ac50
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_exceptions.py", line 10, in map_exceptions
yield
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\backends\asyncio.py", line 32, in read
with anyio.fail_after(timeout):
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio\_core\_tasks.py", line 118, in fail_after
raise TimeoutError
TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_transports\default.py", line 60, in map_httpcore_exceptions
yield
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_transports\default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_async\connection_pool.py", line 261, in handle_async_request
raise exc
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_async\connection_pool.py", line 245, in handle_async_request
response = await connection.handle_async_request(request)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_async\connection.py", line 96, in handle_async_request
return await self._connection.handle_async_request(request)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_async\http11.py", line 120, in handle_async_request
raise exc
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_async\http11.py", line 99, in handle_async_request
) = await self._receive_response_headers(**kwargs)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_async\http11.py", line 163, in _receive_response_headers
event = await self._receive_event(timeout=timeout)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_async\http11.py", line 199, in _receive_event
data = await self._network_stream.read(
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\backends\asyncio.py", line 31, in read
with map_exceptions(exc_map):
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpcore\_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ReadTimeout
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\eikon\json_requests.py", line 114, in send_json_request
response = profile.send_request(json=ticket_request, timeout=(15.0, 15.0))
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\eikon\Profile.py", line 348, in send_request
response = self._desktop_session.http_request(url=self.get_url(),
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\eikon\streaming_session\session.py", line 670, in http_request
response = loop.run_until_complete(self.http_request_async(url, method, headers, data,
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\nest_asyncio.py", line 99, in run_until_complete
return f.result()
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\asyncio\futures.py", line 201, in result
raise self._exception.with_traceback(self._exception_tb)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 232, in __step
result = coro.send(None)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\eikon\streaming_session\session.py", line 658, in http_request_async
raise t
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\eikon\streaming_session\session.py", line 637, in http_request_async
_request_response = await self._http_session.request(
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 1530, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 1617, in send
response = await self._send_handling_auth(
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 1645, in _send_handling_auth
response = await self._send_handling_redirects(
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 1682, in _send_handling_redirects
response = await self._send_single_request(request)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_client.py", line 1719, in _send_single_request
response = await transport.handle_async_request(request)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_transports\default.py", line 352, in handle_async_request
with map_httpcore_exceptions():
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\httpx\_transports\default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadTimeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\idlelib\run.py", line 578, in runcode
exec(code, self.locals)
File "D:\eikon\SCS.py", line 87, in <module>
data_root_1, err = ek.get_data("0#SGXIOS62:", fields_root ,field_name = True) # Iron Ore 62% Fe, CFR China(USD/MT)',
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\eikon\data_grid.py", line 190, in get_data
result = eikon.json_requests.send_json_request(_endpoint, payload, debug=debug)
File "C:\Users\JE Group Treasury\AppData\Local\Programs\Python\Python310\lib\site-packages\eikon\json_requests.py", line 131, in send_json_request
raise EikonError(408, error_msg)
eikon.eikonError.EikonError: Error code 408 | HTTP TimeoutException: .