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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvote
Accepted
36 0 0 3

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

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonport-number
issueportnumber.png (58.6 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
Accepted
36 0 0 3

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.

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
18k 21 12 20

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?

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.

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

Upvotes
4.6k 26 7 22

@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?

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.

@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

Upvotes
36 0 0 3

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.

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