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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
16 1 1 3

Impossible to use streaming prices

Hi everyone,


I tried executing the code from your GitHub.

It returned me an error, that I can't solve and neither the Eikon HelpDesk :

"2022-03-30 14:42:52,669 P[61668] [WebSocket 0 177212] Receive status message for unknown subscription id 4"

The id is changing based on the RICs I put in but nothing seems to work.

I then wanted to do things properly and tried following your tutorial here.

I checked the prerequisites and did them : everything went fine !

Then my error came back again for the streaming_prices part.

My eikon Data API is in 1.1.14, so I should be good on this side.

I checked all the prerequisites of the libraries : appdirs, certifi, chardet, datetime, deprecation, h2, httpx, idna, nest-asyncio, numpy, pandas, python-dateutil, requests, rfc3986, websocket-client, and nothing seemed off.

And most importantely, everything is working fine on your CODEBOOK environment.

Is there anything that I'm missing ?


Best regards,


Theo


eikoneikon-data-apicodebookstreaming-prices
icon clock
10 |1500

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

Upvotes
696 2 1 2

Hi @theo.px ,

Without more detail, and especially without log file, it isn' t obvious to find a cause.

You should search for log related to subscription id 4 (initial open request, status, error and/or refresh response, ...)

If you installed and updated eikon lib with different version, you can reinstall with "pip install --upgrade --force-reinstall eikon" to be sure that you have all dependencies with the right version.


icon clock
10 |1500

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

Upvotes
16 1 1 3

I don't know where to find the logs, here is my code :

import eikon as ek
import datetime

ek.set_app_key('XXX')
streaming_prices = ek.StreamingPrices(

    instruments = ['GBP=','JPY=', 'CAD='],

    fields   = ['CF_BID','CF_ASK','OPEN_PRC', 'CF_HIGH','CF_LOW', 'CF_CLOSE']

)

streaming_prices.open()

df = streaming_prices.get_snapshot(
        instruments = ['JPY=', 'CAD='],
        fields = ['CF_BID','CF_ASK']
)
print(df)


What more do you need ?


The code is sending me the ID4 message at line 15.

PS : I can't seem to be able to upload any image I've got a "Parsing response failed" error

icon clock
10 |1500

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

Upvote
696 2 1 2

You can activate debug traces with this way:

ek.set_app_key('XXX')
ek.set_log_level(1)
...

Then, you'll have a pyeikon.yyyymmdd.hh-mm-ss.log file in same directory than your script. You should also have traces in your console window.

One possibility that could cause your issue: for some rics, subscription can switch to delayed (ex: subscription to "EUR=" => switched to "/EUR=" ).

Currently, Python API doesn't support this.

icon clock
10 |1500

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

Upvotes
16 1 1 3

I can't upload files either.

Here is the logs :

[2022-03-30 17:21:34,109;s] - [Level 1] - [log] - StreamingPrices : open streaming on ['GBP=', 'JPY=', 'CAD=']
[2022-03-30 17:21:34,110;s] - [DEBUG] - [log] - Open asynchronously StreamingSinglePrice 2 to JPY=
[2022-03-30 17:21:34,110;s] - [DEBUG] - [log] - Open asynchronously ItemStream 2 to JPY=
[2022-03-30 17:21:34,110;s] - [Level 1] - [log] - Create StreamConnection...
[2022-03-30 17:21:34,110;s] - [Level 1] - [log] - Register streaming session 1
[2022-03-30 17:21:34,112;s] - [Level 1] - [log] - Streaming session 1 waits for start event
[2022-03-30 17:21:34,112;s] - [DEBUG] - [log] - Streaming is started
[2022-03-30 17:21:34,329;s] - [Level 1] - [log] - WAIT FOR LOGIN EVENT
[2022-03-30 17:21:34,329;s] - [Level 1] - [log] - Streaming session 1 received start event, then open websocket.
[2022-03-30 17:21:34,332;s] - [Level 1] - [log] - WebSocket for streaming session 1 was opened to server: ws://127.0.0.1:9060/api/v1/data/streaming/pricing/WebSocket
[2022-03-30 17:21:34,332;s] - [Level 1] - [log] - Send request: {'ID': 4, 'Domain': 'Login', 'Key': {'Name': 'john doe', 'Elements': {'AppKey': 'XXX', 'ApplicationId': '256', 'Position': 'XXX'}}}
[2022-03-30 17:21:34,388;s] - [DEBUG] - [log] - Receive message from Web Socket
[2022-03-30 17:21:34,388;s] - [TRACE] - [log] - Receive message for login 4: {'ID': 4, 'State': {'Code': 'ConnectionError', 'Data': 'Suspect', 'Stream': 'Closed', 'Text': 'Cannot establish connection to the platform'}, 'Type': 'Status'}
[2022-03-30 17:21:34,388;s] - [INFO] - [log] - Received status message:
   {'Code': 'ConnectionError', 'Data': 'Suspect', 'Stream': 'Closed', 'Text': 'Cannot establish connection to the platform'}
[2022-03-30 17:21:34,388;s] - [WARNING] - [log] - Receive status message for unknown subscription id 4
icon clock
10 |1500

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

Upvote
696 2 1 2

This log explains the reason why the web socket can't be opened:

Receive message for login 4: {'ID': 4, 'State': {'Code': 'ConnectionError', 'Data': 'Suspect', 'Stream': 'Closed', 'Text': 'Cannot establish connection to the platform'}, 'Type': 'Status'}

This status message is returned by the Eikon Desktop Proxy.

If you activate debug logs in Eikon Configuration Manager then explore Log folder (it should be C:\ProgramData\Thomson Reuters\Eikon Data\Logs but to be sure, open it from Eikon Configuration Manager application) and check APIProxy.yymmdd.hhmmssmmm.p<pid>.txt file in \TRD\Eikon.yyyymmdd.hhmmss.pXXXXX subfolder.

You should fin message related to /api/rdp/streaming/pricing/v1/WebSocket.
On my side (without error):

[2022-03-23 15:36:56.445|1|data-api|1|INFO] [WebSocketServer]Creating new WebSocket server instance
[2022-03-23 15:36:56.448|1|data-api|3|DEBUG] [WebSocketServer]WebSocket path is /api/rdp/streaming/pricing/v1/WebSocket. Max simultaneous connections: 10
[2022-03-23 15:36:56.451|1|data-api|1|INFO] [ApiV1WebSocketServerProvider]Creating new WebSocket server instance
[2022-03-23 15:36:56.454|1|data-api|3|DEBUG] [ApiV1WebSocketServerProvider]WebSocket path is /api/v1/data/streaming/pricing/WebSocket. Max simultaneous connections: 10


icon clock
10 |1500

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

Upvotes
16 1 1 3

Hello,

So I launched the Eikon Configuration Manager application (in edition mode),I activated the logs by ticking the "Configure Logs on the Workstation" box. I then clicked on "Open logs folder" and in \TRD\Eikon.yyyymmdd.hhmmss.pXXXXX subfolders I don't have any log files that looks like APIProxy.yymmdd.hhmmssmmm.p<pid>.txt . So I opened the Logs viewer in the Eikon Configuration Manager application and the only log appearing (every 20s) is

10:09:25 Condition 'Configuration:RDE_SSO_CONNECTION_STATUS' == 'ONLINE' is false 
10:09:25 Device 'PROFILE-UPLOAD' does not upload its data because condition is false 

I don't know if it has to do with the API !


Thank you in advance for your help

icon clock
10 |1500

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

Upvotes
696 2 1 2

I didn't catch you're using Refinitiv Workspace !
The log file you should check is node-sxs.yyyymmdd.pXXXX.log, but it'll be less easy because it contains traces from SXS and APIPROXY.

Search messages related to APIPROXY and WebSocketServer.
These messages are related to local web sockets available for python clients:

...
2022-03-31T06:18:48.633Z|info|[console](app) create APIPROXY
...
2022-03-31T06:18:48.699Z|info|[console](api) [WebSocketServer]Creating new WebSocket server instance
2022-03-31T06:18:48.699Z|info|[console](api) [WebSocketServer]WebSocket path is /api/rdp/streaming/pricing/v1/WebSocket. Max simultaneous connections: 10
2022-03-31T06:18:48.699Z|info|[console](api) [ApiV1WebSocketServerProvider]Creating new WebSocket server instance
2022-03-31T06:18:48.699Z|info|[console](api) [ApiV1WebSocketServerProvider]WebSocket path is /api/v1/data/streaming/pricing/WebSocket. Max simultaneous connections: 10
2022-03-31T06:18:48.699Z|info|[console](api) [WebSocketProxyServersProviderImpl]Creating new WebSocket server instance
2022-03-31T06:18:48.699Z|info|[console](api) [WebSocketProxyServersProviderImpl]WebSocket path is /api/rdp/streaming/trading-analytics/trade-data/beta1/redi/WebSocket. Max simultaneous connections: 10
...

If there is error with the web socket between this APIPROXY and the platform, it should be logged.

icon clock
10 |1500

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