EikonError: Error code 500 | Backend error. Failed to deserialize backend response. Expected vali...

...d JSON
I used to be able to query the the get_news_headlines() method using the below string formatting. But since this year I have been getting this error, while using the same code. I can't figure out a way to amend the query and still get the desired results.
From what I can see it seems to be encoding the backslashs in a way that makes the query unusable. It did not used to do this. Are you aware of any changes that were made that might cause this, and any solutions?
Code:
fo_all_str = "(\\\"Platts FO\\\" AND \\\"SELLS\\\" AND \\\"190\\\") OR (\\\"Platts FO\\\" AND \\\"BUYS\\\" AND \\\"190\\\") OR (\\\"Platts Marine\\\" AND \\\"SELLS\\\" AND \\\"190\\\") OR (\\\"Platts Marine\\\" AND \\\"BUYS\\\" AND \\\"190\\\")"
fo_headlines = ek.get_news_headlines(fo_all_str, count=100, date_from='2021-05-14T01:00:00', date_to='2021-06-08T23:59:00')
Full Error Message:
EikonError: Error code 500 | Backend error. Failed to deserialize backend response. Expected valid JSON. Error: invalid character 'i' looking for beginning of value
Best Answer
-
It looks like the latest version of Eikon Data APIs library v1.1.10 has the same problem as the eikon module in RDP Library. Can you downgrade the version of Eikon Data APIs library to v1.1.6.post3 by running
pip install eikon==1.1.6.post3
0
Answers
-
Hi @owilliams,
There may have been a temporary issue with the server. Can you try again?
This is what happened when I tried just now:
0 -
Tried again, using Python3 version 3.7 and 3.8 and get the same result. It has been doing this to me for months now. May I ask what python version you are using? Not sure how to resolve this now that I see that it is working for you.
0 -
Please find below the full error traceback, if it helps:
2021-06-09 21:06:33,123 P[33412] [MainThread 23108] Backend error. Failed to deserialize backend response. Expected valid JSON. Error: invalid character 'i' looking for beginning of value
2021-06-09 21:06:33,124 P[33412] [MainThread 23108] HTTP request failed: EikonError-Backend error. Failed to deserialize backend response. Expected valid JSON. Error: invalid character 'i' looking for beginning of value
Traceback (most recent call last):
File "C:\Users\ODW_W\anaconda3\envs\eikon_test\lib\site-packages\eikon\json_requests.py", line 124, in send_json_request
_check_server_error(result)
File "C:\Users\ODW_W\anaconda3\envs\eikon_test\lib\site-packages\eikon\json_requests.py", line 216, in _check_server_error
raise EikonError(int(server_response['ErrorCode']), error_message)
eikon.eikonError.EikonError: Error code 500 | Backend error. Failed to deserialize backend response. Expected valid JSON. Error: invalid character 'i' looking for beginning of value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\JetBrains\PyCharm Community Edition with Anaconda plugin 2019.1.2\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition with Anaconda plugin 2019.1.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/ODW_W/Documents/GitHub/motools/odw_tools/reports/sing_report.py", line 37, in <module>
fo_headlines = ek.get_news_headlines(fo_all_str, count=100, date_from='2021-05-14T01:00:00', date_to='2021-06-08T23:59:00')
File "C:\Users\ODW_W\anaconda3\envs\eikon_test\lib\site-packages\eikon\news_request.py", line 124, in get_news_headlines
result = eikon.json_requests.send_json_request(News_Headlines_UDF_endpoint, payload, debug=debug)
File "C:\Users\ODW_W\anaconda3\envs\eikon_test\lib\site-packages\eikon\json_requests.py", line 134, in send_json_request
raise EikonError(eikon_err.code, eikon_err.message)
eikon.eikonError.EikonError: Error code 500 | Backend error. Failed to deserialize backend response. Expected valid JSON. Error: invalid character 'i' looking for beginning of value
0 -
Are you using Eikon Data APIs library or eikon module from RDP Library? In other words do you use
import eikon as ek
or
import refinitiv.dataplatform.eikon as ek
As far as I can see the problem you experienced is specific to eikon module in RDP Library. I don't reproduce it with Eikon Data APIs library. For this reason I suggest you use Eikon Data APIs library to retrieve news headlines from Eikon while we're working on addressing the problem in RDP Library.
0 -
I've been using: import eikon as ek
I used pip to install eikon. I've tried a fresh installation and still get the same error.
I'm not familiar with the RDP library, or how to install that module.
0 -
Hi @owilliams,
Have you tried running your example in CodeBook? Just want to confirm you can get a valid answer back there so we can try to work backwards. You also mentioned this has been doing this for months now. Has it ever worked?
0 -
Thank you, that version seems to work fine for me.
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 629 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 84 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛