Failure on OMM stream: Malformed JSON received during token refresh: '{"error":"server_error" ,"...

...error_description":"Request "xxxxxx-yyyyy-zzzz-tttt-sssssssss" has failed on backend call timeout" } '. Status code: 500
Hi Community members.
I really appreciate your support, sorry if this question is to direct, I wish to clarify I don't actually know if it is a bug on Refinitiv Server Backend side, just searching for solution.
Seems like there is an error on Refinitiv server related to the session refresh token process of OMM websocket stream:
I get an error message:
Malformed JSON received during token refresh: '{"error":"server_error" ,"error_description":"Request "xxxxxx-yyyyy-zzzz-tttt-sssssssss" has failed on backend call timeout" } '. Status code: 500
from first look the error might be a good explanation for the bug on the server
:"Request "xxxxxx-yyyyy-zzzz-tttt-sssssssss" has failed on backend call timeout"
the request uuid must be with ' \" ' literal double quotes or without them. - definitly not with plain text ' " ' .
by default, json parser may not parse a value with interleaving double Quates marks.
can you confirm?
If not - please inform me how to fix
Thanks
Ori Kovacsi Katz
EDITED:
using version:
./lib/python3.9/site-packages/refinitiv_data-1.0.0b20.dist-info
used search :
grep -rnw `pwd` -e "Malformed JSON received during token refresh"
on:
~/miniconda3/envs/<environment name>/lib/python3.9/site-packages/refinitiv/data/_core/session/refresh_token_updater.py line 63
I can see location of the failure the "def _on_update(self):" function
try:
json_content = response.json()
except json.decoder.JSONDecodeError:
message = (
f"Malformed JSON received during token refresh: '{response.text}'. "
f"Status code: {response.status_code}")
self.error(message)
self._callback(UpdateEvent.REFRESH_TOKEN_FAILED, message, {})
return
hope this will help to reproduce / resolve the issue
Answers
-
I can confirm this was the cause for Refinitiv OMM web-socket disconnection with
undocumented flow to an error call-back.
as a temporary workaround I tweaked the Refinitiv-Data 1.0.0b20 python package (python client connector) added broth force json parsing
workarround
try:
json_content=None
if response and response.text and "\"error\":\"server_error\"" in response.text:
print("[REFINITIV HACK ORI] fixing Malformed JSON", end=" ")
json_content=json.loads((''.join(response.text.split('\"'))).replace(":","\":\"").replace(" ,","\" ,\"").replace("{","{\"").replace("}","\"}"))
print(json_content)
else:
json_content = response.json()
except json.decoder.JSONDecodeError:
message = (
f"Malformed JSON received during token refresh: '{response.text}'. "
f"Status code: {response.status_code}")
self.error(message)
self._callback(UpdateEvent.REFRESH_TOKEN_FAILED, message, {})
returnI am not sure it will stand other error messages scenarios, but for now it solved my case, I suspect a bug on Refinitiv server side with multiple literal ' " ' double quate marks on same Json field without escape notation ' \" '
0 -
The latest RD Library version 1.0 is just released this week. The application should upgrade to this version.
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
- 683 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
- 626 Refinitiv Data Platform Libraries
- 5 LSEG Due Diligence
- 1 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 中文论坛