ERROR Collecting Reuters estimates failed

Hi,
I collected listings from IBKR with "collect_ibkr_listings(exchanges='SEHK', sec_types=['STK'])" in notebook, but when I run "collect_reuters_estimates(universes=['hongkong'])" and after few requests this error occurs (flightlog):

2020-09-02 07:52:08 quantrocket.fundamental: INFO Collecting Reuters estimates from IBKR for universes hongkong
2020-09-02 07:52:47 quantrocket.fundamental: INFO Expected remaining runtime to collect Reuters estimates for universes hongkong: 0:54:56
2020-09-02 08:08:47 quantrocket.fundamental: ERROR Traceback (most recent call last):
2020-09-02 08:08:47 quantrocket.fundamental: ERROR   File "sym://qrocket_fundamental_ibkr_collect_workers_py", line 19, in wrapped
2020-09-02 08:08:47 quantrocket.fundamental: ERROR   File "sym://qrocket_fundamental_ibkr_collect_parse_py", line 35, in run
2020-09-02 08:08:47 quantrocket.fundamental: ERROR   File "sym://qrocket_fundamental_ibkr_collect_parse_py", line 206, in _parse_report
2020-09-02 08:08:47 quantrocket.fundamental: ERROR   File "/opt/conda/lib/python3.7/site-packages/xmltodict.py", line 330, in parse
2020-09-02 08:08:47 quantrocket.fundamental: ERROR     parser.Parse(xml_input, True)
2020-09-02 08:08:47 quantrocket.fundamental: ERROR xml.parsers.expat.ExpatError: syntax error: line 1, column 0
2020-09-02 08:08:47 quantrocket.fundamental: ERROR 
2020-09-02 08:08:47 quantrocket.fundamental: ERROR Collecting Reuters estimates failed due to error: syntax error: line 1, column 0

Error from flightlog2:

quantrocket_fundamental_1|Issuing to ibg1 Reuters estimates fundamental data request (RESC) for 863 (sid FIBBG002WJ33Z0)
quantrocket_fundamental_1|Parsing Reuters XML for 863 (sid FIBBG002WJ33Z0)
quantrocket_fundamental_1|Exception in thread parse_report_worker:
quantrocket_fundamental_1|Traceback (most recent call last):
quantrocket_fundamental_1|  File "/opt/conda/lib/python3.7/threading.py", line 926, in _bootstrap_inner
quantrocket_fundamental_1|    self.run()
quantrocket_fundamental_1|  File "/opt/conda/lib/python3.7/threading.py", line 870, in run
quantrocket_fundamental_1|    self._target(*self._args, **self._kwargs)
quantrocket_fundamental_1|  File "sym://qrocket_fundamental_ibkr_collect_workers_py", line 19, in wrapped
quantrocket_fundamental_1|  File "sym://qrocket_fundamental_ibkr_collect_parse_py", line 35, in run
quantrocket_fundamental_1|  File "sym://qrocket_fundamental_ibkr_collect_parse_py", line 206, in _parse_report
quantrocket_fundamental_1|  File "/opt/conda/lib/python3.7/site-packages/xmltodict.py", line 330, in parse
quantrocket_fundamental_1|    parser.Parse(xml_input, True)
quantrocket_fundamental_1|xml.parsers.expat.ExpatError: syntax error: line 1, column 0

quantrocket's version is 2.1, the same error was for Sweden. But "collect_reuters_financials()" worked ok.
Please help, what's wrong and where?

IBKR/Reuters has started returning some reports (as of today) that are not valid XML but instead say "MISSING_DATA". Normally the IBKR API returns an error code (430) to indicate that no data is available for a security. QuantRocket looks for that and is not expecting this invalid XML.

The 2.2 release will be out later this week and we can include a fix to handle this scenario as a new way of indicating "no data available". In the meantime you will need to exclude those securities from your universe if you want to collect the data, though that may be tedious and it might be easier to wait for version 2.2.

1 Like

Version 2.2.0 is now available and includes a fix for this issue.

This topic was automatically closed after 4 days. New replies are no longer allowed.