Event loop is closed error

I got an error with a flow on Prefect 2 that I’m not sure how to debug. I haven’t found any related issues in Issues · PrefectHQ/prefect · GitHub or Slack, etc.

The flow failed, and the stacktrace looks like:

Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x7f9cf6c191b0>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/base_subprocess.py", line 126, in __del__
    self.close()
  File "/usr/local/lib/python3.10/asyncio/base_subprocess.py", line 104, in close
    proto.pipe.close()
  File "/usr/local/lib/python3.10/asyncio/unix_events.py", line 547, in close
    self._close(None)
  File "/usr/local/lib/python3.10/asyncio/unix_events.py", line 571, in _close
    self._loop.call_soon(self._call_connection_lost, exc)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 753, in call_soon
    self._check_closed()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
20:26:13.266 | INFO    | prefect.infrastructure.process - Process 'electric-serval' exited cleanly.

Could this error have too many underlying issues to figure out, or does this point to some known issue?

Our setup:
Running 3 Prefect agents on a GCP VM, and the code that the flows kick off run inside Docker containers. Flows are kicked off for now in the Cloud UI.

maybe this can help?

Thanks, but this flow wasn’t using any async code. Sorry I forgot to mention that. Have you seen this kind of error before? Perhaps it’s related to the prefect python library?

there’s not enough context to help, we would need a minimal reproducible example, context of how you run it incl. prefect version

I’d love to but since I don’t know what caused the error I can’t make a minimal rep eg.

I understand, but we can’t help solve a bug if we can’t reproduce it. Perhaps try doing the same what you did that led to that error and try to generalize and build a small example you can share in a GitHub issue?