Error 500 ECONNRESET

Estoy tratando de conectarme por API de python desde la red de la empresa y obtengo el siguiente error:


EikonError: Error code 500 | Server Error: {"code":500,"message":"read ECONNRESET","statusMessage":"Internal Server Error"}


Si me conecto desde otra red, no tengo inconvenientes.

Ya radiqué también caso 10699766 y no me dan respuesta, solo que postee la pregunta por acá. En este mismo foro recomiendan que para este tipo de error radique el caso en el HelpDesk (ver https://community.developers.refinitiv.com/questions/70763/error-from-the-python-eikon-api-i-get-an-error-mes.html)


Este el código que utilizo y me arroja error:

ek.set_app_key('xxxx')

RICs = ['COP1YOIS=INFV','COQMIBR2Y=INFV','COQMIBR3Y=INFV','COQMIBR5Y=INFV','COQMIBR10Y=INFV']


ts,e = ek.get_data(RICs,

["TR.MIDPRICE.date","TR.MIDPRICE"],

{'SDate':start_date,'EDate':end_date,'Frq':'D'})

ts



Qué puedo hacer? Alguna ayuda?

Tagged:

Best Answer

Answers

  • Hello @carruiz,

    Since your setup is working elsewhere and not in this particular network, it is most likely that your company firewall is blocking the request to Eikon servers. What is the status message at: http://localhost:9000/api/status

    Check with your network administrators if the firewall is blocking the traffic to Eikon servers.

  • Hello @Gurpreet, the status message at http://localhost:9000/api/status is {"statusCode":"ST_PROXY_READY","version":"2.9.0"}.

    Could you share the Eikon server's urls to check if they are blocked? The desktop version works fine using the company's network.

    Thanks in advance


  • Can you enable debug logging on the API and see what the output is:

    import eikon as ek
    import logging.config
    ek.set_log_level(logging.DEBUG)
    ek.set_app_key(xxxx)
  • Hello @Gurpreet, this is the output:

    2021-11-24 14:10:44,829 P[11720] [MainThread 14456] Send GET request to http://127.0.0.1:9060/api/status to detect API Proxy...

    2021-11-24 14:10:44,834 P[11720] [MainThread 14456] Request to http://127.0.0.1:9060/api/status

    headers = {'x-tr-applicationid': 'xxx'}

    params = None

    2021-11-24 14:10:46,848 P[11720] [MainThread 14456] Error on checking port 9060 : ConnectError("[Errno 10061] Connect call failed ('127.0.0.1', 9060)")

    2021-11-24 14:10:46,849 P[11720] [MainThread 14456] Warning: file .portInUse was not found. Try to fallback to default port number.

    2021-11-24 14:10:46,850 P[11720] [MainThread 14456] Try defaulting to port 9000...

    2021-11-24 14:10:46,851 P[11720] [MainThread 14456] Send GET request to http://127.0.0.1:9000/api/status to detect API Proxy...

    2021-11-24 14:10:46,852 P[11720] [MainThread 14456] Request to http://127.0.0.1:9000/api/status

    headers = {'x-tr-applicationid': 'xxx'}

    params = None

    2021-11-24 14:10:46,878 P[11720] [MainThread 14456] Checking port 9000 response : 503 - API Proxy is not available

    2021-11-24 14:10:46,878 P[11720] [MainThread 14456] Application ID: xxx

    2021-11-24 14:10:46,879 P[11720] [MainThread 14456] Init a Desktop session with new app_key

    2021-11-24 14:10:46,880 P[11720] [MainThread 14456] Port 9000 on local proxy was detected


    Thanks in advance

  • Something is wrong in your setup. It could be python modules or eikon setup or proxy. Previously you said you were able to get a response from http://127.0.0.1:9000/api/status, but this log shows that python didn't get a response.

    Can you confirm that your setup still works from non-office environment? Maybe check the firewall rules with your network admin, or try reinstalling the Eikon and python in a virtual environment.

  • I created a virtual environment and installed Eikon in it. However I get this message when I try to get the data:1637944585117.png

  • Were you able to get past the

    ek.set_app_key

    line of code without exception?

  • Yes, i was

  • Can you please collect the proxy logs as described in another question:

    The error indicates that TCP connection between Eikon API Proxy and Eikon platform backend was abruptly terminated. This could happen for any number of reasons. Eikon API Proxy is a component of Eikon desktop application, which technically is a Node.js server running on your machine and listening for HTTP requests sent by Eikon Data API library to http://localhost:9060/api/...", and passing these requests with additional headers to Eikon platform backend Web services.
    If you experience this error intermittently and infrequently, you could catch it in your code and resubmit the request. Otherwise, if you're able to reproduce the issue at will, it would be very helpful to get Eikon API Proxy log files created with logging configured at the max level. Run Eikon Configuration Manager from Windows Start menu, select Logs tab and set Refinitiv Desktop trace level to "4 - Debug". Click Configure and restart Eikon. Then reproduce the error and collect SxS.<datetime>.<pid>.txt and APIProxy.<datetime>.<pid>.txt log files from Eikon logs folder (C:\ProgramData\Thomson Reuters\Eikon Data\Logs\TRD\Eikon.<datetime>.<pid>). Once you've collected the logs, you can put them in a zip file and attach it to your post. Don't forget to reverse logging settings after collecting the logs. You don't want Eikon and Python to keep outputting debug level logging.

  • Hello @Gurpreet,

    I've tried again execute it and get this error after

    ek.set_app_key('xxxx') line:

    2021-12-09 14:38:19,540 P[19328] [MainThread 17364] Reset a Desktop session with new app_key 2021-12-09 14:38:19,542 P[19328] [MainThread 17364] Unlock login_event for streaming session 0 due to stop streaming call 2021-12-09 14:38:19,549 P[19328] [MainThread 17364] Send GET request to http://127.0.0.1:9060/api/status to detect API Proxy... 2021-12-09 14:38:19,551 P[19328] [MainThread 17364] Request to http://127.0.0.1:9060/api/status
        headers = {'x-tr-applicationid': 'xxxx'}     params = None 2021-12-09 14:38:19,562 P[19328] [MainThread 17364] Checking port 9060 response : 200 - {"statusCode":"ST_PROXY_READY","version":"2.9.0"} 2021-12-09 14:38:19,563 P[19328] [MainThread 17364] Port 9060 was retrieved from .portInUse file 2021-12-09 14:38:19,564 P[19328] [MainThread 17364] Try to handshake on url http://127.0.0.1:9060/api/handshake...
    2021-12-09 14:38:19,565 P[19328] [MainThread 17364] Request to http://127.0.0.1:9060/api/handshake
        headers = {'Content-Type': 'application/json', 'x-tr-applicationid': 'xxx'}     params = None 2021-12-09 14:38:19,793 P[19328] [MainThread 17364] Response : 500 - {"code":500,"message":"read ECONNRESET","statusMessage":"Internal Server Error"} 2021-12-09 14:38:19,794 P[19328] [MainThread 17364] Response 500 on handshake port 9060 : {"code":500,"message":"read ECONNRESET","statusMessage":"Internal Server Error"} 2021-12-09 14:38:19,795 P[19328] [MainThread 17364] Application ID: xxx 2021-12-09 14:38:19,796 P[19328] [MainThread 17364] Init a Desktop session with new app_key 2021-12-09 14:38:19,797 P[19328] [MainThread 17364] Port 9060 on local proxy was detected


    any idea?

    Could you share please the Eikon server's urls to check if they are blocked?

  • hi @carruiz

    regarding to an answer from this thread

    it seems like it's a networking issue. Please see this thread https://community.developers.refinitiv.com/questions/70304/code-500-internal-server-error.html . From that thread: 'The best way to go about investigating and resolving the problem your client experienced is to open a case with Refinitiv Helpdesk and have a troubleshooting session between your IT and Refinitiv Support. The format of a community forum is not very well suited to investigating networking issues, not to mention that sharing details of your private network configuration on a public forum could be a security concern.

    To open a case with Refinitiv Helpdesk, use Contact Us capability in your Eikon application (from the main Eikon menu select Help - Contact Us) or visit MyRefinitiv.

    I hope this can help.

  • I also opened case 10699766 and they don't give me an answer, they only ask me to post the question here...

    So, what can i do? any help please?


    again:

    Could you share with me the Eikon server's urls to check if they are blocked?