Getting Errors - 'Data': 'Suspect', 'Stream': 'Open', 'Code': 'NoResources', 'Text': 'Not connected

suchit_1
suchit_1 Newcomer
edited May 8 in Eikon Data APIs

Hi All ,

Im running Eikon Api codes in which I'm continuously streaming prices ….i have been running these codes for a very long time ..but for past few days im repeatedly getting below errors:

Received status message:
{'Data': 'Suspect', 'Stream': 'Open', 'Code': 'NoResources', 'Text': 'Not connected.'}

now i run long market sessions like nifty sessions ..but this error is occuring in between randomly and after that we are no longer able to fetch data …

as the Code mentions NoResources….does it indicate that platform is not able to complete the requests …if yes , please elaborate the reasons for the same .

kindly assist

Answers

  • Gurpreet
    Gurpreet admin

    Hello @suchit_1

    Can you please share the snippet of code that you are using? Eikon API is not going to be supported and I would recommend that you migrate it to the new LD Library.

    Here is an example of how to get streaming data using library.

    For your existing error - "Not connected" implies that the network connection to the server has been lost.

  • suchit_1
    suchit_1 Newcomer

    Hi ,

    For fetching prices im using below code :

    streaming_prices = ek.StreamingPrices(
    instruments = assetsRics,

    fields = reqFields,

    on_refresh = lambda streaming_price, instrument_name, fields :
    display_refreshed_fields(streaming_price, instrument_name, fields),

    on_update = lambda streaming_price, instrument_name, fields :
    display_updated_fields(streaming_price, instrument_name, fields)
    )

    streaming_prices.open()

    while(len(actualAssetslist) > 0):
    asyncio.get_event_loop().run_until_complete(asyncio.sleep(1))

    streaming_prices.close()

    I have 2 question s:

    First , I wanted to confirm here it says ..'Code': 'NoResources'….what does this mean ?

    Second , ld.open_pricing_stream → will i just have to call this function once and it will open the feed channel from where i'll be getting continuous prices updates as soon as available ?

    Thanks

    Sumit

  • Gurpreet
    Gurpreet admin

    No resources can be due to variety of reasons. In your case - the status text - Not connected is why you are getting this message.

    Yes, there are examples of both asynchronous callback in the Github. where the application code will be receiving the updates in real time.

  • suchit_1
    suchit_1 Newcomer

    Hi ,

    I need a clear answer to this …as this issue is occuring repeatedly …so i need to know what steps can be taken to avoid this ….is the price streaming mechanism im using …is that causing issue ..or some thing else which is causing this issue …

    Query - 1 : i need to know the exact reason why my connection to server is breaking again and again …so accordingly i can take steps ..

    Query - 2: also need to know in case my server connection is lost , additionally what i can do in my code to re-establish it .

    Please answer specifically to these 2 queries

    Thanks

    Sumit

  • suchit_1
    suchit_1 Newcomer

    also in the document , it is mentioned to use snapshot request also , but im just using the library in following steps :

    step 1 : Open the stream and register the callback function :

    stream = ld.open_pricing_stream(
    universe=['GBP=', 'EUR=', 'JPY='],
    fields=['BID', 'ASK'],
    on_data=display_data
    )

    step 2 : then defining the display_data function as below :

    def display_data(data, instrument, stream):
    clear_output(wait=True)
    current_time = datetime.datetime.now().time()
    print(current_time, "- Data received for", instrument)
    display(data)

    with these 2 steps i'll be getting the prices updates in a live feed right ?

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @suchit_1

    You can use the EX-2.02.04-Pricing-StreamingEvents.ipynb example.

    The API retrieves data through the API Proxy which is a component of Workspace.

    image.png

    I can replicate this message if I cut a connection on the Workspace machine.

    14:42:25.345362 - Status received for EUR= : {'Domain': 'MarketPrice', 'State': {'Data': 'Suspect', 'Stream': 'Open', 'Code': 'NoResources', 'Text': 'Not connected.'}, 'Type': 'Status', 'ID': 5, 'Key': {'Name': 'EUR=', 'NameType': 'Ric', 'Service': 'Q'}}
    
    14:42:25.347320 - Status received for GBP= : {'Domain': 'MarketPrice', 'State': {'Data': 'Suspect', 'Stream': 'Open', 'Code': 'NoResources', 'Text': 'Not connected.'}, 'Type': 'Status', 'ID': 6, 'Key': {'Name': 'GBP=', 'NameType': 'Ric', 'Service': 'Q'}}
    
    14:42:25.348320 - Status received for JPY= : {'Domain': 'MarketPrice', 'State': {'Data': 'Suspect', 'Stream': 'Open', 'Code': 'NoResources', 'Text': 'Not connected.'}, 'Type': 'Status', 'ID': 7, 'Key': {'Name': 'JPY=', 'NameType': 'Ric', 'Service': 'Q'}}
    
    14:42:25.350320 - Status received for CAD= : {'Domain': 'MarketPrice', 'State': {'Data': 'Suspect', 'Stream': 'Open', 'Code': 'NoResources', 'Text': 'Not connected.'}, 'Type': 'Status', 'ID': 8, 'Key': {'Name': 'CAD=', 'NameType': 'Ric', 'Service': 'Q'}}
    

    Therefore, it could be a connection problem between Workspace and Real-Time network.

    Then, if Workspace can reconnect to the server, the library can continue to retrieve data properly.

    image.png

    For Workspace connection issues, you need to contact the helpdesk team via MyAccount to investigate what the problem is.

  • suchit_1
    suchit_1 Newcomer

    Hi ,

    When closing the stream using stream.close() statement ….i even put a pause of 5 seconds before calling stream.close ….the feed got closed ..but getting following error in console :

    Traceback (most recent call last):
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1052, in _bootstrap_inner
    self.run()
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 989, in run
    self._target(*self._args, **self._kwargs)
    in
    stream.close()
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content\pricing_stream_facade.py", line 133, in close
    return super().close()
    ^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 65, in close
    return self._stream.close()
    ^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 172, in close
    return self.state.close(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream\states_basestream_states.py", line 83, in close
    return self.stream.do_close(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 192, in do_close
    self._do_close(*args, **kwargs)
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content_universe_streams.py", line 450, in _do_close
    futures.append(executor.submit(universe_stream.close))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 172, in submit
    raise RuntimeError('cannot schedule new futures after '
    RuntimeError: cannot schedule new futures after interpreter shutdown

    Thanks

    Sumit

  • suchit_1
    suchit_1 Newcomer

    Hi ,

    When closing the stream using stream.close() statement ….i even put a pause of 5 seconds before calling stream.close ….the feed got closed ..but getting following error in console :

    Traceback (most recent call last):
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1052, in _bootstrap_inner
    self.run()
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 989, in run
    self._target(*self._args, **self._kwargs)
    in
    stream.close()
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content\pricing_stream_facade.py", line 133, in close
    return super().close()
    ^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 65, in close
    return self._stream.close()
    ^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 172, in close
    return self.state.close(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream\states_basestream_states.py", line 83, in close
    return self.stream.do_close(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 192, in do_close
    self._do_close(*args, **kwargs)
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content_universe_streams.py", line 450, in _do_close
    futures.append(executor.submit(universe_stream.close))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 172, in submit
    raise RuntimeError('cannot schedule new futures after '
    RuntimeError: cannot schedule new futures after interpreter shutdown

    Thanks

    Sumit

  • suchit_1
    suchit_1 Newcomer

    Hi ,

    When closing the stream using stream.close() statement ….i even put a pause of 5 seconds before calling stream.close ….the feed got closed ..but getting following error in console :

    Traceback (most recent call last):
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1052, in _bootstrap_inner
    self.run()
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 989, in run
    self._target(*self._args, **self._kwargs)
    in
    stream.close()
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content\pricing_stream_facade.py", line 133, in close
    return super().close()
    ^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 65, in close
    return self._stream.close()
    ^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 172, in close
    return self.state.close(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream\states_basestream_states.py", line 83, in close
    return self.stream.do_close(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 192, in do_close
    self._do_close(*args, **kwargs)
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content_universe_streams.py", line 450, in _do_close
    futures.append(executor.submit(universe_stream.close))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 172, in submit
    raise RuntimeError('cannot schedule new futures after '
    RuntimeError: cannot schedule new futures after interpreter shutdown

    Thanks

    Sumit

  • suchit_1
    suchit_1 Newcomer

    Hi ,

    When closing the stream using stream.close() statement ….i even put a pause of 5 seconds before calling stream.close ….the feed is not getting closed ..and getting following error in console :

    Traceback (most recent call last):
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1052, in _bootstrap_inner
    self.run()
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 989, in run
    self._target(*self._args, **self._kwargs)
    in
    stream.close()
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content\pricing_stream_facade.py", line 133, in close
    return super().close()
    ^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 65, in close
    return self._stream.close()
    ^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 172, in close
    return self.state.close(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream\states_basestream_states.py", line 83, in close
    return self.stream.do_close(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 192, in do_close
    self._do_close(*args, **kwargs)
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content_universe_streams.py", line 450, in _do_close
    futures.append(executor.submit(universe_stream.close))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 172, in submit
    raise RuntimeError('cannot schedule new futures after '
    RuntimeError: cannot schedule new futures after interpreter shutdown

    Thanks

    Sumit

  • suchit_1
    suchit_1 Newcomer

    Hi ,

    When closing the stream using stream.close() statement ….i even put a pause of 5 seconds before calling stream.close ….the feed is not getting closed ..and getting following error in console :

    Traceback (most recent call last):File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1052, in _bootstrap_innerself.run()File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 989, in runself._target(*self._args, **self._kwargs)instream.close()File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content\pricing_stream_facade.py", line 133, in closereturn super().close()^^^^^^^^^^^^^^^File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 65, in closereturn self._stream.close()^^^^^^^^^^^^^^^^^^^^File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 172, in closereturn self.state.close(*args, **kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream\states_basestream_states.py", line 83, in closereturn self.stream.do_close(*args, **kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 192, in do_closeself._do_close(*args, **kwargs)File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content_universe_streams.py", line 450, in _do_closefutures.append(executor.submit(universe_stream.close))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 172, in submitraise RuntimeError('cannot schedule new futures after 'RuntimeError: cannot schedule new futures after interpreter shutdown

    Thanks

    Sumit

  • suchit_1
    suchit_1 Newcomer

    Hi ,

    When closing the stream using stream.close() statement ….i even put a pause of 5 seconds before calling stream.close ….the feed is not getting closed ..and getting following error in console :

    Traceback (most recent call last):File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1052, in _bootstrap_innerself.run()File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 989, in runself._target(*self._args, **self._kwargs)instream.close()File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content\pricing_stream_facade.py", line 133, in closereturn super().close()^^^^^^^^^^^^^^^File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 65, in closereturn self._stream.close()^^^^^^^^^^^^^^^^^^^^File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 172, in closereturn self.state.close(*args, **kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream\states_basestream_states.py", line 83, in closereturn self.stream.do_close(*args, **kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\delivery_stream_basestream.py", line 192, in do_closeself._do_close(*args, **kwargs)File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\lseg\data\content_universe_streams.py", line 450, in _do_closefutures.append(executor.submit(universe_stream.close))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 172, in submitraise RuntimeError('cannot schedule new futures after 'RuntimeError: cannot schedule new futures after interpreter shutdown

    Thanks

    Sumit