gabriela palacios
07/28/2025, 3:18 PM"prefect.state-message": "Submission failed. KeyError: \"No class found for dispatch key 'ecs-task' in registry for type 'Block'.\"",
please help to start debuggingMarvin
07/28/2025, 3:18 PMMarvin
07/28/2025, 3:19 PMprefect-aws installed and working?
2. Have you made any recent changes to your Python environment or dependencies?
3. Are you running this in a container or on a local machine?gabriela palacios
07/28/2025, 4:11 PMMarvin
07/28/2025, 4:11 PMMarvin
07/28/2025, 4:13 PMKeyError: "No class found for dispatch key 'ecs-task' in registry for type 'Block'." suggests that the ECS Task block registration was lost or failed in your container. This can happen if:
- The container was restarted and block registration didn't persist
- The prefect-aws package was somehow unloaded or corrupted
- There's an issue with the container's Python environment
2. Immediate Fix:
Inside your container, run:
bash
# First verify the package is still installed
pip list | grep prefect-aws
# Then re-register the blocks
prefect block register -m prefect_aws
3. Container Persistence Solution:
To prevent this from happening again, you should:
- Add the block registration command to your container's startup script or entrypoint
- Or add it to your Dockerfile:
dockerfile
RUN pip install prefect-aws && prefect block register -m prefect_aws
4. Version Check:
There have been some recent issues with ECS tasks in containers. Please verify your versions:
bash
prefect version
pip show prefect-aws
Make sure you're using compatible versions of Prefect and prefect-aws.
Would you be able to:
1. Check if prefect-aws is still installed in the container?
2. Try re-registering the blocks and let me know if the error persists?
3. Share your Prefect and prefect-aws versions?
Also, based on the GitHub issues I found, there are some known issues with ECS tasks in certain scenarios. If the above steps don't resolve your issue, we might need to look at your specific ECS task configuration and how the container is being managed.