Eikon API port number

Hi,

Stated in the doc is the fact that the port Eikon is listening to should be detected automatically.

I try to connect to a running instance of Eikon on one machine but get an error:

2019-04-26 11:32:39,484 [36444] ERROR pyeikon: Error on checking port 9000 : HTTPConnectionPool(host='localhost', port=9000): Max retries exceeded with url: /api/v1/data (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00000000095818D0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')) 20

From the error message I take that it is trying to read from port 9000. The application seems to be listening on 9001 (sse attached).

I corrected my code to try to listen to this port:

def session_scope(id='xxxx',close_on_completion=False, port = None):
"""Provide a transactional scope around a series of operations."""session = ek
try:
if port:
session.set_port_number(port)
session.set_app_key(id)
yield session
except Exception as err:
session.stop()
raise ExcTbFin_Connection('Error connecting to Reuters with api id: {}'.format(id)) from err
finally:
if close_on_completion:
session.stop()

I run it with port 9001 and check that the set_port_number line is executed.

Any help from Refinitiv on this ?

Best

Cyril Godart

issueportnumber.png

Best Answer

  • The file exists and the value is 9000.

    I investigated further in the light of your explanation.

    Here is what is happening. Through our corporate settings, %APPDATA% is set in the Roaming profile: C:\Users\xxxx\AppData\Roaming\Thomson Reuters\Eikon API Proxy\.portInUse. That means the first machine writes to the file. When the second machine looks for the file, it finds it whith value 9000. It then sets to listen on another port when 9000 is actually free.

    This is typically a border case but there is nothing nefarious to it: t is typically where the set_port_number() is justified.

Answers

  • Hi @cyril.godart

    If port 9000 is not available, Eikon will use the next available port.

    In this case, it is 9000+1 = 9001.

    Do you know if the port 9000/tcp is occupied on your machine?

  • Hi,

    Interesting question. As far as I can see, no.

    But I am running Eikon on two machines. On the other machine, Eikon listens on 9000 and

    I have no error running the application. I assumed that the port attribution were global

    per user.

    Best

  • @cyril.godart

    The file ```%APPDATA%\Thomson Reuters\Eikon API Proxy\.portInUse``` contains the port number that the API is listening on. In fact, the library should attempt to read in under the hood, and then try to access the default port.

    Could you confirm that this path exists? If yes, what is the value in the file?

  • Sorry, it seems that one of my answer has not made it as I have been logged out.

    I am using two machines. I usually have a machine dedicated to Reuters and other applications. Eikon runs there by default.

    So this morning I am using my main machine -- which happens to be also my development one -- to check a new code.

    So I have two instances of Reuters running on two machines. See the previous post to understand the impact some corporate settings may have.

  • Zhenya Kovalyov

    I tired to connect Eikon Api and got the same port 9000 error, and I found there was no folder named Eikon API Proxy and no file .portInUse. Could you kindly help on this

  • Do you know which Eikon API python lib version is able to check all ports ?


    It seems 1.1.2 is not able to check port like 9001 but 1.1.16 can. Do you have the release notes of Eikon python lib versions ?


    Thanks per advance

  • Hi @alexandre.de-vallavieille1 ,

    As far as I know, there are no current updated release notes for each version of Eikon Data API. You may raise a ticket via MyRefinitiv asking the helpdesk to escalate to the Product team to ask if the release notes exist and are updated or consider updating the notes.

    I hope this helps and please let me know in case you have any further questions.

    However, as the closed question (one with an accepted answer) won't be monitored by moderators on this forum so you might not get a response regarding your question. hence, please create a new question instead of commenting on the closed question.