<@ULVA73B9P> what could be causing this error? 06...
# marvin-in-the-wild
k
@Marvin what could be causing this error? 06 de agosto de 2024 às 10:00 (UTC-3:00) 130003.207 | ERROR | prefect.agent - Failed to get infrastructure for flow run 'b562e072-6a51-4e28-8a85-5b74bb96df00'. forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) Traceback (most recent call last): forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) File "/usr/local/lib/python3.11/site-packages/prefect/agent.py", line 471, in submit_run forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) infrastructure = await self.get_infrastructure(flow_run) forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) File "/usr/local/lib/python3.11/site-packages/prefect/agent.py", line 452, in get_infrastructure forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) infrastructure_block = Block._from_block_document(infra_document) forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) File "/usr/local/lib/python3.11/site-packages/prefect/blocks/core.py", line 634, in _from_block_document forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) else cls.get_block_class_from_schema(block_document.block_schema) forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) File "/usr/local/lib/python3.11/site-packages/prefect/blocks/core.py", line 688, in get_block_class_from_schema forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) return cls.get_block_class_from_key(block_schema_to_key(schema)) forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) File "/usr/local/lib/python3.11/site-packages/prefect/blocks/core.py", line 699, in get_block_class_from_key forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) return lookup_type(cls, key) forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) ^^^^^^^^^^^^^^^^^^^^^ forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) File "/usr/local/lib/python3.11/site-packages/prefect/utilities/dispatch.py", line 185, in lookup_type forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) raise KeyError( forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) KeyError: "No class found for dispatch key 'ecs-task' in registry for type 'Block'." forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) 130002.201 | INFO | prefect.agent - Submitting flow run 'b562e072-6a51-4e28-8a85-5b74bb96df00' forge-prefect-agent
m
Your message was too long by 639 tokens - please shorten it and try again. For reference, here's your message at the allowed limit:
what could be causing this error?
06 de agosto de 2024 às 10:00 (UTC-3:00) 130003.207 | ERROR | prefect.agent - Failed to get infrastructure for flow run 'b562e072-6a51-4e28-8a85-5b74bb96df00'. forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) Traceback (most recent call last): forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) File "/usr/local/lib/python3.11/site-packages/prefect/agent.py", line 471, in submit_run forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) infrastructure = await self.get_infrastructure(flow_run) forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ forge-prefect-agent 06 de agosto de 2024 às 10:00 (UTC-3:00) File "/usr/local/lib/python3.11/site-packages/prefect/agent.py", line 452, in get_infrastructure forge-prefect-agent 06 de agosto de 2024 às 10:
k
@Marvin what could be causing this error? my flows don't iniciate KeyError: "No class found for dispatch key 'ecs-task' in registry for type 'Block'."
m
The error you're encountering, KeyError: "No class found for dispatch key 'ecs-task' in registry for type 'Block'., is typically related to the deprecation and replacement of certain Prefect functionalities. Specifically, the
ECSTask
has been deprecated in favor of the ECS worker. Here’s what you can do: 1. Upgrade to ECS Worker: The
ECSTask
class has been deprecated, and you should use the ECS worker instead. Refer to the upgrade guide for more information: Upgrade Guide from Agents to Workers 2. Check Your Flow Definition: Ensure that your flow definitions and configurations are updated to use the new ECS worker setup. For more detailed information, you can visit the relevant integration documentation for ECS: Prefect AWS ECS Integration By following these steps, you should be able to resolve the error and get your flows to initiate properly.
n
i would guess that you don't have prefect-aws installed somehow, so the block is not available
k
yes, this is strange, because it shows that prefect-aws is installed successfully