Skip to content

testing tool subscription cause error #867

Open

Description

@kevinli-stageprecision

Running the latest version of the testing tool locally on a Windows machine.

Trying to subscribe to the resources, but the script throws an error:

[2025-04-13 19:54:11,378] ERROR in app: Exception on /x-nmos/query/v1.3/subscriptions [POST]
Traceback (most recent call last):
  File "D:\3rdparty\nmos\nmos-testing-master\.nmostest\Lib\site-packages\flask\app.py", line 1511, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\3rdparty\nmos\nmos-testing-master\.nmostest\Lib\site-packages\flask\app.py", line 919, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\3rdparty\nmos\nmos-testing-master\.nmostest\Lib\site-packages\flask_cors\extension.py", line 176, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ^^^^^^^^^^^^^^^^^^
  File "D:\3rdparty\nmos\nmos-testing-master\.nmostest\Lib\site-packages\flask\app.py", line 917, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\3rdparty\nmos\nmos-testing-master\.nmostest\Lib\site-packages\flask\app.py", line 902, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\3rdparty\nmos\nmos-testing-master\nmostesting\mocks\Registry.py", line 673, in post_subscription
    subscription, created = registry.subscribe_to_query_api(version, subscription_request, secure)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\3rdparty\nmos\nmos-testing-master\nmostesting\mocks\Registry.py", line 224, in subscribe_to_query_api
    websocket_server = SubscriptionWebsocketWorker('0.0.0.0', websocket_port, resource_type, secure)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\3rdparty\nmos\nmos-testing-master\nmostesting\TestHelper.py", line 514, in __init__
    self._ws_server = self._loop.run_until_complete(websockets.serve(self.handler, host, port, ssl=ctx))
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\3rdparty\nmos\nmos-testing-master\.nmostest\Lib\site-packages\websockets\asyncio\server.py", line 743, in __init__
    self.server = Server(
                  ^^^^^^^
  File "D:\3rdparty\nmos\nmos-testing-master\.nmostest\Lib\site-packages\websockets\asyncio\server.py", line 284, in __init__
    self.loop = asyncio.get_running_loop()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^

Activity

  1. jonathan-r-thorpe commented on Apr 28, 2025

    @jonathan-r-thorpe
    Contributor

    Hi,

    Is that the complete error traceback? I would expect to see the actual error at the end, whereas this traceback is only indicating the location.

    Also it's worth knowing which versions of Python, Windows etc.

  2. thebit70-ui commented on Jan 31, 2026

    @thebit70-ui

    Hi,

    Is that the complete error traceback? I would expect to see the actual error at the end, whereas this traceback is only indicating the location.

    Also it's worth knowing which versions of Python, Windows etc.

    I have the same issue on 2 different PC Systems. One of them is an older System with Win 10 Pro and python 3.14.2 and the following log excerpt is from a System with Win 11 Pro 25H2 and Python 3.13.9 (installed from Microsoft Store) and Riedel Nmos Explorer 1.15.1. The Error occurs if i want to connect the Riedel Nmos Explorer withe the static IP/Port data from the facade Page. In the Nmos Explorer i get an error popup

    "failed to connect to :5102. No response from server. Wrong ip/port?

    [2026-01-31 21:32:00,384] ERROR in app: Exception on /x-nmos/query/v1.3/subscriptions [POST] Traceback (most recent call last): File "C:\Users\ReneS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\flask\app.py", line 1511, in wsgi_app response = self.full_dispatch_request() File "C:\Users\ReneS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\flask\app.py", line 919, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\ReneS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\flask_cors\extension.py", line 176, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) ~^^^^^^^^^^^^^^^^^ File "C:\Users\ReneS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\flask\app.py", line 917, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\ReneS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\flask\app.py", line 902, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^ File "F:\nmos\nmos-testing-master\nmostesting\mocks\Registry.py", line 340, in wrapper return func(*args, **kwargs) File "F:\nmos\nmos-testing-master\nmostesting\mocks\Registry.py", line 628, in post_subscription subscription, created = registry.subscribe_to_query_api(version, subscription_request, secure) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\nmos\nmos-testing-master\nmostesting\mocks\Registry.py", line 214, in subscribe_to_query_api websocket_server = SubscriptionWebsocketWorker('0.0.0.0', websocket_port, resource_type, secure) File "F:\nmos\nmos-testing-master\nmostesting\TestHelper.py", line 531, in __init__ self._ws_server = self._loop.run_until_complete(websockets.serve(self.handler, host, port, ssl=ctx)) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ReneS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\websockets\asyncio\server.py", line 759, in __init__ self.server = Server( ~~~~~~^ handler, ^^^^^^^^ ...<4 lines>... logger=logger, ^^^^^^^^^^^^^^ ) ^ File "C:\Users\ReneS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\websockets\asyncio\server.py", line 284, in __init__ self.loop = asyncio.get_running_loop() ~~~~~~~~~~~~~~~~~~~~~~~~^^ RuntimeError: no running event loop

    If i paste the link in a browser i get this in the browsertab:

    ["devices/", "flows/", "nodes/", "receivers/", "senders/", "sources/", "subscriptions/"]

  3. jonathan-r-thorpe commented on Feb 2, 2026

    @jonathan-r-thorpe
    Contributor

    It looks like there's been in a breaking change in the Python 13 websockets.asyncio implementation, which will need addressing.

    In the mean time, you could try either:

    • Running with a lesser version of python (<3.13) to see if that resolves the issue.
    • Downgrading the websocket library version:

    pip install websockets==12.0

  4. thebit70-ui commented on Feb 2, 2026

    @thebit70-ui

    It looks like there's been in a breaking change in the Python 13 websockets.asyncio implementation, which will need addressing.

    In the mean time, you could try either:

    * Running with a lesser version of python (<3.13) to see if that resolves the issue.
    
    * Downgrading the websocket library version:
    

    pip install websockets==12.0

    Thanks for your answer.

    First try was replacing python 3.13.9 with version 3.12.7 Result: Same issue. Then i'he downgraded the websocket library to version 12.0 Result: now it works.

    Now I hope that the downgrades won't cause problems with other Python projects.

    Best Regards

    René

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions