New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
50 1 1 6

[OMMSTREAMING_PRICING_0.0] on_ws_error: Exception: [Errno 111] Connection refused

Trying to get data for anything gets me the above error message.

my code:

df = rd.get_data(
    universe="aUSSPDIVY"
)
print(df)


it runs forver, doesnt break or so, just keeps printing the same error row after row after row:

1710741633376.png

when i kill it, i get the following trace:

File ~/path/to/.venv/lib/python3.11/site-packages/refinitiv/data/content/_universe_streams.py:445, in _UniverseStreams.open_streams(self, streams)
    443     futures.append(executor.submit(universe_stream.open, with_updates=self._with_updates))
--> 445 wait(futures)
    446 raise_err_if_exists(futures)

File /usr/lib/python3.11/concurrent/futures/_base.py:305, in wait(fs, timeout, return_when)
    303     waiter = _create_and_install_waiters(fs, return_when)
--> 305 waiter.event.wait(timeout)
    306 for f in fs:

File /usr/lib/python3.11/threading.py:629, in Event.wait(self, timeout)
    628 if not signaled:
--> 629     signaled = self._cond.wait(timeout)
    630 return signaled

File /usr/lib/python3.11/threading.py:327, in Condition.wait(self, timeout)
    326 if timeout is None:
--> 327     waiter.acquire()
    328     gotit = True


what do i do wrong?

workspace#technologypython apidata
1710741633376.png (22.8 KiB)
icon clock
10 |1500

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

Upvotes
Accepted
50 1 1 6

ok, i found a solution. it needs the obvious port 9060 but also port 9001 and / or 9002 to be open as well.

that way it somewhat works. somewhat because i get an error

An error occurred while requesting URL('http://localhost:9000/api/status').
    ConnectError('[Errno 111] Connection refused')

so, it still seems to try to connect to port 9000 for some reason.

however, it continues and i get a result for both the appl and usjob example


with that said, there also are some dprecation warnings you might want to take care of:

/path/to/.venv/lib/python3.11/site-packages/refinitiv/data/_access_layer/_data_provider.py:317:FutureWarning: errors='ignore' is deprecated and will raise in a future version. Use to_datetime without passing `errors` and catch exceptions explicitly instead
/path/to/.venv/lib/python3.11/site-packages/refinitiv/data/_tools/_dataframe.py:177:FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`


thanks
Andreas

icon clock
10 |1500

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

Upvotes
19.2k 86 39 63

Hi @andreas01

I am unable to replicate your behavior. Looking at your request, you are not providing any fields, so it's unclear what you expect to be returned.

For example, here is a basic request using the 'get_data()' function:

1710792634221.png

I would try that first. I did try the instrument you are requesting for but there doesn't appear to be any data associated with it - you may need to follow up with the helpdesk (Help & Support - F1) within the desktop and they can bring in a content specialist.

I would suggest you try another instrument just to be sure you are retrieving data.


1710792634221.png (10.2 KiB)
icon clock
10 |1500

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

Upvotes
50 1 1 6
I am unable to replicate your behavior. Looking at your request, you are not providing any fields, so it's unclear what you expect to be returned.


Hi @nick.zincone i was following the documentation under https://cdn.refinitiv.com/public/rd-lib-python-doc/1.0.0.0/book/en/sections/access-layer/access/get-data-function.html which says:

The following example demonstrates how to request all fields using the instrument name only:

import refinitiv.data as rd

# session creation
rd.open_session()

# getting all realtime pricing data
df = rd.get_data(universe="USD=")

print(df.to_markdown())

# close session
rd.close_session()


so, it should get all fields, at least according to "your" docs.


your example above returns data, but when trying to get data for economic indicators it still doesnt work, even with configured fields. i tried

df = rd.get_data(
    universe="USJOB=ECI",
    fields=["ECI_ACT_DT", "ACT_VAL_NS", "NDOR_1", "RELEVANCE", "ECON_ACT", "ECON_PRIOR", "PRIOR_REV"]
)

print(df)


which resulted in the same issue. the fields available are here:

1710833518693.png


so, i guess that is an issue with the API? i dont know but i need to get the data.

thanks
Andreas


1710833518693.png (221.0 KiB)
icon clock
10 |1500

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

Upvotes
19.2k 86 39 63

Hi @andreas01

Thanks for pointing out that specific documentation. I can see the get_data() does include the ability to access all realtime fields only. The get_data() function provides access to a number of different data elements/sources such as fundamental and reference data, historical and realtime. In the case where you don't specify the fields in your request, the function will only access realtime fields such as "BID", "ASK" and CF_ fields. "CF" standing for Consolidated Field which is a derived field from the realtime data.

For example, when using get_data() like this:

1710855454184.png

Regarding USJOB=ECI, you can access data via the API:
1710855914524.png

But the economic indicators are not available for this instrument. I could not see them within DIB. If you believe the data is missing, you can follow up with the helpdesk or access the "Get Help & Support - F1" within the desktop and they will bring in a content specialist.


1710855454184.png (11.6 KiB)
1710855914524.png (7.9 KiB)
icon clock
10 |1500

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

Upvotes
50 1 1 6

@nick.zincone i dont understand. the fields i was trying to download were extracted from the DIB(?) and i was told in another topic here, that those were realtime fields.

now i am confused.

you saw my screenshot with the DIB for USJOB=ECI?

icon clock
10 |1500

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

Upvotes
19.2k 86 39 63

Hi @andreas01

The DIB provides a combination of realtime, fundamental and reference and timeseries data.

When I display the list of realtime fields for USJOB-ECI like this:

values = rd.get_data(
    universe="USJOB=ECI"
)
values.transpose()


I can see fields that are related to economic indicators:

1710859677492.png

You can get a list of the realtime fields within the RDMDictionary file reference. For example, I did find a few fields related to economic indicators:

1710860520504.png

However, the best resource to resolve content related questions is the helpdesk or within the desktop (Help - F1).


1710859677492.png (7.9 KiB)
1710860520504.png (11.5 KiB)
icon clock
10 |1500

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

Upvotes
50 1 1 6

weird, i just posted a response but it disappeared..?

anyway, lets try that again:

@nick.zincone all that does not work for me, except a test call for some aapl data:

1710865454432.png


maybe its an issue with the


Package                   Version
------------------------- ---------------
alembic                   1.13.1
anyio                     4.3.0
appdirs                   1.4.4
APScheduler               3.10.4
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
arrow                     1.3.0
asttokens                 2.4.1
async-lru                 2.0.4
attrs                     23.2.0
Babel                     2.14.0
base58                    2.1.1
beautifulsoup4            4.12.3
black                     24.2.0
bleach                    6.1.0
cachetools                4.2.4
certifi                   2024.2.2
cffi                      1.16.0
chardet                   3.0.4
charset-normalizer        3.3.2
click                     8.1.7
comm                      0.2.1
construct                 2.10.68
construct-typing          0.5.6
countryinfo               0.1.2
DateTime                  5.4
debugpy                   1.8.1
decorator                 5.1.1
defusedxml                0.7.1
deprecation               2.1.0
eikon                     1.1.18
eventemitter              0.2.0
executing                 2.0.1
fastjsonschema            2.19.1
fqdn                      1.5.1
greenlet                  3.0.3
h11                       0.14.0
h2                        3.2.0
hpack                     3.0.0
httpcore                  1.0.4
httpx                     0.27.0
hyperframe                5.2.0
idna                      2.10
ipykernel                 6.29.3
ipython                   8.22.2
ipywidgets                8.1.2
isoduration               20.11.0
jedi                      0.19.1
Jinja2                    3.1.3
json5                     0.9.22
jsonalias                 0.1.1
jsonpointer               2.4
jsonschema                4.21.1
jsonschema-specifications 2023.12.1
jupyter                   1.0.0
jupyter_client            8.6.0
jupyter-console           6.6.3
jupyter_core              5.7.1
jupyter-events            0.9.0
jupyter-lsp               2.2.4
jupyter_server            2.13.0
jupyter_server_terminals  0.5.2
jupyterlab                4.1.4
jupyterlab_pygments       0.3.0
jupyterlab_server         2.25.3
jupyterlab_widgets        3.0.10
Mako                      1.3.2
MarkupSafe                2.1.5
matplotlib-inline         0.1.6
mistune                   3.0.2
mypy-extensions           1.0.0
nbclient                  0.9.0
nbconvert                 7.16.2
nbformat                  5.9.2
nest-asyncio              1.6.0
notebook                  7.1.1
notebook_shim             0.2.4
numpy                     1.26.4
overrides                 7.7.0
packaging                 23.2
pandas                    2.2.1
pandocfilters             1.5.1
parso                     0.8.3
pathspec                  0.12.1
pexpect                   4.9.0
pika                      1.3.2
pika-stubs                0.1.3
pip                       24.0
platformdirs              4.2.0
prometheus_client         0.20.0
prompt-toolkit            3.0.43
psutil                    5.9.8
psycopg2                  2.9.9
ptyprocess                0.7.0
pure-eval                 0.2.2
pycountry                 23.12.11
pycparser                 2.21
pyee                      11.1.0
Pygments                  2.17.2
pyhumps                   3.8.0
PyMySQL                   1.1.0
python-configuration      0.10.0
python-dateutil           2.9.0.post0
python-dotenv             1.0.1
python-json-logger        2.0.7
pytz                      2024.1
PyYAML                    6.0.1
pyzmq                     25.1.2
qtconsole                 5.5.1
QtPy                      2.4.1
referencing               0.33.0
refinitiv-data            1.6.0
refinitiv-dataplatform    1.0.0a21
requests                  2.31.0
rfc3339-validator         0.1.4
rfc3986                   1.5.0
rfc3986-validator         0.1.1
rpds-py                   0.18.0
scipy                     1.12.0
Send2Trash                1.8.2
setuptools                69.0.3
simplejson                3.19.2
six                       1.16.0
sniffio                   1.3.1
solana                    0.32.0
solders                   0.20.0
soupsieve                 2.5
SQLAlchemy                2.0.28
stack-data                0.6.3
tenacity                  8.2.3
terminado                 0.18.0
tinycss2                  1.2.1
tornado                   6.4
traitlets                 5.14.1
types-cachetools          4.2.10
types-python-dateutil     2.8.19.20240311
typing_extensions         4.10.0
tzdata                    2024.1
tzlocal                   5.2
uri-template              1.3.0
urllib3                   2.2.1
validators                0.22.0
watchdog                  2.3.1
wcwidth                   0.2.13
webcolors                 1.13
webencodings              0.5.1
websocket-client          1.7.0
websockets                11.0.3
wheel                     0.42.0
widgetsnbextension        4.0.10
zope.interface            6.2


or, is this maybe running on a different port? maybe its a firewall issue? right now, accordung to the .portInUse file from Eikon (maybe its important: i am on Eikon, NOT Workspace), its running at Port 9060. is there maybe another port it wants to connect to?


thanks
Andreas


1710865454432.png (71.2 KiB)
icon clock
10 |1500

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

Upvotes
19.2k 86 39 63

Hi @andreas01

I've reached out to you the development team to get a better understanding why you are unable to connect to streaming services.

While we wait, can you try to enable logs so we can see what is happening:

Before you open your session, do this:

rd.get_config()["logs.transports.console.enabled"] = True

You should see additional output. Specifically, when you try to retrieve data using your expression:

rd.get_data(
    universe="USJOB=ECI"
)

You should see debug output that tries to connect into a streaming server. Something similar to this:

[2024-03-19T17:29:16.032588-04:00] - [DEBUG] - [sessions.desktop.codebook.0] - [21680] | OpenUniverseStreams-Thread_0
HTTP Request id 2
url = http://localhost:9060/api/rdp/streaming/pricing/v1/
method = GET
headers = {'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBcGlWZXJzaW9uI...', 'x-tr-applicationid': 'f6...'}

[2024-03-19T17:29:16.033589-04:00] - [DEBUG] - [RetryTransportBase] - [21680] | OpenUniverseStreams-Thread_0
Sending request to http://localhost:9060/api/rdp/streaming/pricing/v1/


icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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