Error: no proxy address identified.
Have seen a couple of threads popping up with similar issues related to proxy, this is new to me:
2022-08-25 08:09:58,324 P[19480] [MainThread 10120] Error: no proxy address identified. Check if Eikon Desktop or Eikon API Proxy is running.
2022-08-25 08:09:58,355 P[19480] [MainThread 10120] Error on handshake url http://127.0.0.1:None/api/handshake : UnsupportedProtocol("Request URL is missing an 'http://' or 'https://' protocol.")
2022-08-25 08:09:58,358 P[19480] [MainThread 10120] Error on handshake url http://127.0.0.1:None/api/handshake : UnsupportedProtocol("Request URL is missing an 'http://' or 'https://' protocol.")
2022-08-25 08:09:58,370 P[19480] [MainThread 10120] Port number was not identified, cannot send any request
2022-08-25 08:09:58,389 P[19480] [MainThread 10120] Eikon Proxy not running or cannot be reached. Please read the documentation on troubleshooting
Have otherwise been using the same code for the past couple of weeks and it has been running without issues. Did Eikon change something?
Appreciate any help, thanks.
Best Answer
-
We checked and found that this issue relates to the proxy setting.
We need to check the connections by running the following code.
First, test with the requests library.
import requests
url = 'http://127.0.0.1:9060/api/status'
x = requests.get(url)
print(x.text)Then, test with the httpx library. The Eikon Data API depends on this library.
import httpx
timeout = 60
http_session = httpx.AsyncClient(
headers={"Accept": "application/json"},
timeout=timeout,
)
request_response = await http_session.request('GET','http://127.0.0.1:9060/api/status')
request_response.contentThe output is:
However, in the client's environment, the GET request didn't work. The client can solve the problem by setting a proxy server in the GET request.
import requests
url = 'http://127.0.0.1:9060/api/status'
proxies = {
'http': '',
'https': ''
}
x = requests.get(url, proxies=proxies)
print(x.text)Therefore, when using Eikon Data API, the client also needs to set a proxy server in the HTTP_PROXY operating system environment variable. For example:
import eikon as ek
import os
#ek.set_log_level(1)
os.environ['HTTP_PROXY']=http://127.0.0.1:8080
os.environ['HTTPS_PROXY']=http://127.0.0.1:8080
ek.set_app_key('<app key>')1
Answers
-
Really sorry for the issue you are facing, let me see if I can help you in resolving this.
First, you need to check that Eikon or Refinitiv Workspace is running properly. For Eikon, you can refer to the Eikon Data API(Python) Troubleshooting guide. For Refinitiv Workspace, please check the node-sxs.<date>.p<pid>.log in the Refinitiv Workspace Logs folder. Please refer to the answer to this question.
You can check the API proxy is running by using a web browser to access the following URLs.
http://127.0.0.1:<port>/ping?all
http://127.0.0.1:<port>/api/status
You can check a TCP port used by API proxy from the log file.
If Eikon or Refinitiv Workspace is running properly, please enable logging in Eikon Data API by using the following command.
ek.set_log_level(1)
You can share the log file when the problem occurred.
I hope this will help.
0 -
Hi, it looks like I'm unable to ping the API proxy:
But the status is fine:
0 -
You can try TCP 9000 or 9001 port.
http://127.0.0.1:9000/ping?all
http://127.0.0.1:9001/ping?all
The listening port is defined in the sxs log file.
0 -
Hi, it looks like 9000 can be pinged, and 9060 is ST_PROXY_READY, same as the troubleshooting guide: https://developers.refinitiv.com/en/article-catalog/article/eikon-data-api-python-troubleshooting-refinitiv
SxS file looks okay, but still getting proxy-related errors. Attaching full log.
Thank you for your time.
Looks like I'm unable to attach files here - can I have an email to send to?
Thanks.
0 -
Same here: can ping 9000 port, but not 9060.0
-
Thanks, @Jirapongse. Basically, the tests went well -- however the API still has an issue while trying to connect via proxy:
0 -
The are two kinds of proxy in this context. The first one is the API proxy run by Eikon or Workspace. The Eikon Data API connects to this API proxy to get data. Typically, the API proxy uses http://127.0.0.1:9060.
Another proxy is a proxy server run by your corporate or IT team.
The HTTP_PROXY and HTTPS_PROXY variables are for the corporate proxy server.
From your output, the Python code can connect to http://127.0.0.1:9060/api/status properly without proxy settings so there is no need to set the HTTP_PROXY and HTTPS_PROXY environment variables.
Please enable logging in Eikon Data API with the following code.
import eikon as ek
ek.set_log_level(1)
ek.set_app_key('<app key>')Then, please share the log.
0 -
the logs below: its trying to connect via different ports, but still failing
0 -
Please check the version of Eikon Data API and httpx used by the application.
import httpx
import eikon as ek
print(ek.__version__)
print(httpx.__version__)0 -
eikon: 1.1.10
httpx: 0.23.0
0 -
Please upgrade to eikon==1.1.15.
0 -
Updated to 1.1.15, still can't connect:
0 -
hi @ssavytskyi ,
Regarding the log in the screenshot, it looks like it can connect properly, could you please try the code below after the ek.set_app_key to see if the data can be retrieved properly?
df, err = ek.get_data(['GOOG.O','MSFT.O', 'FB.O'], ['TR.Revenue','TR.GrossProfit'])
df0 -
thanks, guys, API working at this point,
So, seems that issue was with Eikon version..
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
- 370 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 中文论坛