Hi all recently update all my ETLs to run in prefe...
# ask-community
t
Hi all recently update all my ETLs to run in prefect 2.0 but now I am getting a problem with the agent crashing. I am not sure if it matters but I am running the agent in a virtual environment here are the error messages that I am getting Traceback (most recent call last): File "c:\etls2\lib\site-packages\prefect\utilities\services.py", line 46, in critical_service_loop await workload() File "c:\etls2\lib\site-packages\prefect\agent.py", line 194, in get_and_submit_flow_runs responses = await self.client.get_scheduled_flow_runs_for_work_pool( File "c:\etls2\lib\site-packages\prefect\client\orchestration.py", line 2282, in get_scheduled_flow_runs_for_work_pool response = await self._client.post( File "c:\etls2\lib\site-packages\httpx\_client.py", line 1845, in post return await self.request( File "c:\etls2\lib\site-packages\httpx\_client.py", line 1530, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects) File "c:\etls2\lib\site-packages\prefect\client\base.py", line 249, in send response = await self._send_with_retry( File "c:\etls2\lib\site-packages\prefect\client\base.py", line 192, in _send_with_retry response = await request() File "c:\etls2\lib\site-packages\httpx\_client.py", line 1617, in send response = await self._send_handling_auth( File "c:\etls2\lib\site-packages\httpx\_client.py", line 1645, in _send_handling_auth response = await self._send_handling_redirects( File "c:\etls2\lib\site-packages\httpx\_client.py", line 1682, in _send_handling_redirects response = await self._send_single_request(request) File "c:\etls2\lib\site-packages\httpx\_client.py", line 1719, in _send_single_request response = await transport.handle_async_request(request) File "c:\etls2\lib\site-packages\httpx\_transports\default.py", line 352, in handle_async_request with map_httpcore_exceptions(): File "C:\Program Files\Python310\lib\contextlib.py", line 153, in exit self.gen.throw(typ, value, traceback) File "c:\etls2\lib\site-packages\httpx\_transports\default.py", line 77, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.RemoteProtocolError: <ConnectionTerminated error_code:ErrorCodes.NO_ERROR, last_stream_id:235, additional_data:73657373696f6e5f74696d65645f6f7574> Traceback (most recent call last): File "c:\etls2\lib\site-packages\prefect\cli\_utilities.py", line 41, in wrapper return fn(*args, **kwargs) File "c:\etls2\lib\site-packages\prefect\utilities\asyncutils.py", line 260, in coroutine_wrapper return call() File "c:\etls2\lib\site-packages\prefect\_internal\concurrency\calls.py", line 245, in call return self.result() File "c:\etls2\lib\site-packages\prefect\_internal\concurrency\calls.py", line 173, in result return self.future.result(timeout=timeout) File "C:\Program Files\Python310\lib\concurrent\futures\_base.py", line 439, in result return self.__get_result() File "C:\Program Files\Python310\lib\concurrent\futures\_base.py", line 391, in __get_result raise self._exception File "c:\etls2\lib\site-packages\prefect\_internal\concurrency\calls.py", line 218, in _run_async result = await coro File "c:\etls2\lib\site-packages\prefect\cli\agent.py", line 189, in start async with anyio.create_task_group() as tg: File "c:\etls2\lib\site-packages\anyio\_backends\_asyncio.py", line 662, in aexit raise exceptions[0] File "c:\etls2\lib\site-packages\prefect\utilities\services.py", line 104, in critical_service_loop raise RuntimeError("Service exceeded error threshold.") RuntimeError: Service exceeded error threshold.
b
Hey Tabari, thanks for reporting this. Is the agent able to run any flows at all? Or does it immediately crash?
t
Hi Bianca it runs flows for awhile then it crashes
This happened after updated the my code for prefect 2.0 on 1.0 the same ETLS have worked fine.
b
Hmm..if it's a linux vm, i'd recommend checking out this guide on how to set up the agent as a systemd service
t
It's windows.
b
Ah, it seems as though another user reported a similar error. As a first step for troubleshooting, could you Alex's recommendation?
I think the process here would be: 1. stop the current agent process 2. set the variable using the command Alex mentioned 3. restart the agent
t
Thaks I will try this!
This did not work for me.