Exception when requesting ceratin combination of paramters with HistoricalPricing.GetSummaries

When I modify the .NET example (2.0.0) code:

response = HistoricalPricing.GetSummaries(new HistoricalPricingSummaries.Params().Universe("DTEGn.DE") .WithInterval(HistoricalPricingSummaries.Interval.P1D)

.WithFields("DATE", "OFF_CLOSE")
.WithCount(10000));

I always get a "Newtonsoft.Json.JsonReaderException":

Failed to execute: GetSummaries error: {

"HTTPStatusCode": 200,
"HTTPReason": "OK",
"Exception": {

"ExceptionType": "Newtonsoft.Json.JsonReaderException",
"Message": "After parsing a value an unexpected character was encountered: u. Path '[0].data[713][0]', line 1, position 16395."


Best Answer

  • Hi @martin.grunwald,

    I've been informed that the issue has been resolved. I've tested against Eikon, which is where the error was occurring, and everything came through as expected. If you get a chance, please verify the issue has been resolved on your end. The issue was related to the Eikon Proxy.

    Thanks for your patience.

Answers

  • Hi @martin.grunwald,

    This error indicates that the Historical service in the backend may have sent an invalid JSON message. I went ahead and tried your exact example and unfortunately didn't receive an error. If you consistently receive an error, perhaps you can try a few things.

    You should see a log file within your bin/x64/Debug directory in the form: RDPLog_<pid>.log. There may be output which shows the message coming from the historical service that is causing the exception.

    Alternatively, you can turn on the trace levels within the library by doing the following:

    using Refinitiv.DataPlatform; ... // At the top of your program, turn on tracing Log.Level = NLog.LogLevel.Trace;

    This will show more details within the log.

    Thirdly, you can go into the Playground and use the Interday Summary Endpoint and input your parameters there to give it a try to review the output.

  • I found the log file (attached to this comment) RDPLog_32088.zip

    The problem still persist but I don't think I can do anything about it on my side, it looks like some kind of buffer overrun issue.

    Example form the log:

    ...

    [\"2017-06-09\",17.125], [\"20My\u0016[\u0001\u0002\u0000?\u0014\u0003\u0003\u0000\u0001\u0001\u0016\u0003\u0003\u0000P?x?<$??Q?

    ...

  • Hi @martin.grunwald,

    Thanks for the log file. Yes, I can see down deep in the response contains junk as you shown above which is obviously causing the message parsing to fail. I have run the command several times and have not seen the issue. Have you tried shortening the count from 10000 to 2000 (or some other number)? Have you tried sending this command within the Playground? I believe the message is being sent correctly from the server but something is trashing the buffer with garbage. Is the application you are using basically the example from the download package but with different parameters?

    I'm trying to think of some possible causes, whether it could be memory or an application thread that could be trashing the memory image. I'm sure you've already tried this but clean and rebuild your application. If your application is different enough from the example, you could send me the whole thing so I can try it on my machine.

  • I used the example as is with minimal modification (as seen in the OP). In my actual application I'm now stitching together smaller request (300 at a time) as a workaround. I will eventually run into the same issue at about 5100 bars. I am running Windows 10 with German language settings, in my experience that might cause some text parsing issues. I have not tried the playground yet, but I can do this next.

    Also, and may be unrelated. Sometimes I have a small dialog popping up from Eikon application which I assume is from catching an unhandeled exception. After that only restarting Eikon can fix the API. I haven't reported that one yet since I cannot reproduce it reliably.

  • I tried the API playground that seems to work fine.

  • I just noticed the same issue using "HistoricalPricing.GetEvents" modyfying the example 2.0.1.

    var response = HistoricalPricing.GetEvents(new HistoricalPricingEvents.Params().Universe("DTEGn.DE")
    .WithEventTypes(HistoricalPricingEvents.EventType.trade)
    .WithCount(10000));

    Using this I got the "Eikon encoutered an error" dialog and the API is completely unresponsive until I restart Eikon.

    **************
    Failed to execute: Fehler beim Senden der Anforderung.
    System.Net.WebException: Die zugrunde liegende Verbindung wurde geschlossen: Unbekannter Fehler beim Empfangen.. ---> System.IO.IOException: Von der Übertragungsverbindung können keine Daten gelesen werden: Eine vorhandene Verbindung wurde vom Remotehost geschlossen. ---> System.Net.Sockets.SocketException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
    bei System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
    bei System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
    --- Ende der internen Ausnahmestapelüberwachung ---
    bei System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
    bei System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
    --- Ende der internen Ausnahmestapelüberwachung ---
    bei System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
    bei System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
    ***************

  • Hi @martin.grunwald,

    I was able to reproduce the issue. Using the RDP Library for .NET, I tested with both the Platform Session and Desktop Session and didn't initially have any issues. When I was testing with the Desktop Session, I was using Refinitiv Workspace, the next generation of Eikon, with no issues. However, when I switched my desktop over to Eikon, I saw the same thing as you. I believe it may be an issue with the Eikon Proxy but will confirm.

    I will look into this a little deeper to see if there is a potential solution or version upgrade that will help. In the meantime, if you have access credentials for the Refinitiv Data Platform, you can build/test your application using the Platform Session. I will keep you posted.

  • Hi @martin.grunwald,

    I also tested this and received the same error as you when using Eikon. There were no issues when using Refinitiv Workspace or using a Platform Session. As I mentioned in my other answer (see below), it appears there may be an issue with the Eikon Proxy. I've reached out to the team to better understand.