Hello everyone,
I ran into a problem using the artiq_influxdb bridge. I use the latest beta version (40cea30) with nix and Debian (with WSL for testing, but this also happens on real Linux). When I execute artiq_influxdb I receive this error:

Traceback (most recent call last):
  File "/nix/store/0jx32q89bsv8knip2shd4kksbc64c7v7-python3.11-artiq-comtools-1.2/bin/.artiq_influxdb-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/m0xx9xcbab5pnqgqhaa9h34z849gqwhs-python3-3.11.6-env/lib/python3.11/site-packages/artiq_comtools/artiq_influxdb.py", line 249, in main
    _, pending = loop.run_until_complete(asyncio.wait(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/p1zbyfrpj3hq50mxh5hmxl3kqpa2b1am-python3-3.11.6/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/nix/store/p1zbyfrpj3hq50mxh5hmxl3kqpa2b1am-python3-3.11.6/lib/python3.11/asyncio/tasks.py", line 425, in wait
    raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
sys:1: RuntimeWarning: coroutine 'Server.wait_terminate' was never awaited
sys:1: RuntimeWarning: coroutine 'SignalHandler.wait_terminate' was never awaited

The same error occurs when I execute artiq_ctlmgr. I found an explanation to this error on stack overflow: stackoverflow: asyncio-wait-confusion-when-passed-a-coroutine
A compatibility issue with asyncio was already mentioned by jfniedermeyer .

I also noticed the code for sipyco was changed like the stack overflow solution suggests (Python 3.11 compatibility fix, f39f22b together with fix asyncio event loop management, 91a7906).
Based on this, I think the same changes should also be applied to artiq_comtools. In artiq_comtools coroutines are still passed directly to asyncio.wait() (artiq_comtools/artiq_influxdb.py#L250).

Is my assumption correct? Should I open an additional git issue for this problem or directly create a pull request? I have never contributed to a project before and would be very grateful for any advice.

    We haven't updated to the most recent build of ARTIQ 8 in quite some time and we are still using Conda to maintain our environments. To get asyncio to work for us, we wound up needing to downgrade to Python 3.10.

    As far as the InfluxDB bridge goes, to get that working, (at least in our Conda env), I had to do a pip install with an upgrade flag, specifically:
    pip install git+https://gitlab.com/charlesbaynham/artiq_influx_generic.git --upgrade.

    This avoided upgrading packages that broke other dependencies.

    6 days later

    Hi @fsagbuya, thank you for the quick reply and creating the PR. I could not test it with our hardware yet, but the test with running only the software seems to work (the error from above about asyncio is gone).
    As you suggested, I will open an issue directly when I have a similar problem in the future.

    8 days later

    To follow up a bit on this, we made a new env in Conda with the latest build, and it now seems to install Python 3.12, which in turn re-breaks asyncio. I know that in the long-term Conda installs will be deprecated, but until that happens, fixing the dependency would be nice. Should I submit at issue?

    This isn't particularly specific to conda, most package managers other than Nix are affected by this issue to a varying degree. Conda is just bad because (in addition to the MBA/VC nonsense at Anaconda Inc. and subsequent licensing problems) it is so buggy, in particular when you try to pin versions.