Kiana Alessandra Villaera
03/23/2025, 2:54 PM(prefect-2) ubuntu@ip-172-31-13-253:~/Docker/eti-data-pipeline-worflows$ prefect worker start --pool my-ecs-pool
Discovered type 'ecs' for work pool 'my-ecs-pool'.
Worker 'ECSWorker 05116438-a5b0-42d3-a699-1a23bed3ba35' started!
Failed the last 3 attempts. Please check your environment and configuration.
Examples of recent errors:
Traceback (most recent call last):
File "/home/ubuntu/.conda/envs/prefect-2/lib/python3.10/site-packages/prefect/utilities/services.py", line 64, in critical_service_loop
await workload()
File "/home/ubuntu/.conda/envs/prefect-2/lib/python3.10/site-packages/prefect/workers/base.py", line 760, in get_and_submit_flow_runs
runs_response = await self._get_scheduled_flow_runs()
File "/home/ubuntu/.conda/envs/prefect-2/lib/python3.10/site-packages/prefect/workers/base.py", line 917, in _get_scheduled_flow_runs
await self.client.get_scheduled_flow_runs_for_work_pool(
File "/home/ubuntu/.conda/envs/prefect-2/lib/python3.10/site-packages/prefect/client/orchestration/_work_pools/client.py", line 586, in get_scheduled_flow_runs_for_work_pool
response = await self.request(
File "/home/ubuntu/.conda/envs/prefect-2/lib/python3.10/site-packages/prefect/client/orchestration/base.py", line 53, in request
return await self._client.send(request)
File "/home/ubuntu/.conda/envs/prefect-2/lib/python3.10/site-packages/prefect/client/base.py", line 354, in send
response.raise_for_status()
File "/home/ubuntu/.conda/envs/prefect-2/lib/python3.10/site-packages/prefect/client/base.py", line 162, in raise_for_status
raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Server error '500 Internal Server Error' for url '<http://127.0.0.1:4200/api/work_pools/my-ecs-pool/get_scheduled_flow_runs>'
Response: {'exception_message': 'Internal Server Error'}
For more information check: <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500>
I presume this has something to do with my worker not able to access the API. but my task-definition.json
already has my prefect api user key configured. I'm at a loss as to what step I've missed. Perhaps my PREFECT_APU_URL
is incorrect?Jake Kaplan
03/23/2025, 3:28 PM<http://127.0.0.1:4200/api/work_pools/my-ecs-pool/get_scheduled_flow_runs>
Kiana Alessandra Villaera
03/23/2025, 11:10 PM{"detail":"Method Not Allowed"}
Kiana Alessandra Villaera
03/23/2025, 11:14 PM127.0.0.01
to the public DNS of the EC2 instance I am running fromJake Kaplan
03/23/2025, 11:15 PMKiana Alessandra Villaera
03/24/2025, 2:59 AMPREFECT_API_URL
to <ec2-ipv4-public-dns>:4200/api
and now the work queue is ping-ableKiana Alessandra Villaera
03/24/2025, 2:59 AMReported flow run '8fb8e07d-25ec-4616-b13f-67ec929a1bd6' as crashed: Flow run could not be submitted to infrastructure:
AccessDeniedException('An error occurred (AccessDeniedException) when calling the RegisterTaskDefinition operation: User: arn:aws:sts::306326271806:assumed-role/eti-dataworkflow-ecs-task-executioner/1287dcb7d9a2476483178719de9b0cf5 is not authorized to perform: ecs:RegisterTaskDefinition on resource: arn:aws:ecs:ap-southeast-1:306326271806:task-definition/prefect_my-ecs-pool_24570927-b2c5-4aa2-bb78-63924aeb6c95:* because no identity-based policy allows the ecs:RegisterTaskDefinition action')
Kiana Alessandra Villaera
03/24/2025, 3:00 AMJake Kaplan
03/24/2025, 3:27 AMRegisterTaskDefinition
permission to the roleKiana Alessandra Villaera
03/24/2025, 4:48 AM