<@ULVA73B9P> i am running a prefect flow from a ce...
# marvin-in-the-wild
h
@Marvin i am running a prefect flow from a celery task in my django project. but the flow sometime crashed midway saying "Crash detected! Execution was cancelled by the runtime environment.". what can be the reason. i am using prefect version 2.x
m
"Crash detected! Execution was cancelled by the runtime environment" - sounds like an existential crisis for your flow! Let's investigate why this might be happening in Prefect 2.x. I will search the Prefect 2.x documentation and GitHub issues to understand possible reasons behind this crash message. Hang tight! It looks like your flow's sudden cancellation might be due to several reasons: 1. Infrastructure Issues: If the underlying infrastructure block is altered, missing, or unsupported for cancellations, the flow will be marked as cancelled. 2. Kubernetes or Docker Issues: If you're running in Docker or Kubernetes, check if the container or job is being terminated unexpectedly. 3. Concurrency or Task Management: Issues with
asyncio
tasks, especially when using
time.sleep
or other blocking calls, can cause crashes. ### Actions to Consider: - Check Infrastructure: Ensure the infrastructure used (Docker, Kubernetes, etc.) is correctly configured and stable. - Review Task Usage: Avoid blocking calls within async tasks. Use
await
for async-friendly delays. - Review Logs: Examine Prefect, Docker, or Kubernetes logs to identify crashes or terminations. Here are a few links you might find useful: - Prefect Flows - Concepts - Prefect Runtime Context Guide - GitHub Issue: "Crash detected! Execution was cancelled by the runtime environment" Good luck resolving your issue! If anything's unclear or needs more specifics, just holler!