Billy McMonagle
10/22/2020, 6:02 PMFargateAgent
. I am running this agent locally, and it seems to work intermittently. However, I am repeatedly getting this error:
[2020-10-22 17:59:48,212] INFO - agent | Starting FargateAgent with labels ['XXX']
[2020-10-22 17:59:48,212] INFO - agent | Agent documentation can be found at <https://docs.prefect.io/orchestration/>
[2020-10-22 17:59:48,212] INFO - agent | Agent connecting to the Prefect API at <https://api.prefect.io>
[2020-10-22 17:59:48,269] INFO - agent | Waiting for flow runs...
[2020-10-22 17:59:48,402] ERROR - agent | [{'path': ['get_runs_in_queue'], 'message': "'NoneType' object has no attribute 'flow_group_id'", 'extensions': {'code': 'INTERNAL_SERVER_ERROR'}}]
import os
from prefect.agent.fargate import FargateAgent
CLUSTER = "XXX"
SUBNETS = ["subnet-XXX", "subnet-XXX"]
EXECUTION_ROLE_ARN = "XXX"
agent = FargateAgent(
labels=["XXX],
launch_type="FARGATE",
cluster=CLUSTER,
executionRoleArn=EXECUTION_ROLE_ARN,
networkConfiguration={
"awsvpcConfiguration": {
"assignPublicIp": "ENABLED",
"subnets": SUBNETS,
}
},
cpu="256",
memory="512",
containerDefinitions=[
{
"environment": [{"name": "TEST_ENV", "value": "Success!"}],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/my/log/group",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "prefect-flow-runs",
"awslogs-create-group": "true",
},
},
}
],
)
agent.start()
from datetime import timedelta
import prefect
from prefect import Client, task, Flow
from prefect.schedules import IntervalSchedule
@task
def hello_task():
logger = prefect.context.get("logger")
<http://logger.info|logger.info>("Hello, Cloud!")
schedule = IntervalSchedule(interval=timedelta(minutes=1))
with Flow("A New Flow", schedule,) as flow:
hello_task()
flow.register(project_name="Test Project")
executionRoleArn
so it failed. After updating that attribute, it has reverted to the aforementioned error which seems quite unrelated.Chris White
Billy McMonagle
10/22/2020, 7:25 PMChris White
flow_group_id
error!Billy McMonagle
10/22/2020, 10:24 PM