question

Upvotes
Accepted
17 3 4 2

Unable to connect to AWS server using EMA RTSDK -2.0.1.L2 - Internal SysError 10057 client connect() failed.

Hi,

I do have an almost 1 year old C++ application that is connecting to Refinitiv servers using a batch list and is working perfectly fine using EZD. Clients also use it in TREP infrastructure and all is fine.


Now, I want to update it to the latest rebranded API EMA RTSDK-2.0.1.L2 and connect to the AWS servers.Theoretically, after updating the code to link to the latest API, and changing the server/port in EmaConfig.xml, all should continue to work, but the reality is that is not working and I do not know what I do wrong.

I am on 1 month Real Time Optimized trial at the moment, I have the correct API token, and Machine password, and client id but, connection to the server is not happening.

The way I register now is (notice that serviceName is commented-out in the sample, but I have tried with and without it and when I did use it I used ELEKTRON_DIRECT or DIRECT_FEED, it does not make any difference)

OmmConsumer consumer(OmmConsumerConfig().consumerName(consumerName.c_str())

.clientId("<this is the api token>")

.username("<this is the machine id>")

.password("<this is the 30+ chars password>"));

consumer.registerClient(ReqMsg()/*.serviceName(serviceName.c_str())*/

.payload(ElementList().addArray(refinitiv::ema::rdm::ENAME_BATCH_ITEM_LIST, symbolArray).complete()), myClient);


The below errors I get:

Case 1:

EmaConfig.xml has for Channel_1:

<ChannelType value="ChannelType::RSSL_SOCKET"/>

<Host value="emea-3-t1.streaming-pricing-api.refinitiv.com"/>

<Port value="14002"/>

In the ema log in verbose mode is all OK(with no error) until I get:

Received ChannelDownReconnecting event on channel Channel_1

Instance Name Consumer_1_1

RsslReactor 0x0000000007B75E80

RsslChannel 0x0000000007B75E80

Error Id -1

Internal sysError 10057

Error Location C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Reactor\rsslReactorWorker.c:1241

Error Text <C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Transport\rsslSocketTransportImpl.c:6068> Error: 1002 ipcConnecting() client connect() failed. System errno: (10057)


Case 2:

EmaConfig.xml has for Channel_1:

<ChannelType value="ChannelType::RSSL_ENCRYPTED"/>

<Host value="emea-3-t1.streaming-pricing-api.refinitiv.com"/>

<Port value="443">

In the ema log in verbose mode is all OK(with no error) until I get:

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received ChannelDownReconnecting event on channel Channel_1

Instance Name Consumer_1_1

RsslReactor 0x0000000007B7DD70

RsslChannel 0x0000000007B7DD70

Error Id -1

Internal sysError 0

Error Location C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Reactor\rsslReactorWorker.c:1241

Error Text <C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Transport\ripcinetutils.c:1749> ripcWinInetInitConnection invalid HTTP ack


Case 3:

EmaConfig.xml has for Channel_1:

<ChannelType value="ChannelType::RSSL_HTTP"/>

<Host value="emea-3-t1.streaming-pricing-api.refinitiv.com"/>

<Port value="443"/>

In the ema log in verbose mode is all OK(with no error) until I get:

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received ChannelDownReconnecting event on channel Channel_1

Instance Name Consumer_1_1

RsslReactor 0x0000000007B427D0

RsslChannel 0x0000000007B427D0

Error Id -1

Internal sysError 0

Error Location C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Reactor\rsslReactorWorker.c:1324

Error Text Initialization timed out.


Case 4:

EmaConfig.xml has for Channel_1:

<ChannelType value="ChannelType::RSSL_HTTP"/>

<Host value="emea-3-t1.streaming-pricing-api.refinitiv.com"/>

<Port value="14002"/>

In the ema log in verbose mode is all OK(with no error) until I get:

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received ChannelDownReconnecting event on channel Channel_1

Instance Name Consumer_1_1

RsslReactor 0x0000000007B44080

RsslChannel 0x0000000007B44080

Error Id -1

Internal sysError 0

Error Location C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Reactor\rsslReactorWorker.c:1241

Error Text <C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Transport\ripcinetutils.c:410> winInetCallback error - HTTPSendRequest unable to complete successfully


Case 5:

EmaConfig.xml has for Channel_1:

<ChannelType value="ChannelType::RSSL_ENCRYPTED"/>

<EncryptedProtocolType value="EncryptedProtocolType::RSSL_SOCKET"/>

<Host value="emea-3-t1.streaming-pricing-api.refinitiv.com"/>

<Port value="14002"/>

In the ema log in verbose mode is all OK(with no error) until I get:

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received ChannelDownReconnecting event on channel Channel_1

Instance Name Consumer_1_1

RsslReactor 0x0000000007AE6160

RsslChannel 0x0000000007AE6160

Error Id -1

Internal sysError 10057

Error Location C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Reactor\rsslReactorWorker.c:1241

Error Text <C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Transport\ripcsslutils.c:1746> Error: 1002 ripcSSLInit client connect() failed. System errno: 10057


I did wrote a line of code to read through the self-discovery service the AWS servers so I know that the host is correct because If I use in EmaConfig.xml

<EncryptedProtocolType value="EncryptedProtocolType::RSSL_SOCKET"/> I do discover the host:ports

"apac-3-t1.streaming-pricing-api.refinitiv.com":14002

"emea-3-t1.streaming-pricing-api.refinitiv.com":14002

"amer-3-t1.streaming-pricing-api.refinitiv.com" :14002


and If I change to <EncryptedProtocolType value="EncryptedProtocolType::RSSL_WEBSOCKET"/>

I do discover the same hosts on 443 port

"apac-3-t1.streaming-pricing-api.refinitiv.com":443

"emea-3-t1.streaming-pricing-api.refinitiv.com":443

"amer-3-t1.streaming-pricing-api.refinitiv.com" :443


Based on my understanding, I should use in the channel definition

<ChannelType value="ChannelType::RSSL_ENCRYPTED"/> with

<EncryptedProtocolType value="EncryptedProtocolType::RSSL_SOCKET"/>

and

<Host value="emea-3-t1.streaming-pricing-api.refinitiv.com"/>

<Port value="14002"/>

as 14002 is used/needed when <EncryptedProtocolType value="EncryptedProtocolType::RSSL_SOCKET"/>

as <EncryptedProtocolType value="EncryptedProtocolType::RSSL_WEBSOCKET"/> is needed when port 443 is used and also when request message format needed is tr_json2.


So based on the documentation I think a Channel_4 similar setup should work (based on the EmaConfig.xml sample), but it does not work for me at the moment for some reason.


Can anyone has any pointers please what i do wrong as this task should be a matter of changing the code to the latest API, updating the host/port to the new AWS host and it should work.

I am out of ideas what is going wrong, and now I am at the point to debug deeper into EMA code to understand what is happening.


Debugging the EMA/ETA code, the code execution is all seems is correct until the point is calling

retval = (*(rsslSocketChannel->transportFuncs->connected))(rsslSocketChannel->stream,

rsslSocketChannel->transportInfo);

in rsslSokectTransportImpl.c in

ipcConnecting(RsslSocketChannel *rsslSocketChannel, ripcSessInProg *inPr, RsslError *error)

{

RsslInt32 retval;

ripcRWFlags rwflags = RIPC_RW_WAITALL;


_DEBUG_TRACE_CONN("called\n")


rwflags |= (rsslSocketChannel->blocking ? RIPC_RW_BLOCKING : 0);


if (rsslSocketChannel->blocking == 0)

{

/* Check to see if the connect() call has completed. */


retval = (*(rsslSocketChannel->transportFuncs->connected))(rsslSocketChannel->stream,

rsslSocketChannel->transportInfo);


which returns -1 and logging the error:

----

Just to add, there are some utility scripts on github at https://github.com/Refinitiv/websocket-api from where I do execute
market_price_authentication.py --hostname emea-3-t1.streaming-pricing-api.refinitiv.com --port 443 --user <machine_id> --password <password> --app_id <token>

and the outcome I get from this script is:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='127.0.0.1', port=8443): Max retries exceeded with url: /getToken (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000017EEC0F6250>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))


I tried with port 443(which i think is the correct port in this websocket utility script case) and 14002(just to test) and the outcome is the same

Thank you

elektronrefinitiv-realtimeelektron-sdktreprrtema-apic++
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
Accepted
23.6k 84 10 22

Hi @Ionut T

As a first step, can you work through the EMA Quick Start - Connecting to Refinitiv Real-Time -- Optimized exactly as detailed - including using the supplied EMAConfig.xml and copying it into the specified folder etc? And can you confirm the AppKey (ClientID) was generated as described with the EDP API tick box selected etc?

In terms of testing with Python, you can try one of the two examples in the following location:

websocket-api/Applications/Examples/RDP/python at master · Refinitiv/websocket-api (github.com) - as they are coded for connecting to Real-Time Optimized.

If the above Python scripts do not connect either and if you are on a corporate network / VPN - please try the Python script on a non-coporate PC / without VPN?


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.

Fallowing the guide and 113_MP_SessionMgmt project sample, and trying on work environment and also on home personal PC environment, solved the mistery.

Issues were:

1. Using websocket config approach I did not use the RDMFieldDictionary and the enumtype.def.

2.Using RSSL_SOCKET approach, issue is 14002 seems blocked at company domain level as connect() always fails but on personal environment it does work OK.

Thank you umer.

Kind Regards,

Ionut


Upvotes
17 3 4 2

@umer.nalla

Thank you umer for your input,

1. Yes The AppKey is enabled and all tick boxes are selected:

- API Types: Side by Side API, EDP API, Eikon Data API


2. Interesting, when I used the github python script market_price_authentication.py I got an error as I said before, but using a script from the examples folder from websocket-api/Applications/Examples/RDP/python at master · Refinitiv/websocket-api · GitHub it seems the credentials are OK.

Executing market_price_rdpgw_authentication.py it does work in the same way from my work environment as well as the personal environment. I do get an output as below which is confirmation that credentials work:


Sending authentication request with password to https://api.refinitiv.com:443/auth/oauth2/v1/token ...

Refinitiv Data Platform Authentication succeeded. RECEIVED:

{

"access_token":"eyJ......

.......................

Connecting to WebSocket wss://emea-3-t1.streaming-pricing-api.refinitiv.com:443/WebSocket ...

WebSocket successfully connected!

.................


3. I did look on EMA Quick Start guide, I guess maybe I did miss something so I will double check again.

I tried before and now using the EMAConfig.xml provided in the SDK and I use Consumer_4 which is using Channel_4.

For this channel I added as extra parameters:

<Host value="emea-3-t1.streaming-pricing-api.refinitiv.com"/>

<Port value="14002"/>

everything else remaining the same.

But still the ema log gives me the same outcome:


loggerMsg

TimeStamp: 17:47:10.296

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received ChannelDownReconnecting event on channel Channel_4

Instance Name Consumer_4_1

RsslReactor 0x0000000007B3A530

RsslChannel 0x0000000007B3A530

Error Id -1

Internal sysError 10057

Error Location C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Reactor\rsslReactorWorker.c:1241

Error Text <C:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS140-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Transport\ripcsslutils.c:1746> Error: 1002 ripcSSLInit client connect() failed. System errno: 10057

loggerMsgEnd


4. Another thing I noticed and i want to ask, is that when application starts the verbose mode of the ema log says:

supportBatchRequest 0


My application is using batch list subscription. so the question I have as extra is that: Is there a EmaConfig.xml parameter that I have to set to have batch subscription available ? Or is not needed.

As you can assume, I cannot confirm now if batch subscription is working or not as i cannot arrive at the point in my code where I call consumer.registerClient(...) in order to subscribe to the price updates, dues to the connect() failed issue I have, but I am asking as is also on the back of my mind.


Any extra help is appreciated, and in the meantime, as I said, I will check again the EMA Quick Start guide doc.

Interesting is that the app I have works perfectly fine in TREP environment in the banks, as well as on my personal testing environment at work where I use EZD.


So, in theory, all it should work the same considering that i do point to the new AWS hostname:port in the EmaConfig.xml file, using the right parameters as in the sample EmaConfig.xml and of course, I make use of the MachineID clientId and the password when I create my OmmConsumer.

OmmConsumer consumer(OmmConsumerConfig().consumerName(consumerName.c_str())

.clientId("...").username("...").password("..."));


Thank you,

Kind Regards,

Ionut

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
23.6k 84 10 22

Hi @Ionut T

Please do not change the default EMAConfig.xml file - just use it as is, ensuring it is in the working folder exactly as described in the QuickStart i.e.:

Refinitiv Real-Time -- Optimized Configuration

The SDK package includes a configuration file with the default config required to connect to Refinitiv Real-Time -- Optimized - EmaConfig.xml in the source code folder - as noted in the Paths table above.

Copy the Cpp-C\Ema\Examples\Training\100_Series\113_MP_SessionMgmt\EmaConfig.xml file to the relevant subdirectory of Cpp-C\Ema\Executables\.

If you note the comments in the default EMAConfig.xml for Channel_4, it states:

<!-- EMA discovers a host and a port from RDP service discovery for the specified location when both of them are not set and the session management is enable. -->
<Location value="us-east"/>
<EnableSessionManagement value="1"/>

I recommend you follow the QuickStart exactly as described, just to ensure all is OK, before attempting to connect with your own code.

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
17 3 4 2

Hi @umer.nalla

Thank you for your feedback.

I am checking now the documentation including EMA Quick Start - Connecting to Refinitiv Real-Time -- Optimized.

In the meantime, I do get mixed results using the 113_MP_SessionMgmt sample code.

1. Using 113_MP_SessionMgmt using the default EmaConfig.xml provided, if I pass the argument -websocket this makes the application to use Channel_5 and Dictionary_2.

With this, I get access denied for the IBM.N which is interesting.

StatusMsg

streamId="5"

domain="MarketPrice Domain"

state="Closed / Suspect / Not entitled / 'Access Denied: User req to PE(62)'"

name="IBM.N"

nameType="1"

serviceId="257"

serviceName="ELEKTRON_DD"

StatusMsgEnd


However, if the Item financial item I change it from "IBM.N" to "EUR=" for example, it does work indeed as I do get price updates.

RefreshMsg

streamId="5"

domain="MarketPrice Domain"

Solicited

RefreshComplete

ClearCache

state="Open / Ok / None / ''"

itemGroup="00 00"

permissionData="03 01 01 52 6C"

qos="RealTime/JustInTimeConflated"

seqNum="42430"

name="EUR="

nameType="1"

serviceId="257"

serviceName="ELEKTRON_DD"

Payload dataType="FieldList"

FieldList

FieldEntry fid="1" name="PROD_PERM" dataType="UInt" value="526"


2. So, with websocket is working.

Using 113_MP_SessionMgmt using the default EmaConfig.xml provided, If I do not pass -websocket to the argument list, this makes the sample file to use Channel_4 and Dictionary_1(Dictionary_1 has no definition as has the default value always present:

<!-- Dictionary is optional: defaulted to "ChannelDictionary")

Using this config it does not work at all when I execute the sample file, as I do get exactly the same error as with my main application (client connect() failed) - which tells me nothing might be wrong with my application but is the same config issue I have here in the sampel file using Channel_4:

loggerMsg

TimeStamp: 13:02:38.098

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received ChannelDownReconnecting event on channel Channel_4

Instance Name Consumer_4_1

RsslReactor 0x0000026FC446CCF0

RsslChannel 0x0000026FC446CCF0

Error Id -1

Internal sysError 10057

Error Location D:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS142-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Reactor\rsslReactorWorker.c:1241

Error Text <D:\Jenkins\workspace\ESDKCore_RCDEV\OS\VS142-64\rcdev\source\rtsdk\Cpp-C\Eta\Impl\Transport\ripcsslutils.c:1746> Error: 1002 ripcSSLInit client connect() failed. System errno: 10057

loggerMsgEnd


Exception Type='OmmInvalidUsageException', Text='login failed (timed out after waiting 45000 milliseconds) for :)', ErrorCode='-4052'


So the question here is: why is not working with Channel_4 which means:

<ChannelType value="ChannelType::RSSL_ENCRYPTED"/>

<EnableSessionManagement value="1"/>

<EncryptedProtocolType value="EncryptedProtocolType::RSSL_SOCKET"/>


but is working with Channel_5 using websocket.

This is also inline with the Python utility script which is using websocket.


Again, I did not modify any of the sample files in 113_MP_SessionMgmt .


Edit: Trying also Channel_5 settings which is using Dictionary_2 which needs RDMFieldDictionary file as well as enumtype.def file, my custom application also connects and works.


So, up to now, everything is similar: My custom app works similarly as 113_MP_SessionMgmt but using only websocket(Channel_5 , Dictionary_2 and RDMFieldDictionary file as well as enumtype.def file) and fails in the same way as the 113_MP_SessionMgmt using Channel_4.


I have to find out why fails as above with Channel_4.


Thank you,

Kind Regards

Ionut

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
23.6k 84 10 22

Hi @Ionut T

Firstly, the 'Closed / Suspect / Not entitled / 'Access Denied: User req to PE(62)' indicates you are not licenced for that particular instrument - quite common with trial accounts. You can ask your Refinitiv Account manager to advise what data you are licenced for.

In terms of the RSSL connection not working - but the Websocket connection working, the most common reason for this kind of behaviour is corporate network issues - e.g. firewalls/ports etc

The one obvious difference being the port number - where Websocket uses 443 and RSSL uses 14002. Are you able to discuss this with your corporate network/security team to look into 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
17 3 4 2

Hi @umer.nalla,

Yes i also tried specifying the host and port in EmaConfig.xml as to 443 for websocket and 14002 for RSSL and is working with websocket only.

I will get the sample projects on my home PC to double check the network security ports aspect.

If the sample will work on local personal environment deffo is a network securitity issue, if I will get the same result than might be something in refinitiv environment in regard to the permissions.

If it proves to work locally, then yes i will address the issue further with the company IT team.

Will let you know.


Kind Regards,

Ionut

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
17 3 4 2

Hi @umer.nalla

Happy days,

Same sample project 113_MP_SessionMgmt works as well with the Refinitiv credentials I have using RSSL and not only using websocket, once i setup the PC accordingly.

Seems it is indeed based on the outcome I see is a network/firewall issue in my work environment.

I will contact my It department to confirm and discuss further.


Thank you again for all the help.

Kind Regards,

Ionut

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.

Hi @Ionut T

Thanks for the update and apologies it took so long to get their.

I had a suspicion it was network thing, but usually the Websocket ports are also closed off - so that was a red herring for me.

If your IT Department needs some guidance, they can try and raise a Ticket at My.Refinitiv for the Refinitiv Real-Time - Optimized product.

They may also find the RTO install and config guide of use - Documentation | Refinitiv Developers

Hi @umer.nalla

Yes, my main application did use in the past with old ELEKTRON SDK as well RSSL_SOCKET 14002 but through EZD daemon proxy.

So that is why I also got delayed as knowing is working using EZD and the old SDK on 14002 then 14002 is not blocked right ?

But that applied to my local machine port, but it seems from the outside world at domain level it is closed or at least it seems so.