https://prefect.io logo
#prefect-community
Title
# prefect-community
m

Miles Lauridsen

09/10/2022, 12:26 AM
Hi all. Having some issues trying to run a basic Prefect flow in a docker instance. Works fine on my local machine (outside docker) but then when run in a container outputs this error. Any suggestions for usage?
1
a

Anna Geller

09/10/2022, 12:48 AM
moving here to keep channel clean:
Copy code
Traceback (most recent call last):
  File "/home/v/.local/lib/python3.8/site-packages/asgi_lifespan/_concurrency/asyncio.py", line 44, in run_and_fail_after
    await asyncio.wait_for(coroutine(), timeout=seconds)
  File "/usr/local/lib/python3.8/asyncio/tasks.py", line 501, in wait_for
    raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/prefect.py", line 71, in <module>
    scrape_flow()
  File "/home/v/.local/lib/python3.8/site-packages/prefect/flows.py", line 384, in __call__
    return enter_flow_run_engine_from_flow_call(
  File "/home/v/.local/lib/python3.8/site-packages/prefect/engine.py", line 158, in enter_flow_run_engine_from_flow_call
    return anyio.run(begin_run)
  File "/home/v/.local/lib/python3.8/site-packages/anyio/_core/_eventloop.py", line 70, in run
    return asynclib.run(func, *args, **backend_options)
  File "/home/v/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 292, in run
    return native_run(wrapper(), debug=debug)
  File "/usr/local/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/v/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
    return await func(*args)
  File "/home/v/.local/lib/python3.8/site-packages/prefect/client.py", line 101, in with_injected_client
    async with client_context as client:
  File "/home/v/.local/lib/python3.8/site-packages/prefect/client.py", line 1905, in __aenter__
    self._ephemeral_lifespan = await self._exit_stack.enter_async_context(
  File "/usr/local/lib/python3.8/contextlib.py", line 568, in enter_async_context
    result = await _cm_type.__aenter__(cm)
  File "/usr/local/lib/python3.8/contextlib.py", line 171, in __aenter__
    return await self.gen.__anext__()
  File "/home/v/.local/lib/python3.8/site-packages/prefect/client.py", line 185, in app_lifespan_context
    await context.__aenter__()
  File "/home/v/.local/lib/python3.8/site-packages/asgi_lifespan/_manager.py", line 90, in __aenter__
    await self.startup()
  File "/home/v/.local/lib/python3.8/site-packages/asgi_lifespan/_manager.py", line 31, in startup
    await self._concurrency_backend.run_and_fail_after(
  File "/home/v/.local/lib/python3.8/site-packages/asgi_lifespan/_concurrency/asyncio.py", line 46, in run_and_fail_after
    raise TimeoutError
TimeoutError
my suggestion would be to either: 1. run it without Docker since Docker is not required because Orion is so lightweight - Conda virtual env is usually enough to get started and have env isolation 2. try out prefect Cloud app.prefect.cloud 3. use this docker compose setup https://discourse.prefect.io/t/running-prefect-2-with-docker-compose/1516
m

Miles Lauridsen

09/10/2022, 2:03 AM
I’m currently running it on a machine that allows docker but a local conda/python env isn’t an option. Cloud isn’t an option as it needs to stay behind a firewall. Will see if Conda in Docker solves whatever the conflict is.
3 Views