EikonError: Error code 500 | Backend error. Failed to deserialize backend response. Expected valid J
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
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛