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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 1 1

Eikon python API behind corporate proxy - Internal Server Error 500

Hello!

I`m working with Eikon Desktop via eikon python api from behind the corporate proxy on Windows 10. To avoid well-known problem with "400 - Request on loopback from external IP" problem (caused by that fact that httpx library used by eikon library ignores Windows system settings of proxy bypassing for local addresses and forwards requests to local addresses to the proxy as well) I`ve added system environment variable NO_PROXY=localhost,127.0.0.1.

Now I`m facing the following output - would you please help me to alleviate this error:

2021-07-07 12:09:35,236 P[2064] [MainThread 12880] Send GET request to http://127.0.0.1:9060/api/status to detect API Proxy...

2021-07-07 12:09:35,237 P[2064] [MainThread 12880] Request to http://127.0.0.1:9060/api/status

headers = {'x-tr-applicationid': '<my app key here>'}

params = None

2021-07-07 12:09:35,295 P[2064] [MainThread 12880] HTTP request response 200: {"statusCode":"ST_PROXY_READY","version":"2.8.0"}

2021-07-07 12:09:35,295 P[2064] [MainThread 12880] Checking port 9060 response : 200 - {"statusCode":"ST_PROXY_READY","version":"2.8.0"}

2021-07-07 12:09:35,295 P[2064] [MainThread 12880] Port 9060 was retrieved from .portInUse file

2021-07-07 12:09:35,295 P[2064] [MainThread 12880] Try to handshake on url http://127.0.0.1:9060/api/handshake...

2021-07-07 12:09:35,296 P[2064] [MainThread 12880] Request to http://127.0.0.1:9060/api/handshake

headers = {'Content-Type': 'application/json', 'x-tr-applicationid': '57b644d0af7542ae8e72925538df86444e599241'}

params = None

2021-07-07 12:09:50,298 P[2064] [MainThread 12880] TimeoutException on HTTP request: ReadTimeout('')

2021-07-07 12:09:50,298 P[2064] [MainThread 12880] Error on handshake port 9060 : TimeoutException("TimeoutException on HTTP request: ReadTimeout('')")

2021-07-07 12:09:50,298 P[2064] [MainThread 12880] Application ID: 57b644d0af7542ae8e72925538df86444e599241

2021-07-07 12:09:50,298 P[2064] [MainThread 12880] Init a Desktop session with new app_key

2021-07-07 12:09:50,298 P[2064] [MainThread 12880] Port 9060 on local proxy was detected

2021-07-07 12:09:50,298 P[2064] [MainThread 12880] entity: TimeSeries

2021-07-07 12:09:50,298 P[2064] [MainThread 12880] payload: {'rics': ['CEMB.K'], 'fields': ['*'], 'interval': 'daily', 'startdate': '2010-01-01T00:00:00', 'enddate': '2021-07-07T12:09:50.298970+03:00'}

2021-07-07 12:09:50,298 P[2064] [MainThread 12880] Request:{'Entity': {'E': 'TimeSeries', 'W': {'rics': ['CEMB.K'], 'fields': ['*'], 'interval': 'daily', 'startdate': '2010-01-01T00:00:00', 'enddate': '2021-07-07T12:09:50.298970+03:00'}}}

2021-07-07 12:09:50,300 P[2064] [MainThread 12880] Request to http://127.0.0.1:9060/api/v1/data

headers = {'Content-Type': 'application/json', 'x-tr-applicationid': '57b644d0af7542ae8e72925538df86444e599241'}

params = None

2021-07-07 12:10:11,328 P[2064] [MainThread 12880] HTTP request response 500: {"code":500,"message":"socket hang up","statusMessage":"Internal Server Error"}

2021-07-07 12:10:11,328 P[2064] [MainThread 12880] HTTP Response code: 500

2021-07-07 12:10:11,328 P[2064] [MainThread 12880] HTTP Response: {"code":500,"message":"socket hang up","statusMessage":"Internal Server Error"}

2021-07-07 12:10:11,328 P[2064] [MainThread 12880] Error code 500 | Server Error: {"code":500,"message":"socket hang up","statusMessage":"Internal Server Error"}

2021-07-07 12:10:11,328 P[2064] [MainThread 12880] HTTP request failed: EikonError-Server Error: {"code":500,"message":"socket hang up","statusMessage":"Internal Server Error"}

Traceback (most recent call last):

File "C:\ProgramData\Anaconda3\lib\site-packages\eikon\json_requests.py", line 127, in send_json_request

_raise_for_status(response)

File "C:\ProgramData\Anaconda3\lib\site-packages\eikon\json_requests.py", line 271, in _raise_for_status

raise EikonError(response.status_code, error_msg)

eikon.eikonError.EikonError: Error code 500 | Server Error: {"code":500,"message":"socket hang up","statusMessage":"Internal Server Error"}

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonproxyerror-500
icon clock
10 |1500

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

Upvotes
Accepted
39.2k 75 11 27

The issue was resolved by adding a config parameter to Eikon account settings at Refinitiv.

icon clock
10 |1500

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

I am running into this problem after updating eikon. Could you elaborate on how to add the config parameter?

Upvotes
6.7k 8 6 7

@NefedovAA the dev team are looking into this - in the meantime you could try rolling back the Eikon version to the previous one to see if that helps - from command line:

Eikon.exe-rollback

Let me know if this works. Apols its all I can offer at the moment.

icon clock
10 |1500

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

Thank you, but I couldn`t do it - I have no previous version to rollback to (my current version is the first and the only one I`ve installed).

1626075556160.png

1626075556160.png (192.6 KiB)
Upvotes
4.3k 2 4 5

Hi @NefedovAA,

Not sure if it'll help,but if you added NO_PROXY system environment variable, I suppose you set also HTTP_PROX and HTTPS_PROXY, and already checked if you have following response :

{"statusCode":"ST_PROXY_READY","version":"2.8.0"}

when you browse to http://localhost:9060/api/status..

Before any rollback, could you follow this trouble shooting guide (sections related to Eikon 4) and provide collected information (except personal data like appk key), especially :

  • Eikon Desktop & Apps versions
  • Eikon API Proxy logs (check incoming and POST requests)

In API Proxy logs, check if there is trace like this:

[2021-07-07 12:34:36.857|1|data-api|3|DEBUG] [TracingMiddleware]Creating new request tracing middleware.
[2021-07-07 12:34:36.865|1|data-api|3|DEBUG] [TracingMiddleware]Got new incoming request, request id is #51cae4bb-f78f-4b9f-9d7f-75ef961afddc.
[2021-07-07 12:34:36.872|1|data-api|1|INFO] [LogRequestDetailMiddleware][Request #51cae4bb-f78f-4b9f-9d7f-75ef961afddc] New incoming GET request
[2021-07-07 12:34:36.880|1|data-api|3|DEBUG] [LogRequestDetailMiddleware][Request #51cae4bb-f78f-4b9f-9d7f-75ef961afddc] URL: http://localhost:9060/api/status

Thanks

icon clock
10 |1500

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

Upvotes
1 1 1 1

@pierre.faurel, thank you, yes, I have all those 3 environment variables assigned. Btw, I have the following error in the System Test tool - 1625846509163.png

could this be the reason?

On your questions - yes, I have exactly that response in the browser about the proxy.

My Eikon Desktop version is 4.0.54 (MSI Version 4.0.54062), eikon api is 1.1.12.

As concerned log files - I`ve switched on logging in Config Manager, what specific log should I explore? (One in the TRD subfolder seems to not get updated once I run my python test multiple times and get aforementioned errors there).


1625846509163.png (326.8 KiB)
icon clock
10 |1500

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

Upvotes
39.2k 75 11 27

@NefedovAA

I don't believe the errors in the System Test are relevant.
The log file we're interested in is named APIProxy.<datetime>.p<process-id>.txt. It is located in the Eikon.<datetime>.p<process-ID> subfolder within TRD folder. See Chapter 3 "Verify that Eikon Desktop is running properly and APIPROXY service is enabled" in the article titled Eikon Data API(Python) Troubleshooting for illustration. Note that for the log to be useful, it needs to be created at the max trace level configured in Eikon Configuration Manager.

icon clock
10 |1500

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

Click below to post an Idea Post Idea