https://prefect.io logo
Title
r

Ritabrata Moitra

05/09/2023, 10:45 AM
Hey folks. My flows are eternally stuck in
pending
state while trying to run through an ECSTask block. I was referring to https://prefecthq.github.io/prefect-aws/#save-an-infrastructure-and-storage-block. Probing a bit further, I checked the
containerDefinition
for the ECS task that was created by
prefect deployment apply
and the command seems to be
["python","-m","prefect.engine"]
To me, it seems that this is the malformed command, as what I see from the logs is that the Fargate instance is stuck on this command and starts some sort of a server, instead of running the desired flow. Could you folks kindly advise on this?
Would be really grateful for any help here 🙌
If I look at the logs of the ECS task, it is perenially stalled at this point ( screenshot attached ) My task definition -
ecs_task = ECSTask(
        image="prefecthq/prefect:2-python3.10",
        aws_credentials=aws_credentials,
        vpc_id=os.environ["VPC_ID"],
        cluster="prefect-agent-cluster-2",
        stream_output=True,
        configure_cloudwatch_logs=True,
        execution_role_arn="arn:aws:iam::xxxx:role/test-iam-role-prefect",
        task_role_arn="arn:aws:iam::xxxx:role/test-iam-role-prefect"