[WinError 10061] No connection could be made because the target machine actively refused it
I had this weird issue from the new Python API for workspaces.
Error using get_history_func>get_history (line 206)
Python Error: RDError: Error code -1 | [WinError 10061] No connection could be made because the target machine actively refused it
It doesn't happen all the time but frequently and last for 2-3 days (maybe longer some times)
Any insight about what causes this problem and how to avoid it ?
Best Answer
-
Hi @xuewei.zhu ,
There might be several reasons for the error, so the logs and screenshot of the error would really help. However, in your code it seems you are trying to connect via platform session and you define it well. However, rd.open_session() may connect to desktop session. Since you are in desktop session, you may get the issue because of Workspace not running on the background or exceeding API limits enforced by the Workspace API proxy. Consider using the following code when you try connect via platform session:
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)Hope this helps.
Best regards,
Haykaz
0
Answers
-
Hi @xuewei.zhu ,
Could you please share the code you are using and the screenshot of the error so we investigate it further? Also, please find the troubleshooting guide which might be helpful to debug the issue -
Eikon Data API(Python) Troubleshooting | Refinitiv | Devportal (lseg.com)
Best regards,
Haykaz
0 -
I used very simple code of line to download the data
session = rd.session.platform.Definition(
app_key = APP_KEY,
grant = rd.session.platform.GrantPassword(
username = RDP_LOGIN,
password = RDP_PASSWORD
)
).get_session()
rd.open_session()
data = rd.get_history(universe = tickers, fields = fieldnames, interval = time_interval, start = startDate, end = endDate)
It only gives this error sometimes, most of the time it's working fine.
I am not able to replicate the problem at the moment but I can certainly try to use the debug mode to save the log which may give more information.
0 -
Thanks for the explanation. I will definitely try to get the log file next time when I have this error.
Do you know what the API limits are?
0 -
sure, you can find it here - Documentation | Devportal (lseg.com). Although you may see Eikon there, those are applicable to RD via desktop session as well since those limits are enforced by the same Desktop proxy both libraries are using.
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 中文论坛