Hey team! Am trying to run a basic flow using ecs ...
# prefect-community
m
Hey team! Am trying to run a basic flow using ecs task and s3 storage block but my flow is getting into crashed state with status code 143. Below is the agent logs. Any insights on this issue would be highly appreciated. Thank you!
Copy code
15:33:55.166 | INFO    | prefect.agent - Submitting flow run '6fd60d2e-8536-43c4-aea7-97c5e44bc5eb'
15:33:55.433 | INFO    | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Retrieving task definition 'arn:aws:ecs:us-west-2:762097867323:task-definition/dsa-prefect-v2-development-task'...
15:33:55.686 | INFO    | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Retrieving task definition 'dsa-prefect-v2-development-task'...
15:33:55.742 | WARNING | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Settings require changes to the linked task definition. A new task definition will be registered. 
15:33:56.396 | INFO    | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Creating task run...
15:33:57.341 | INFO    | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Waiting for task run to start...
15:33:57.411 | INFO    | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Status is PROVISIONING.
15:34:07.545 | INFO    | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Status is PENDING.
15:34:22.744 | INFO    | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Status is RUNNING.
15:34:27.747 | INFO    | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Running command 'python -m prefect.engine' in container 'prefect' (prefecthq/prefect:2-latest)...
15:34:27.788 | INFO    | prefect.agent - Completed submission of flow run '6fd60d2e-8536-43c4-aea7-97c5e44bc5eb'
15:34:32.881 | INFO    | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Status is DEPROVISIONING.
15:34:43.037 | INFO    | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Status is STOPPED.
15:34:43.102 | WARNING | prefect.infrastructure.ecs-task - ECSTask 'fuzzy-sponge': Container 'prefect' exited with non-zero exit code 143.
15:34:43.166 | INFO    | prefect.agent - Reported flow run '6fd60d2e-8536-43c4-aea7-97c5e44bc5eb' as crashed: Flow run infrastructure exited with non-zero status code 143.
z
Did you try googling that exit code?
It sounds like the container was killed by a supervisor
m
hmmm, looking at the above logs, container was killed after status was deprovisioned & stopped but not during the flow execution? no?
z
We don't check the status until it's stopped, I think.
r
@Zanie what’s the preferred way to retrieve and output the container logs in Prefect 2? I’m seeing references to
GetContainerLogs
for Prefect 1. I’m encountering a similar issue (different error code) and am trying to get to the bottom of what’s happening inside the container.
z
If you set
stream_output=True
on your ECS task then we will stream the container logs to CloudWatch
(and the agent)
r
Hmm — that’s already present in my ECS task but I’m still not getting the full logs I want. I’m guessing this is a container issue and I need to configure more verbose logs on that side?