Tejas Shah
02/16/2024, 10:19 PMCtrl-C
floods my terminal with the error traceMarvin
02/16/2024, 10:19 PMCtrl-C
, you should use the Prefect CLI or UI to gracefully shut down the deployment. The documentation or troubleshooting guide might have more specific steps on stopping a deployment properly without causing error traces to be printed in your terminal.
However, the provided excerpt doesn't give explicit instructions. I would recommend checking the official Prefect documentation or reaching out in the Prefect community or forums for the recommended way to stop a deployment.
Moreover, if Ctrl-C
is causing flood of error traces, you might want to redirect stderr to /dev/null or use a termination command if available in Prefect's CLI for a cleaner shutdown.
Helpful commands or UI interactions with Prefect could be involved, but without having the exact information at hand (since Prefect 2.x is new and my general knowledge cutoff was before it became broadly available), my suggestions might only lead you into the dreary depths of despair as you sift through documentation. Be brave and carry a towel, just in case.Nate
02/16/2024, 10:20 PMTejas Shah
02/16/2024, 10:20 PMMarvin
02/16/2024, 10:20 PMTejas Shah
02/16/2024, 10:22 PMCtrl-C
, and python didn’t really like it.Tejas Shah
02/16/2024, 10:22 PMTejas Shah
02/16/2024, 10:23 PMprefect deployment --help
and it didn’t list any way to stop the deploy. So was simply wondering how it worked.Nate
02/16/2024, 10:25 PMget_repo_info.serve(name="my-first-deployment")
?Nate
02/16/2024, 10:26 PM^C16:25:44.402 | DEBUG | prefect.runner - Stopping runner...
16:25:44.404 | INFO | prefect.runner - Pausing schedules for all deployments...
16:25:44.404 | DEBUG | prefect.runner - Pausing schedule for deployment '59711747-d206-44bb-86f9-13e03f89fcd5'
16:25:44.446 | INFO | prefect.runner - All deployment schedules have been paused!
(bleeding-prefect) pad-2 :: <http://github.com/PrefectHQ/prefect|github.com/PrefectHQ/prefect> ‹main›
(I have debug logs on 🙂 )
so i'd be curious to see your stack trace if thats not what you gotTejas Shah
02/16/2024, 10:29 PMTejas Shah
02/16/2024, 10:29 PMTejas Shah
02/16/2024, 10:32 PMTejas Shah
02/16/2024, 10:35 PMTejas Shah
02/16/2024, 10:37 PM(venv) (base) ➜ prefect_learning git:(master) ✗ python deployments.py [12:34:26]
Your flow 'get-repo-info' is being served and polling for scheduled runs!
To trigger a run for this flow, use the following command:
$ prefect deployment run 'get-repo-info/my-first-deployment'
You can also run your flow via the Prefect UI: <http://127.0.0.1:4200/deployments/deployment/7743d4f3-cc08-4339-a7f9-94b066c78c59>
^C00:34:49.118 | INFO | prefect.runner - Pausing schedules for all deployments...
00:34:49.152 | INFO | prefect.runner - All deployment schedules have been paused!
Tejas Shah
02/17/2024, 7:49 AMasyncio.exceptions.CancelledError
09:41:01.802 | INFO | Flow run 'meticulous-hound' - Finished in state Completed()
09:41:02.226 | INFO | prefect.flow_runs.runner - Process for flow run 'meticulous-hound' exited cleanly.
^C09:41:44.891 | INFO | prefect.runner - Pausing schedules for all deployments...
Traceback (most recent call last):
File "/Users/tejas/Desktop/tinkering/prefect_learning/deployments.py", line 17, in <module>
get_repo_info.serve(
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 259, in coroutine_wrapper
return call()
^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 407, in __call__
return self.result()
^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 285, in result
return self.future.result(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 169, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/anaconda3/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 364, in _run_async
result = await coro
^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/flows.py", line 788, in serve
await runner.start(webserver=webserver)
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/runner/runner.py", line 366, in start
async with self as runner:
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/runner/runner.py", line 1150, in __aexit__
await self._pause_schedules()
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/runner/runner.py", line 680, in _pause_schedules
await self._client.update_schedule(deployment_id, active=False)
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/client/orchestration.py", line 1604, in update_schedule
await <http://self._client.post|self._client.post>(
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpx/_client.py", line 1877, in post
return await self.request(
^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpx/_client.py", line 1559, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/client/base.py", line 282, in send
response = await self._send_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/prefect/client/base.py", line 216, in _send_with_retry
response = await request()
^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpx/_client.py", line 1646, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpx/_client.py", line 1674, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpx/_client.py", line 1711, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpx/_client.py", line 1748, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpx/_transports/default.py", line 371, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request
raise exc from None
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request
response = await connection.handle_async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpcore/_async/connection.py", line 99, in handle_async_request
raise exc
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpcore/_async/connection.py", line 76, in handle_async_request
stream = await self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpcore/_async/connection.py", line 122, in _connect
stream = await self._network_backend.connect_tcp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpcore/_backends/auto.py", line 30, in connect_tcp
return await self._backend.connect_tcp(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/httpcore/_backends/anyio.py", line 114, in connect_tcp
stream: anyio.abc.ByteStream = await anyio.connect_tcp(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/anyio/_core/_sockets.py", line 221, in connect_tcp
await event.wait()
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 1778, in wait
if await self._event.wait():
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tejas/anaconda3/lib/python3.11/asyncio/locks.py", line 213, in wait
await fut
File "/Users/tejas/Desktop/tinkering/prefect_learning/venv/lib/python3.11/site-packages/greenback/_impl.py", line 211, in _greenback_shim
next_send = outcome.Value((yield next_yield))
^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
Tejas Shah
02/17/2024, 7:51 AM(venv) (base) ➜ prefect_learning git:(master) ✗ python --version
Python 3.11.3
(venv) (base) ➜ prefect_learning git:(master) ✗ prefect --version
2.15.0
Tejas Shah
02/17/2024, 7:53 AMTejas Shah
02/17/2024, 7:54 AMTejas Shah
02/17/2024, 7:55 AMNate
02/19/2024, 5:31 AM