Eikon Python API Error code 503

Hi,

I tried the following code:

import eikon as ek

ek.set_app_key(my_app_id)

ek.get_data(instruments = 'BD4LHL9', fields = 'TR.RIC')

And it returned me the following error. Any ideas how I can fix this?


EikonError: Error code 503 | Server Error: <HTML><HEAD>

<TITLE>Network Error</TITLE>

</HEAD>

<BODY>

<FONT face="Helvetica">

<big><strong></strong></big><BR>

</FONT>

<blockquote>

<TABLE border=0 cellPadding=1 width="80%">

<TR><TD>

<FONT face="Helvetica">

<big>Network Error (tcp_error)</big>

<BR>

<BR>

</FONT>

</TD></TR>

<TR><TD>

<FONT face="Helvetica">

A communication error occurred: ""

</FONT>

</TD></TR>

<TR><TD>

<FONT face="Helvetica">

The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.

</FONT>

</TD></TR>

<TR><TD>

<FONT face="Helvetica" SIZE=2>

<BR>

For assistance, contact your network support team.

</FONT>

</TD></TR>

</TABLE>

</blockquote>

</FONT>

</BODY></HTML>

Best Answer

  • RL
    RL
    Answer ✓

    Apologies for the late reply as I happened to be away for the past week.

    I got the following when I typed 'ping 10.190.168.137':

    Pinging 10.190.168.137 with 32 bytes of data:

    Reply from 10.190.168.137: bytes=32 time<1ms TTL=128

    Reply from 10.190.168.137: bytes=32 time<1ms TTL=128

    Reply from 10.190.168.137: bytes=32 time<1ms TTL=128

    Reply from 10.190.168.137: bytes=32 time<1ms TTL=128


    Ping statistics for 10.190.168.137:

    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

    Approximate round trip times in milli-seconds:

    Minimum = 0ms, Maximum = 0ms, Average = 0ms


    Not too sure with the proxy settings at my company, I'll check with my IT department first.

Answers

  • Hi,

    Could you check if you have following dependency versions that cause issue in current version :

    • httpx 0.15.x or 0.16.x => need to downgrade to 0.14.3 (pip install httpx==0.14.3)
    • nest-asyncio 1.4.x => need to downgrade to 1.3.3 (pip install nest-asyncio==1.3.3)

    (it supposes that you have eikon 1.1.6.post3)

  • Hi @""pierre.faurel,

    I have downgraded both packages and am using eikon 1.1.6.post3. The code still does not work.

    It used to work fine till recently.

  • Hi,

    Sorry that didn't fix your issue.

    Could you provide followed information ?

    1. Eikon Desktop version
    2. 'pip list' result

    If we don't identify the cause, the next step will be to activate the log in your script to have a full trace.

  • Hi Pierre,

    Below is the requested info:

    1. Eikon Desktop version: 4.0.52 (4.0.52055)

    2. pip list result:


    Package Version

    ---------------------------------- -------------------

    alabaster 0.7.12

    anaconda-client 1.7.2

    anaconda-navigator 1.9.12

    anaconda-project 0.8.3

    appdirs 1.4.4

    argh 0.26.2

    asn1crypto 1.3.0

    astroid 2.3.3

    astropy 4.0

    atomicwrites 1.3.0

    attrs 19.3.0

    autopep8 1.4.4

    azure-cosmos 3.1.2

    Babel 2.8.0

    backcall 0.1.0

    backports.functools-lru-cache 1.6.1

    backports.shutil-get-terminal-size 1.0.0

    backports.tempfile 1.0

    backports.weakref 1.0.post1

    bcrypt 3.1.7

    beautifulsoup4 4.8.2

    bitarray 1.2.1

    bkcharts 0.2

    bleach 3.1.0

    blpapi 3.14.0

    bokeh 1.4.0

    boto 2.49.0

    Bottleneck 1.3.2

    certifi 2019.11.28

    cffi 1.14.0

    chardet 3.0.4

    Click 7.0

    cloudpickle 1.3.0

    clyent 1.2.2

    colorama 0.4.3

    comtypes 1.1.7

    conda 4.8.3

    conda-build 3.18.11

    conda-package-handling 1.6.0

    conda-verify 3.4.2

    contextlib2 0.6.0.post1

    cryptography 2.8

    cvxopt 1.2.0

    cycler 0.10.0

    Cython 0.29.15

    cytoolz 0.10.1

    dask 2.11.0

    DateTime 4.3

    decorator 4.4.1

    defusedxml 0.6.0

    deprecation 2.1.0

    diff-match-patch 20181111

    distributed 2.11.0

    docutils 0.16

    eikon 1.1.6.post3

    entrypoints 0.3

    et-xmlfile 1.0.1

    eventemitter 0.2.0

    fastcache 1.1.0

    filelock 3.0.12

    flake8 3.7.9

    Flask 1.1.1

    fsspec 0.6.2

    future 0.18.2

    gevent 1.4.0

    glob2 0.7

    greenlet 0.4.15

    h11 0.9.0

    h2 3.2.0

    h5py 2.10.0

    HeapDict 1.0.1

    hpack 3.0.0

    html5lib 1.0.1

    http3 0.6.7

    httpcore 0.10.2

    httpx 0.14.3

    hyperframe 5.2.0

    hypothesis 5.5.4

    idna 2.8

    imageio 2.6.1

    imagesize 1.2.0

    importlib-metadata 1.5.0

    intervaltree 3.0.2

    ipykernel 5.1.4

    ipython 7.12.0

    ipython-genutils 0.2.0

    ipywidgets 7.5.1

    isort 4.3.21

    itsdangerous 1.1.0

    jdcal 1.4.1

    jedi 0.14.1

    Jinja2 2.11.1

    joblib 0.14.1

    json5 0.9.1

    jsonschema 3.2.0

    jupyter 1.0.0

    jupyter-client 5.3.4

    jupyter-console 6.1.0

    jupyter-core 4.6.1

    jupyterlab 1.2.6

    jupyterlab-server 1.0.6

    keyring 21.1.0

    kiwisolver 1.1.0

    lazy-object-proxy 1.4.3

    libarchive-c 2.8

    llvmlite 0.31.0

    locket 0.2.0

    lxml 4.5.0

    MarkupSafe 1.1.1

    matplotlib 3.1.3

    mccabe 0.6.1

    menuinst 1.4.16

    mistune 0.8.4

    mkl-fft 1.0.15

    mkl-random 1.1.0

    mkl-service 2.3.0

    mock 4.0.1

    more-itertools 8.2.0

    MouseInfo 0.1.3

    mpmath 1.1.0

    msgpack 0.6.1

    multipledispatch 0.6.0

    navigator-updater 0.2.1

    nbconvert 5.6.1

    nbformat 5.0.4

    nest-asyncio 1.3.3

    networkx 2.4

    nltk 3.4.5

    nose 1.3.7

    notebook 6.0.3

    numba 0.48.0

    numexpr 2.7.1

    numpy 1.18.1

    numpydoc 0.9.2

    olefile 0.46

    openpyxl 3.0.3

    packaging 20.1

    pandas 1.0.1

    pandocfilters 1.4.2

    paramiko 2.7.1

    parso 0.5.2

    partd 1.1.0

    path 13.1.0

    pathlib2 2.3.5

    pathtools 0.1.2

    patsy 0.5.1

    pep8 1.7.1

    pexpect 4.8.0

    pickleshare 0.7.5

    Pillow 7.0.0

    pip 20.0.2

    pkginfo 1.5.0.1

    pluggy 0.13.1

    ply 3.11

    prometheus-client 0.7.1

    prompt-toolkit 3.0.3

    psutil 5.6.7

    py 1.8.1

    PyAutoGUI 0.9.50

    pycodestyle 2.5.0

    pycosat 0.6.3

    pycparser 2.19

    pycrypto 2.6.1

    pycurl 7.43.0.5

    pydocstyle 4.0.1

    pyflakes 2.1.1

    PyGetWindow 0.0.8

    Pygments 2.5.2

    pylint 2.4.4

    PyMsgBox 1.0.8

    PyNaCl 1.3.0

    pyodbc 4.0.0-unsupported

    pyOpenSSL 19.1.0

    pyparsing 2.4.6

    pyperclip 1.8.0

    pyreadline 2.1

    PyRect 0.1.4

    pyrsistent 0.15.7

    PyScreeze 0.1.26

    PySocks 1.7.1

    pytest 5.3.5

    pytest-arraydiff 0.3

    pytest-astropy 0.8.0

    pytest-astropy-header 0.1.2

    pytest-doctestplus 0.5.0

    pytest-openfiles 0.4.0

    pytest-remotedata 0.3.2

    python-configuration 0.8.1

    python-dateutil 2.8.1

    python-jsonrpc-server 0.3.4

    python-language-server 0.31.7

    PyTweening 1.0.3

    pytz 2019.3

    PyWavelets 1.1.1

    pywin32 227

    pywin32-ctypes 0.2.0

    pywinpty 0.5.7

    PyYAML 5.3

    pyzmq 18.1.1

    QDarkStyle 2.8

    QtAwesome 0.6.1

    qtconsole 4.6.0

    QtPy 1.9.0

    refinitiv-dataplatform 1.0.0a6

    requests 2.22.0

    requests-async 0.6.2

    rfc3986 1.4.0

    rope 0.16.0

    Rtree 0.9.3

    ruamel-yaml 0.15.87

    scikit-image 0.16.2

    scikit-learn 0.22.1

    scipy 1.4.1

    seaborn 0.10.0

    Send2Trash 1.5.0

    setuptools 45.2.0.post20200210

    simplegeneric 0.8.1

    singledispatch 3.4.0.3

    six 1.14.0

    sniffio 1.1.0

    snowballstemmer 2.0.0

    sortedcollections 1.1.2

    sortedcontainers 2.1.0

    soupsieve 1.9.5

    Sphinx 2.4.0

    sphinxcontrib-applehelp 1.0.1

    sphinxcontrib-devhelp 1.0.1

    sphinxcontrib-htmlhelp 1.0.2

    sphinxcontrib-jsmath 1.0.1

    sphinxcontrib-qthelp 1.0.2

    sphinxcontrib-serializinghtml 1.1.3

    sphinxcontrib-websupport 1.2.0

    spyder 4.0.1

    spyder-kernels 1.8.1

    SQLAlchemy 1.3.13

    statsmodels 0.11.0

    sympy 1.5.1

    tables 3.6.1

    tblib 1.6.0

    terminado 0.8.3

    testpath 0.4.4

    toolz 0.10.0

    tornado 6.0.3

    tqdm 4.42.1

    traitlets 4.3.3

    ujson 1.35

    unicodecsv 0.14.1

    urllib3 1.25.8

    watchdog 0.10.2

    wcwidth 0.1.8

    webencodings 0.5.1

    websocket-client 0.57.0

    Werkzeug 1.0.0

    wheel 0.34.2

    widgetsnbextension 3.5.1

    win-inet-pton 1.1.0

    win-unicode-console 0.5

    wincertstore 0.2

    wrapt 1.11.2

    xlrd 1.2.0

    XlsxWriter 1.2.7

    xlwings 0.17.1

    xlwt 1.3.0

    xmltodict 0.12.0

    yapf 0.28.0

    zict 1.0.0

    zipp 2.2.0

    zope.interface 5.1.2

  • Hi,

    All seems to be correct in your python env.

    1. Could you clean Eikon cache then restart Eikon and retry to run python script ?
    2. Another possible root cause : do you have any proxy/firewall that could change recently and block access to Refinitiv servers ?
      To check this, could you open https://apidocs.refinitiv.com/Apps/ApiDocs (it will request your Eikon login/pwd)


  • Hi Pierre,

    1. I clean the cache, restarted Eikon and reran the python script. The same issue still persists.
    2. I could open the link you provided. In the API Playground I could GET https://api.refinitiv.com/data/historical-pricing/v1/views/events/VOD.L and retrieve a response and data.

    Despite the above the python API still does not work.


  • Hi,

    To investigate deeper, could you activate the log in your script to have a full trace ?

    • add environment variable: HTTPX_LOG_LEVEL=trace
    • add ek.set_log_level(1) in your script

    then run your script and check errors in output.

  • Hi Pierre,

    Here is the output towards the end where the 503 response is seen:


    2020-10-16 17:08:36,118 P[34136] [MainThread 16708] send_request method=b'GET' url=(b'http', b'PROXY', 8080, b'http://10.190.168.137/') headers=[(b'host', b'10.190.168.137'), (b'user-agent', b'python-httpx/0.14.3'), (b'accept', b'*/*'), (b'accept-encoding', b'gzip, deflate'), (b'connection', b'keep-alive'), (b'content-type', b'application/json'), (b'x-tr-applicationid', b'APP_ID')]

    TRACE [2020-10-16 17:08:36] httpcore._async.http11 - send_data=Data(<0 bytes>)

    2020-10-16 17:08:36,122 P[34136] [MainThread 16708] send_data=Data(<0 bytes>)

    DEBUG [2020-10-16 17:09:33] httpx._client - HTTP Request: GET http://10.190.168.137 "HTTP/1.1 503 Service Unavailable"

    2020-10-16 17:09:33,256 P[34136] [MainThread 16708] HTTP Request: GET http://10.190.168.137 "HTTP/1.1 503 Service Unavailable"

    TRACE [2020-10-16 17:09:33] httpcore._async.http11 - receive_event=Data(<768 bytes>)

    2020-10-16 17:09:33,260 P[34136] [MainThread 16708] receive_event=Data(<768 bytes>)

    TRACE [2020-10-16 17:09:33] httpcore._async.http11 - receive_event=EndOfMessage(headers=[])

    2020-10-16 17:09:33,260 P[34136] [MainThread 16708] receive_event=EndOfMessage(headers=[])

    TRACE [2020-10-16 17:09:33] httpcore._async.http11 - response_closed our_state=MUST_CLOSE their_state=MUST_CLOSE

    2020-10-16 17:09:33,264 P[34136] [MainThread 16708] response_closed our_state=MUST_CLOSE their_state=MUST_CLOSE

    TRACE [2020-10-16 17:09:33] httpcore._async.connection_pool - removing connection from pool=<AsyncHTTPConnection http_version=HTTP/1.1 state=5>

    2020-10-16 17:09:33,264 P[34136] [MainThread 16708] removing connection from pool=<AsyncHTTPConnection http_version=HTTP/1.1 state=5>

    2020-10-16 17:09:33,268 P[34136] [MainThread 16708] HTTP request response 503: <HTML><HEAD>

  • Hi,

    Do you know where comes from the 10.190.168.137 IP address ?
    Do you have any response on "ping 10.190.168.137" command (I have time out on my side) ?

    Could you check if you have any proxy/DNS that manages refinitiv server address with fixed IP address ?