Eikon Data API: Error code 500

Hi,


I have been using the Eikon Data API for more than a year and it worked well until recently. I'm getting the following error message:

Error code 500 | Server Error: Internal Server Error - {"code":500,"message":"connect ETIMEDOUT 159.220.1.19:443","statusMessage":"Internal Server Error"}

Can you help me?

Best Answer

  • Hi Pierre! Good news. It worked! The issue was indeed because of nest-asyncio 1.4.1

    Thanks a lot!

Answers

  • Hi,

    Could you provide following information ?

    1. eikon lib and Eikon Desktop version
    2. involved eikon functions (it seems to be streaming API)
    3. is issue always reproduced or time to time ?



  • Hi,

    1. Desktop 4.0.52055. What is Eikon lib? maybe the API key can help you investigate, do you need it? is it safe to post it here?

    2. yes I import eikon in python as ek, then ek.get_news_story, ek.set_app_key(, ek.get_news_headlines

    3. The issue is always reproducible.

  • Hi Refinitiv support team,

    The issue is still present today. Have you had a chance to look into the problem?


    Rgds,

  • Hi,

    To avoid any confusion with previous issues, I assume you're up-to-date with eikon version (1.1.6.post3)

    The 500 error comes from the platform and we need more information to identify the root cause.
    Could you give examples of get_news_headlines() and get_news_story() usages ?

  • No actually my version is 1.0.0! So I will update it first and keep you posted. Thanks Pierre.

  • So I updated my eikon package to version 1.1.6.post3.

    Then it worked for a moment and now it's back to error 500. But there is a new message now:


    2020-09-29 16:45:35,369 P[6300] [MainThread 9780] Error on handshake port 9060 : TimeoutException("TimeoutException on HTTP request: ReadTimeout('',)",)

    2020-09-29 16:45:56,378 P[6300] [MainThread 9780] Error code 500 | Server Error: {"code":500,"message":"connect ETIMEDOUT 159.220.1.19:443","statusMessage":"Internal Server Error"}

    exception occured : Error code 500 | Server Error: {"code":500,"message":"connect ETIMEDOUT 159.220.1.19:443","statusMessage":"Internal Server Error"}


    Examples of how I use get_news_headlines and get_news_story:


    headlines = ek.get_news_headlines(query=q, date_from=start_date, date_to=end_date, count=100)

    allNews = []

    index = pd.DataFrame(headlines, columns=['storyId']).values.tolist()


    for i, storyId in enumerate(index):

    try:

    x = parse_news(storyId[0])

    allNews.append(x)

    except:

    continue


    parse_news function calls get_news_story once

    def parse_news(storyId):

    x = ek.get_news_story(storyId)



    I hope this can help solve the issue.


    Rgds,


    Jean-Baptiste

  • Hi,

    Any progress on this issue?

    Let me know if you need more info to solve the issue.

  • Also let me know if i should redirect my request to another channel. Maybe this is not the right place for this kind of issues...

  • Hi,

    I apologize, I didn't see your responses and I was notified by the support about your messages !

    The message "2020-09-29 16:45:35,369 P[6300] [MainThread 9780] Error on handshake port 9060 : TimeoutException("TimeoutException on HTTP request: ReadTimeout('',)",) " means that API Proxy in Eikon Desktop is not running.

    Could you check following steps :

    1. To check if API Proxy is running well, you can open http://localhost:9000/api/status
    2. In your script, you can activate verbose log and when you set app_key, you can test if connection is up before continue as follow:
    ek.set_log_level(1) ek.set_app_key("xxxx") 
    state = ek.get_desktop_session().get_open_state()
    if state == ek.Session.State.Open:
        headlines = ek.get_news_headlines(query=q, date_from=start_date, date_to=end_date, count=100) 
        ...

    3. Lastly, if you can define environment variable HTTPX_LOG_LEVEL=trace then run your script, we'll can have full logs to investigate and check what's the root cause of this error code 500


  • Hi Pierre!


    Step 1 fails. It gives me "this site can't be reached".

    I asked IT and they have no clue. Do you know what I should do?

  • Hi,

    1. we discovered a regression caused by last version of nest-asyncio dependency.
    Could you check that you don't have 1.4.x version but 1.3.3 ?

    2. Could you follow this following test ?

    Open a console windows then type :

    > python -c "import httpx; print(httpx.get('http://localhost:9060/api/status'))"

    Chek if there is error in output.

    Now, type:

    > set NO_PROXY=localhost:9000,localhost:9060> python -c "import httpx; print(httpx.get('http://localhost:9060/api/status'))"

    Check the output (it should be <Response [200 OK]> )

    3. Could you apply step 3 (from my previous message) ?

  • My version of nest-asyncio is 1.4.1

    When I type: python -c "import httpx; print(httpx.get('http://localhost:9060/api/status'))"

    I get the following output:

    <Response [200 OK]>

    When I type:

    > set NO_PROXY=localhost:9000,localhost:9060> python -c "import httpx; print(httpx.get('http://localhost:9060/api/status'))"

    I get the following output:

    <Response [200 OK]>


    Now about step 3 from your previous message, I did this:image


    Is it ok?

  • nest-asyncio 1.4.1 was recently identified as a cause of "Error code -1 | Port number was not identified. eikon lib error."
    It's recommended to downgrade to 1.3.3 (with command "pip install nest-asyncio==1.3.3")

    Once you'll downgrade it, could you run your script and check output (with debug traces as you set HTTPX_LOG_LEVEL to trace).

    Once that'll be done, don't forget to delete HTTPX_LOG_LEVEL variable.

  • Ok thx I will. I can't do it now because of the firewall but I will try on monday and let you know.

    Have a good weekend Pierre!

  • Good news.

    Thank you for your feedback !