eikon.eikonError.EikonError: Error code -1 | Port number was not identified. Check if Eikon Desktop

I'm trying to get timeseries data in my local-django project, however when I'm trying to get the data I got this error message:

eikon.eikonError.EikonError: Error code -1 | Port number was not identified. Check if Eikon Desktop or Eikon API Proxy is running.

After creating a new app_key, I have write a lite code in Jupyter in order to understand if my connection works well, and this is what I get:

2020-09-03 09:32:22,231 P[5920] [MainThread 28020] Reset a Desktop session with new app_key 
2020-09-03 09:32:22,232 P[5920] [MainThread 28020] Unlock login_event for streaming session 0 due to stop streaming call
2020-09-03 09:32:22,245 P[5920] [MainThread 28020] Checking port 9060 response : 500 - {"code":500,"message":"Cannot find module \".\"","statusMessage":"Internal Server Error"}
2020-09-03 09:32:22,246 P[5920] [MainThread 28020] Port 9060 was retrieved from .portInUse file
2020-09-03 09:32:22,246 P[5920] [MainThread 28020] Try to handshake on url http://localhost:9060/api/handshake...
2020-09-03 09:32:22,421 P[5920] [MainThread 28020] Response : 200 - {"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBcGlWZXJzaW9uIjoiMSIsIkFwcEtleSI6Ijc1ZGM2YzkzZjRlNTQ4MTU5OGU0MmI5NDBlZmY2YTJlZGZiODhkNzQiLCJBcHBTY29wZSI6InJhcGkiLCJMaWJyYXJ5TmFtZSI6IkVpa29uIFB5dGhvbiBMaWJyYXJ5IiwiTGlicmFyeVZlcnNpb24iOiIxLjEuNSIsImlhdCI6MTU5OTExODM0MiwiZXhwIjoxNjAwMzI3OTQyfQ.l7lJmXeGNotyvrr0B3j1yJ-CwNYCHLeC2RO1ATbN0FY","expires_in":1209600,"token_type":"bearer"}
2020-09-03 09:32:22,422 P[5920] [MainThread 28020] Application ID: <my_app_key>
2020-09-03 09:32:22,422 P[5920] [MainThread 28020] Init a Desktop session with new app_key
2020-09-03 09:32:22,423 P[5920] [MainThread 28020] Port 9060 on local proxy was detected
2020-09-03 09:32:22,424 P[5920] [MainThread 28020] entity: TimeSeries 2020-09-03 09:32:22,425 P[5920] [MainThread 28020] payload: {'rics': ['AAPL.O'], 'fields': ['CLOSE', 'TIMESTAMP'], 'interval': 'daily', 'startdate': '2020-07-30T00:00:00', 'enddate': '2020-08-31T00:00:00'}

but I get some data.

However if use the same code in the Django project I get this error

eikon.eikonError.EikonError: Error code -1 | Port number was not identified. Check if Eikon Desktop or Eikon API Proxy is running.

I'm running the django application server on PORT 8080, if I remember well Eikon use the 8000

python manage.py runserver 8080

Thank you for your help.


Best Answer

  • @c.aydemir

    Thank you very much for your feedback. We believe we identified the root cause of the problem, which manifests with Python 3.8+. The root cause happened to be in the dependencies of Eikon Data APIs for Python library (requests-async, http3 and nest-asyncio).
    The problem has been addressed in Eikon Data APIs for Python library v1.1.6, which is now available on PyPI. Would you be so kind as to upgrade eikon module on your machine to v1.1.6 and see if it works? I'd very much appreciate if you could post your experience back on this thread.

Answers

  • Hi @c.aydemir What version of Eikon library and Eikon are you using? Some users have been experiencing issues with eikon library 1.1.4/1.1.5 and eikon 4.0.52. Please could you try dropping back eikon library to 1.1.2 (pip install eikon ==1.1.2) and let me know how you get on.

  • Hi,

    Could you also detail which version of Python you're using ?

  • I'm using:

    - eikon==1.1.5
    - Python 3.8.1
  • @c.aydemir have you had a chance to try with eikon v1.1.2? thx

  • Yes, but it doesn't work.

    This is the error that I get:

    Error on checking port 9000 : HTTPConnectionPool(host='localhost', port=9000): Read timed out. (read timeout=20.0)
    Error on checking port 9000 : HTTPConnectionPool(host='localhost', port=9000): Read timed out. (read timeout=20.0)
    Error on checking port 36036 : HTTPConnectionPool(host='localhost', port=36036): Max retries exceeded with url: /api/v1/data (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0E574460>: Failed to establish 
    a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
    Error on handshake port None : Failed to parse: http://localhost:None/api/handshake
    2020-09-03 11:52:00,037 P[33520] [Thread-1 29232] Error: no proxy address identified.
    Check if Eikon Desktop or Eikon API Proxy is running.
    2020-09-03 11:52:00,038 P[33520] [Thread-1 29232] Port number was not identified, cannot send any request
    2020-09-03 11:52:00,038 P[33520] [Thread-1 29232] Port number was not identified.


  • @c.aydemir Can i ask again what version of Eikon you are running? thx

  • Off course: eikon desktop 4.0.52 (4.0.52055)

    And this is my pipfile

    [[source]]
    name = "pypi"
    url = "https://pypi.org/simple"
    verify_ssl = true
    [dev-packages]
    [packages]
    django = "~=3.1.0"
    psycopg2-binary = "==2.8.5"
    django-crispy-forms = "~=1.9.2"
    django-allauth = "~=0.42.0"
    environs = {extras = ["django"],version = "==8.0.0"}
    django-model-utils = "~=4.0.0"
    ipykernel = "*"
    eikon = "==1.1.2"
    [requires]
    python_version = "3.8"


  • @c.aydemir thx - can you also try rolling back Eikon to the previous version and try that. Apols thats what I can suggest at the moment in terms of quick fix. Otherwise you will have to open a Service Ticket and ask for an escalation quoting this thread as this is a product issue.

  • How can I roll back the Eikon version?

  • @c.aydemir Actually we think the issue might be Python 3.8 - can you try with Python 3.7 - sorry for the inconvenience just trying to help you. We are working on a fix for 3.8.

  • I did: I have created new environment in anaconda python 3.7.9 and eikon api 1.1.2 and unfortunately it doesn't work.

    This is the error that I get:

    Error on checking port 9000 : HTTPConnectionPool(host='localhost', port=9000): Read timed out. (read timeout=20.0) 
    Error on checking port 9000 : HTTPConnectionPool(host='localhost', port=9000): Read timed out. (read timeout=20.0)
    Error on checking port 36036 : HTTPConnectionPool(host='localhost', port=36036): Max retries exceeded with url: /api/v1/data (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00000268313EE548>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
    Error on handshake port None : Failed to parse: http://localhost:None/api/handshake
    2020-09-04 15:32:15,231 P[20996] [MainThread 1108] Error: no proxy address identified. Check if Eikon Desktop or Eikon API Proxy is running.
    2020-09-04 15:32:15,232 P[20996] [MainThread 1108] Port number was not identified, cannot send any request
    2020-09-04 15:32:15,233 P[20996] [MainThread 1108] Port number was not identified. Check if Eikon Desktop or Eikon API Proxy is running.
  • Hi,

    eikon 1.1.6.post1 was just released and is available on pypi.org.

    You can update with "pip install --upgrade --no-cache-dir eikon"

    It should fix issues with Python 3.8


  • Thank you Alex and all! After updating the Eikon API to v1.1.6 the download works fine.

    Once again thank you all for your support.


  • The combination Python 3.8.5, Python library v1.1.6.post2 and Eikon desktop v4.0.52 is not working for me.

  • Hi,

    One dependency introduced a breaking change last Monday: httpx 0.15

    If you have this version, a workaounr is to downgrade to 0.14.2 (pip install httpx==0.14.2)

    An eikon 1.1.6.post3 will published soon to fix it

  • Hi @pierre.faurel downgrading to httpx v0.14.2 solved my issue. (pip install httpx==0.14.2)