For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

Python API issues beyond troubleshooting doc (error code -1)

Hi I have been following the troubleshooting docs for the Eikon API, but it is not clear to me what I should do to rectify issues when they don’t match.


I am on desktop version 4.0.52 using eikon api version 1.1.7.


When I run Eikon API I am getting the following error message:


ERROR - [pyeikon|log|376] - 10/19/2020 11:31:30 AM - Error: no proxy address identified.

Check if Eikon Desktop or Eikon API Proxy is running.

ERROR - [pyeikon|log|376] - 10/19/2020 11:31:30 AM - Port number was not identified, cannot send any request

ERROR - [pyeikon|check_profile|353] - 10/19/2020 11:31:30 AM - Port number was not identified.

Check if Eikon Desktop or Eikon API Proxy is running.

---------------------------------------------------------------------------

EikonError Traceback (most recent call last)

<ipython-input-17-fe8dd09feae5> in <module>

1 import eikon as ek

2

----> 3 ek.set_app_key('xxxxxx')

4


/usr/local/Miniconda3-py37_4.8.2-Linux-x86_64/envs/jupyter-apf/lib/python3.6/site-packages/eikon/Profile.py in set_app_key(app_key)

31 You can get an app key using the App Key Generator (this App is available in Eikon Desktop).

32 """

---> 33get_profile().set_app_key(app_key)

34

35


/usr/local/Miniconda3-py37_4.8.2-Linux-x86_64/envs/jupyter-apf/lib/python3.6/site-packages/eikon/Profile.py in set_app_key(self, app_key)

229 self.logger = self._desktop_session.logger()

230 self.logger.debug('Init a Desktop session with new app_key')

--> 231self.check_profile()

232

233def set_on_state_callback(self, on_state):


/usr/local/Miniconda3-py37_4.8.2-Linux-x86_64/envs/jupyter-apf/lib/python3.6/site-packages/eikon/Profile.py in check_profile(self)

352# port number wasn't identified => raise EikonError exception

353 self.logger.error('Port number was not identified.\nCheck if Eikon Desktop or Eikon API Proxy is running.')

--> 354raise EikonError(-1, 'Port number was not identified. Check if Eikon Desktop or Eikon API Proxy is running.')


EikonError: Error code -1 | Port number was not identified. Check if Eikon Desktop or Eikon API Proxy is running.


The configuration is fine, and the listening to port file is set to 9000.


Issues vs troubleshooting doc:


  1. When I browse into sub-folder TRD, the most recent folder only has file EikonDM.20201019.123400816.p27824.txt
  2. The second most recent folder has a "SxS.<datetime>.p<process-id>.txt" file. But this ends:


[2020-10-19 07:32:13.879|1|api-svc|1|INFO] Start server...

[2020-10-19 07:32:13.952|1|api-svc|2|DEBUG] onStarted: 9000

[2020-10-19 07:32:13.954|1|api-svc|1|INFO] Listening to port=9000

[2020-10-19 07:32:13.958|1|data-api|1|INFO] API Proxy is available on port 9060. Start redirecting /api/* requests

[2020-10-19 07:32:18.061|1|api-svc|0|WARN] Error: messenger not found.

[2020-10-19 07:32:18.068|1|sxs-api|3|DEBUG] [ws] Create endpoint=/sxs/v1/services/messenger


  1. When I run http://localhost:9000/ping?all I get:


{"port":9000,"mode":"eikon4","pid":4692,"hasSecure":true,"startedTime":"Mon Oct 19 2020 08:32:13 GMT+0100 (GMT Daylight Time)","subApps":[{"path":"/heap"},{"path":"/ping"},{"path":"/sxs","data":{"hasSecure":true,"sxsApps":{}}},{"path":"/api"},{"path":"/sxs/v1/services/messenger"}]}
eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
39.2k 75 11 27

@kevin.ferriter

It appears that you're using Jupyter lab running on remote Linux server. Eikon Data APIs at the moment can only be used in Python running on the same machine where Eikon application is running or in Codebook, which is a Refinitiv hosted Jupyter lab. Eikon APIs at the moment cannot be used in Jupyter lab running on remote servers hosted by your company. To utilize Eikon data in Jupyter notebooks consider using Codebook or running Jupyter notebook server on the Windows machine where Eikon application is installed.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thanks for looking into that. Do you know if there are any plans to enable running Eikon Data APIs on remote Linux servers? My entire firm conducts research in remote Linux servers, so it really negates the value of paying for a Data API for us.

We're well aware of the requirement and plan to expand Codebook concept to allow it to run on client premises, which is basically the same as the capability to install additional software in your Jupyter lab that would allow users to use Eikon Data APIs. However this is not on the roadmap for 2021, I'm afraid.

Upvotes
4.3k 2 4 5

Hi,

To check if Eikon API Proxy is running, you can open http://localhost:9000/api/status
(it will be redirect to http://localhost:9060/api/status), and check the result.

To get more detail on the reason for why Eikon Data API failed to connect:

  1. activate eikon log before ek.set_ap_key(...) with ek.set_log_level(1)
  2. Beside "SxS.<datetime>.p<process-id>.txt" , you should find "APIProxy.<datetime>.p<process-id>.txt".

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 1

When I open http://localhost:9000/api/status I get redirected as you say and then the below:


{"statusCode":"ST_PROXY_READY","version":"2.6.3"}



When I follow (1) above I get:


DEBUG - [pyeikon|set_app_key|219] - 10/19/2020 12:44:23 PM - Reset a Desktop session with new app_key
INFO - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Warning: file .portInUse was not found. Try to fallback to default port number.
INFO - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Try defaulting to port 9000...
INFO - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Send GET request to http://127.0.0.1:9000/api/status to detect API Proxy...
DEBUG - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Request to http://127.0.0.1:9000/api/status
                    headers = {'x-tr-applicationid': '09453e26436745f388e07df6b84b5b20a61c9adf'}
                    params = None
Level 1 - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - HTTP request failed: ConnectError("[Errno 111] Connect call failed ('127.0.0.1', 9000)",)
DEBUG - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Error on checking port 9000 : ConnectError("[Errno 111] Connect call failed ('127.0.0.1', 9000)",)
INFO - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Try defaulting to port 36036...
INFO - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Send GET request to http://127.0.0.1:36036/api/status to detect API Proxy...
DEBUG - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Request to http://127.0.0.1:36036/api/status
                    headers = {'x-tr-applicationid': '09453e26436745f388e07df6b84b5b20a61c9adf'}
                    params = None
Level 1 - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - HTTP request failed: ConnectError("[Errno 111] Connect call failed ('127.0.0.1', 36036)",)
DEBUG - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Error on checking port 36036 : ConnectError("[Errno 111] Connect call failed ('127.0.0.1', 36036)",)
ERROR - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Error: no proxy address identified.
Check if Eikon Desktop or Eikon API Proxy is running.
ERROR - [pyeikon|log|376] - 10/19/2020 12:44:23 PM - Port number was not identified, cannot send any request
DEBUG - [pyeikon|set_app_key|230] - 10/19/2020 12:44:23 PM - Init a Desktop session with new app_key
ERROR - [pyeikon|check_profile|353] - 10/19/2020 12:44:23 PM - Port number was not identified.
Check if Eikon Desktop or Eikon API Proxy is running.
---------------------------------------------------------------------------
EikonError                                Traceback (most recent call last)
<ipython-input-20-d00432490d69> in <module>
      1 #import eikon as ek
      2 
----> 3 ek.set_app_key('09453e26436745f388e07df6b84b5b20a61c9adf')
      4 
 
               
/usr/local/Miniconda3-py37_4.8.2-Linux-x86_64/envs/jupyter-apf/lib/python3.6/site-packages/eikon/Profile.py in set_app_key(app_key)
     31     You can get an app key using the App Key Generator (this App is available in Eikon Desktop).
     32     """
---> 33get_profile().set_app_key(app_key)
     34 
     35 
 
               
/usr/local/Miniconda3-py37_4.8.2-Linux-x86_64/envs/jupyter-apf/lib/python3.6/site-packages/eikon/Profile.py in set_app_key(self, app_key)
    229             self.logger = self._desktop_session.logger()
    230             self.logger.debug('Init a Desktop session with new app_key')
--> 231self.check_profile()
    232 
    233def set_on_state_callback(self, on_state):
 
               
/usr/local/Miniconda3-py37_4.8.2-Linux-x86_64/envs/jupyter-apf/lib/python3.6/site-packages/eikon/Profile.py in check_profile(self)
    352# port number wasn't identified => raise EikonError exception
    353             self.logger.error('Port number was not identified.\nCheck if Eikon Desktop or Eikon API Proxy is running.')
--> 354raise EikonError(-1, 'Port number was not identified. Check if Eikon Desktop or Eikon API Proxy is running.')
 
               
EikonError: Error code -1 | Port number was not identified. Check if Eikon Desktop or Eikon API Proxy is running.


When I follow (2) above I get:


Eikon: -eikonpid=19640 -EikonProcessId=10616 -HwndComInterop=0x1 "-manifest=C:\Users\kferrite\AppData\Local\Thomson Reuters\Eikon User\Cache\LibraryCache\9.0.52055_GEDTC-212140__EikonContainer.dll.manifest" "-Context=C:\Users\kferrite\AppData\Local\Thomson Reuters\Eikon User\Cache\LibraryCache\Apps\REFINITIVHOLDINGS.EIKON.DATAAPIPROXY\1.1.0.11" /prefetch:1


start node


Arg: C:\Users\kferrite\AppData\Local\Thomson Reuters\Eikon\Y\Bin\Eikonbox.exe C:\Users\kferrite\AppData\Local\Thomson Reuters\Eikon User\Cache\LibraryCache\Apps\REFINITIVHOLDINGS.EIKON.DATAAPIPROXY\1.1.0.11\index.js -TraceLevel=2


[2020-10-19 07:31:58.522|1|api-svc|1|INFO] PA: false

[2020-10-19 07:31:58.526|1|api-svc|2|DEBUG] Waiting for FT

[2020-10-19 07:32:03.524|1|api-svc|1|INFO] FT is ready

[2020-10-19 07:32:03.526|1|api-svc|3|DEBUG] set User Agent

[2020-10-19 07:32:03.533|1|api-svc|1|INFO] Initial port: 9060

[2020-10-19 07:32:03.534|1|api-svc|1|INFO] Port range: 20

[2020-10-19 07:32:03.584|1|api-svc|1|INFO] Listening to port=9060

[2020-10-19 07:32:03.623|1|data-api|1|INFO] [ConfigurationManager]Getting configuration ...

[2020-10-19 07:32:03.930|1|data-api|1|INFO] [ConfigurationManager]Configuration successfully retrieved.

[2020-10-19 07:32:03.931|1|data-api|3|DEBUG] [ConfigurationManager]{"backwardCompatibilityBetaEnabled":true,"currentVersion":"2.6.3","currentWebApiVersion":"1.1.0","dataCenter":"","endPointURL":"https://emea1.apps.cp.extranet.thomsonreuters.biz/Apps/UDF/MSF","handshake":{"enabled":true,"isMandatory":false},"minimalVersion":"0.0.0","minimalVersionRequirementMet":true,"proxyEnabled":true,"rdpAccessEnabled":true,"statusEnabled":true,"streaming":{"enabled":true,"maxConnection":10},"throttling":{"dailyRequestCount":{"enabled":true,"max":10000},"dailyVolume":{"enabled":true,"max":5000000},"queueSize":100,"queueTimeout":120,"requestCount":{"enabled":true,"max":5,"period":1},"volume":{"enabled":true,"max":50000,"period":60}},"udfAccessEnabled":true,"usageTrackingEnabled":true}

[2020-10-19 07:32:03.955|1|data-api|3|DEBUG] [getWsClientOptions]HTTP_PROXY and HTTPS_PROXY environment variables are no set, skipping proxy configuration.

[2020-10-19 07:32:03.986|1|data-api|3|DEBUG] [UdfController][UdfController::create] Creating UDF controller.

[2020-10-19 07:32:03.987|1|data-api|3|DEBUG] [StatusController][StatusController::create] Creating status controller.

[2020-10-19 07:32:03.988|1|data-api|3|DEBUG] [RdpStreamingDiscoveryController][RdpStreamingDiscoveryController::create] Creating RDP Streaming Discovery controller.

[2020-10-19 07:32:03.989|1|data-api|3|DEBUG] [RdpController][RdpController::create] Creating RDP controller.

[2020-10-19 07:32:03.993|1|data-api|3|DEBUG] [HomeController][HomeController::create] Creating index controller.

[2020-10-19 07:32:03.994|1|data-api|3|DEBUG] [HandshakeController][Handshake::create] Creating handshake controller.

[2020-10-19 07:32:03.994|1|data-api|3|DEBUG] [ApiV1StreamingDiscoveryController][ApiV1StreamingDiscoveryController::create] Creating ApiV1StreamingDiscoveryController controller.

[2020-10-19 07:32:03.995|1|data-api|3|DEBUG] [ApiController][ApiController::create] Creating API controller.

[2020-10-19 07:32:04.006|1|data-api|3|DEBUG] [TracingMiddleware]Creating new request tracing middleware.

[2020-10-19 07:32:04.012|1|data-api|3|DEBUG] [SettingsAggregatorService]Getting value for APIPROXY.THROTTLING.STORE from platform setting service

[2020-10-19 07:32:04.017|1|data-api|3|DEBUG] [TracingMiddleware]Creating new request tracing middleware.

[2020-10-19 07:32:04.021|1|data-api|3|DEBUG] [TracingMiddleware]Creating new request tracing middleware.

[2020-10-19 07:32:04.023|1|data-api|3|DEBUG] [TracingMiddleware]Creating new request tracing middleware.

[2020-10-19 07:32:04.030|1|data-api|3|DEBUG] [TracingMiddleware]Creating new request tracing middleware.

[2020-10-19 07:32:04.071|1|data-api|3|DEBUG] [ABFT][ABFT] Applying anti-bruteforce throttling

[2020-10-19 07:32:04.088|1|data-api|1|INFO] [Throttling][RBT] Request-count based throttling has been enabled by configuration.

[2020-10-19 07:32:04.089|1|data-api|3|DEBUG] [Throttling][RBT] Applying request-count limits - 5 request(s) per 1 second(s)

[2020-10-19 07:32:04.091|1|data-api|1|INFO] [Throttling][VBT] Volume-based throttling has been enabled by configuration.

[2020-10-19 07:32:04.093|1|data-api|3|DEBUG] [Throttling][VBT] Applying volume limits - 50000 KB per 60 second(s)

[2020-10-19 07:32:04.103|1|data-api|1|INFO] [WebSocketServer]Creating new WebSocket server instance

[2020-10-19 07:32:04.104|1|data-api|3|DEBUG] [WebSocketServer]WebSocket path is /api/rdp/streaming/pricing/v1/WebSocket. Max simultaneous connections: 10

[2020-10-19 07:32:04.106|1|data-api|1|INFO] [ApiV1WebSocketServerProvider]Creating new WebSocket server instance

[2020-10-19 07:32:04.107|1|data-api|3|DEBUG] [ApiV1WebSocketServerProvider]WebSocket path is /api/v1/data/streaming/pricing/WebSocket. Max simultaneous connections: 10

[2020-10-19 07:32:04.122|1|data-api|3|DEBUG] [SettingsAggregatorService]Got value '{"dailyRequest":"[]","dailyVolume":"[]"}', trying to parse ...

[2020-10-19 07:32:04.123|1|data-api|3|DEBUG] [SettingsAggregatorService]Parsing succeeded !

[2020-10-19 07:32:04.125|1|data-api|1|INFO] [Throttling][DRBT] Daily request-count based throttling has been enabled by configuration.

[2020-10-19 07:32:04.126|1|data-api|3|DEBUG] [Throttling][DRBT] Applying daily request-count limits - 10000 request(s) per day

[2020-10-19 07:32:04.129|1|data-api|1|INFO] [Throttling][DVBT] Daily volume-based throttling has been enabled by configuration.

[2020-10-19 07:32:04.131|1|data-api|3|DEBUG] [Throttling][DVBT] Applying daily volume-based limits - 5000000 KB per day

[2020-10-19 07:32:04.141|1|api-svc|1|INFO] Write port file

[2020-10-19 12:42:53.678|1|data-api|3|DEBUG] [TracingMiddleware]Creating new request tracing middleware.

[2020-10-19 12:42:53.680|1|data-api|3|DEBUG] [TracingMiddleware]Got new incoming request, request id is #b79aac69-bf2d-4178-9c38-d0297542716b.

[2020-10-19 12:42:53.681|1|data-api|1|INFO] [LogRequestDetailMiddleware][Request #b79aac69-bf2d-4178-9c38-d0297542716b] New incoming GET request

[2020-10-19 12:42:53.682|1|data-api|3|DEBUG] [LogRequestDetailMiddleware][Request #b79aac69-bf2d-4178-9c38-d0297542716b] URL: http://localhost:9060/api/status

[2020-10-19 12:42:53.682|1|data-api|3|DEBUG] [LogRequestDetailMiddleware][Request #b79aac69-bf2d-4178-9c38-d0297542716b] Headers: {"host":"localhost:9060","connection":"keep-alive","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","sec-fetch-site":"cross-site","sec-fetch-mode":"navigate","sec-fetch-user":"?1","sec-fetch-dest":"document","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9"}

[2020-10-19 12:42:53.683|1|data-api|3|DEBUG] [LogRequestDetailMiddleware][Request #b79aac69-bf2d-4178-9c38-d0297542716b] Body: {}

[2020-10-19 12:42:53.685|1|data-api|3|DEBUG] [RefinitivAppsCorsHandlerMiddleware]Generating dynamic CORS module options ...

[2020-10-19 12:42:53.688|1|data-api|3|DEBUG] [StatusController][StatusController::create] Creating status controller.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
4.3k 2 4 5

Python log shows :

Warning: file .portInUse was not found. Try to fallback to default port number. 

This file should be in C:\Users\<username>\AppData\Roaming\Refinitiv\Data API Proxy

Could you verify if this file exists ?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Yes it does - it is 9060.

Upvotes
1 0 0 1

yes it does - it is 9060. Any thoughts @pierre.faurel ? Thanks.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea