please help with the following error: [OMMSTREAMING_CHAINS_0.0] on_ws_error.
Hello,
I am getting the following socket error:
"[OMMSTREAMING_CHAINS_0.0] on_ws_error: Exception: Connection is already closed."
Please note that calling WFC.constituents works but fails on rd.getdata().
Any idea what might be the cause?
Thanks
Moti
session = rd.session.platform.Definition(
app_key = APP_KEY,
grant = rd.session.platform.GrantPassword(
username = RDP_LOGIN,
password = RDP_PASSWORD
)
).get_session()
session.open()
rd.session.set_default(session)
WFC = Chain(name="0#WFCUSDABMK=")
rd.get_data(WFC, ['RT_YIELD_1','GV4_TEXT','MATUR_DATE'])
Best Answer
-
Hi @Moti.Konak
Can you please try this example (which is based off your failing-code.txt you attached). Because you are running from a Python environment, not within a Jupyter notebook, I structured a little differently and also ensured you closed the session to exit properly.
import refinitiv.data as rd
from refinitiv.data.discovery import Chain
import datetime
from IPython.display import display, clear_output
IPA_ENVIRONMENT = "NON-DESKTOP"
APP_KEY = "<your appkey>"
RDP_PASSWORD = "<your password>"
RDP_LOGIN = "<your login ID>"
if __name__ == "__main__":
#rd.get_config().set_param(
# param=f"logs.transports.console.enabled", value=True
#)
session = rd.session.platform.Definition(
app_key = APP_KEY,
grant = rd.session.platform.GrantPassword(
username = RDP_LOGIN,
password = RDP_PASSWORD
),
signon_control = True
).get_session()
session.open()
rd.session.set_default(session)
#session.set_log_level("DEBUG")
try:
WFC = Chain(name="0#WFCUSDABMK=")
response = rd.get_data(WFC, ['RT_YIELD_1','GV4_TEXT','MATUR_DATE'])
print(response)
except Exception as e:
print(f'Exception thrown: {e}')
rd.close_session()
print("Ready to exit...")
exit()After applying your credentials, your output should look something like this:
0
Answers
-
Hi @Moti.Konak ,
This might be a permissioning issue. Can you please run the following code in one cell and share the logs here?
rd.get_config().set_param(
param=f"logs.transports.console.enabled", value=True
)
session = rd.session.platform.Definition(
app_key = APP_KEY,
grant = rd.session.platform.GrantPassword(
username = RDP_LOGIN,
password = RDP_PASSWORD
)
).get_session()
session.open()
rd.session.set_default(session)
session.set_log_level("DEBUG")
WFC = Chain(name="0#WFCUSDABMK=")
rd.get_data(WFC, ['RT_YIELD_1','GV4_TEXT','MATUR_DATE'])Best regards,
Haykaz
0 -
Thanks Haykaz,
Please see LOG attached. Also, please note that the same code I shown was used via Codebook using the same credentials and Codebook delivered perfectly.
0 -
Hi @Moti.Konak ,
Thanks for sharing the logs. Do you still receive the error as I see the data is actually returned in your logs?
Best regards,
Haykaz
0 -
Sorry but now I am getting with no output:
RDError: Error code -1 | EOF occurred in violation of protocol (_ssl.c:2423)
One more note: on Codebook, the process takes less than 10 seconds but on Python the system spins close to a minute before I see the error.
0 -
Hi @Moti.Konak
What error message did you receive for the run you did where you provided the log file? The log file did not show any error or warning messages.
Also, I want to confirm your specific tests. When you test in CodeBook, are you also using a platform session where you define a Password Grant?
Assuming you are, the only thing that may be different is the version of the RD Library. The version in CodeBook as of this post is 1.4.0. Which version are you using in your own environment?
Just to make sure I didn't run into any issues, I just ran a test outside of CodeBook and this is what I saw: (Note: I'm using version 1.5.0 of the rd library)0 -
Thanks for following up Nick!
"What error message did you receive for the run you did where you provided the log file? "
I didn't get an error at that time. The added code by Haykaz("rd.get_config().set_param" and "session.set_log_level("DEBUG")" - shown below) improved the return and I get the expected data but with the added code I also get all the log and debugging which is clogging my process and not needed. Without the added code, the environment runs for minutes before I have to shut it down.
rd.get_config().set_param(
param=f"logs.transports.console.enabled", value=True
)
and
session.set_log_level("DEBUG")
"Which version are you using" :
The version I have is <1.5.0>
Can you please let me know what is wrong with my set up?
Thanks
Moti
0 -
Hi @Moti.Konak
Thanks for confirming that is worked at some point. We just need to understand what you are doing that is causing the issues. I honestly don't know how turning logs on would cause it to succeed but we need to understand what you mean by:
"the added code I also get all the log and debugging which is clogging my process"If the entire code segment Haykaz provided works, please include the "added code" where it fails so we can replicate.
0 -
Thanks Nick. I attached my codes (Code when fails and when successful) with masking the password and part of the key.
I also just run the failed code again and the error is below:
---------------------------------------------------------------------------RDError Traceback (most recent call last)c:\Users\U8015138\QPS_IPA\Access__Chains.ipynb Cell 9 line 3 33 #session.set_log_level("DEBUG") 35 WFC = Chain(name="0#WFCUSDABMK=")---> 37 rd.get_data(WFC, ['RT_YIELD_1','GV4_TEXT','MATUR_DATE'])File c:\Users\U8015138\AppData\Local\anaconda3\Lib\site-packages\refinitiv\data\_access_layer\get_data_func.py:126, in get_data(universe, fields, parameters, use_field_names_in_headers) 124 if exceptions and all(exceptions): 125 except_msg = "\n\n".join(exceptions)--> 126 raise RDError(-1, except_msg) 128 hp_and_cust_inst_data = HPAndCustInstDataContainer(stream_columns, stream_data, stream_df) 129 adc_data = ADCDataContainer(adc_raw, adc_df, fields)RDError: Error code -1 | EOF occurred in violation of protocol (_ssl.c:2423)
0 -
Thanks for helping Nick. This is what I got:
Exception thrown: Error code -1 | EOF occurred in violation of protocol (_ssl.c:2423)
[OMMSTREAMING_CHAINS_0.0] on_ws_error: Exception: Connection is already closed.
Ready to exit...
0 -
Hi @Moti.Konak
What OS are you running on? Linux? MacOS?
The error appears to be related to something with the version of the SSL on your machine and I don’t normally see the need to update OpenSSL on Windows. Are you able to update your OpenSSL version? Another possible issue could be the version of Python libraries on your machine. You may need to upgrade the Python libs.
0 -
Hello Nick,
your inclination was correct. I found this:
My python version ( 3.11.3) was causing the issue ...I guess this is a bug.....
I upgraded to 3.11.2 and the issue was fixed.
Thanks
Moti
0
Categories
- All Categories
- 6 AHS
- 37 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
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛