Ben
10/31/2025, 7:35 AMprefect.yaml file to manage and deploy my deployments to my self hosted Prefect 3 instance. Whenever I use the prefect cli tool to deploy a deployment, I am getting these strange errors or warnings in the stdout.
RuntimeWarning: coroutine 'Block.aload' was never awaited
if flow is None:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Deployment 'tapology-sync-post-fight-fighters-data/[Tapology] Sync Fighters post fight data' successfully created with id 'aab15893-6422-45bb-aeda-f2e7558f0812'.
To schedule a run for this deployment, use the following command:
$ prefect deployment run 'tapology-sync-post-fight-fighters-data/[Tapology] Sync Fighters post fight data'
sys:1: RuntimeWarning: coroutine 'Block.aload' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
The deployment is successfully deployed to my prefect instance, but I am concerned about these error messages, they suddenly started to appear and I don't know what they mean.
What do they mean and how can I fix whatever has caused them to start appearing?
I am using Macbook pro M1 Ventura, with Python 3 virtual env
python --version
Python 3.12.8
pip --version
pip 24.3.1
prefect --version
3.4.19Marvin
10/31/2025, 7:35 AMMarvin
10/31/2025, 7:40 AMcoroutine 'Block.aload' was never awaited.
- In Prefect 3, blocks have both sync (Block.load) and async (Block.aload) loaders. That warning indicates something in the deploy path invoked the async variant without awaiting it.
- Since the deployment still succeeds, this is almost certainly a benign bug in the CLI’s deploy code path rather than an issue with your flow or infrastructure.
Why it likely started “suddenly”
- This lines up with a regression introduced in recent 3.4.x releases that shows up when prefect deploy resolves block references from prefect.yaml. You’re on 3.4.19, which is in that window.
How to fix or work around it
1) Upgrade Prefect to the latest 3.4.x
- The quickest way to get rid of this warning is to upgrade to the newest patch release. In most cases this warning does not reproduce on the latest 3.4.x.
python -m pip install -U prefect
prefect --version # verify
- Release notes: Prefect 3 OSS release notes
2) If you can’t upgrade immediately, you can temporarily suppress the warning
- This only hides the noise; it doesn’t change behavior.
# zsh/bash
export PYTHONWARNINGS="ignore::RuntimeWarning"
prefect deploy
3) If the warning persists after upgrading
- Enable a traceback for the allocation so we can pinpoint the exact code path:
PYTHONTRACEMALLOC=1 prefect deploy
- Please share the output; that stack will help us verify the exact call site and file a fix if needed.
A couple of quick questions to help us reproduce and confirm:
- Do you reference any blocks in your prefect.yaml (for example storage, credentials, notifications, etc.)? If so, can you share the relevant snippet of the deployments: section?
- Did this start right after upgrading Prefect or Python? If you remember the last Prefect version where it didn’t happen, that helps us bisect.
Reference docs
- prefect.yaml deployment config: Using prefect.yaml for deployments
If you’d like, I can also try to reproduce locally from a redacted prefect.yaml snippet and report back with a concrete patch version that’s clean.