https://prefect.io logo
#prefect-community
Title
# prefect-community
a

Andreas Nord

09/20/2022, 9:07 AM
Hi! My flow runs all tasks but does not send the Flow Succesful status before going to 'exited', the agent log in the environment looks like this:
Copy code
08:57:40.650 | INFO    | Task run 'task_name-6b80d8b6-24' - Finished in state Completed()
08:57:59.061 | INFO    | prefect.infrastructure.docker-container - Docker container 'adaptable-quoll' has status 'exited'
And the Prefect Cloud log like this:
Copy code
Created task run 'task_name-6b80d8b6-24' for task 'task_name'
10:57:39 AM
Executing 'task_name-6b80d8b6-24' immediately..
The flow run is stuck at 'running' in the Prefect Cloud UI. This is only the case for one of my flows, but the final tasks of the flow are the same tasks as for my other flows.
c

Christopher Boyd

09/20/2022, 1:48 PM
Hi Andreas, unfortunately, it might be necessary to turn up some of the logging to see what’s happening, it’s not immediately clear what might be the issue here. This page helps address what states the flow should be returning - it’s possible that it is returning a completed flow based on this condition:
Copy code
If the flow does not return a value (or returns None), its state is determined by the states of all of the tasks and subflows within it. If any task run or subflow run failed, then the final flow run state is marked as FAILED.
https://docs.prefect.io/concepts/states/
a

Andreas Nord

09/20/2022, 1:54 PM
Yes that is the case I am excepting (I don't return anything). All my tasks are shown as completed in the agent log. Are there any prefect related stuff I could add to logging that would help?
c

Christopher Boyd

09/20/2022, 1:56 PM
Hi Andreas, you can increase logging via env var, and also consider task / flow logging - this should help expose some more details of what’s happening, as by default only INFO messages are logged
Copy code
PREFECT_LOGGING_LEVEL="DEBUG"
https://docs.prefect.io/concepts/logs/
👍 1
a

Andreas Nord

09/20/2022, 2:21 PM
I tried running again with DEBUG on, this time the flow finished. There is a 1.5 minute delay between the last task finishing and the flow showing as complete, but I also had some cases where it would be stuck completely..
Copy code
14:17:18.947 | INFO    | Flow run 'enormous-kangaroo' - Executing 'task_name-6b80d8b6-24' immediately...
14:17:19.239 | DEBUG   | Task run 'task_name-6b80d8b6-24' - Beginning execution...
14:17:19.274 | DEBUG   | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/0451cc5b-16d5-4d70-9d57-50d9e3ba9d9e/workspaces/4992e11a-b874-4137-b375-450f3d67c5af/>
14:17:19.685 | INFO    | Task run 'task_name-6b80d8b6-24' - Finished in state Completed()
16:17:23.419 | DEBUG   | prefect.agent - Checking for flow runs...
16:17:28.808 | DEBUG   | prefect.agent - Checking for flow runs...
16:17:33.981 | DEBUG   | prefect.agent - Checking for flow runs...
16:17:39.155 | DEBUG   | prefect.agent - Checking for flow runs...
16:17:44.362 | DEBUG   | prefect.agent - Checking for flow runs...
16:17:49.526 | DEBUG   | prefect.agent - Checking for flow runs...
16:17:54.802 | DEBUG   | prefect.agent - Checking for flow runs...
16:18:00.726 | DEBUG   | prefect.agent - Checking for flow runs...
16:18:05.912 | DEBUG   | prefect.agent - Checking for flow runs...
16:18:11.094 | DEBUG   | prefect.agent - Checking for flow runs...
16:18:16.263 | DEBUG   | prefect.agent - Checking for flow runs...
16:18:21.428 | DEBUG   | prefect.agent - Checking for flow runs...
16:18:26.586 | DEBUG   | prefect.agent - Checking for flow runs...
16:18:31.895 | DEBUG   | prefect.agent - Checking for flow runs...
16:18:37.056 | DEBUG   | prefect.agent - Checking for flow runs...
14:18:38.266 | DEBUG   | prefect.task_runner.concurrent - Shutting down task runner...
14:18:38.267 | INFO    | Flow run 'enormous-kangaroo' - Finished in state Completed('All states completed.')
16:18:42.237 | DEBUG   | prefect.agent - Checking for flow runs...
16:18:42.914 | INFO    | prefect.infrastructure.docker-container - Docker container 'enormous-kangaroo' has status 'exited'