<@ULVA73B9P> Submission failed. KeyError: "No clas...
# marvin-in-the-wild
k
@Marvin Submission failed. KeyError: "No class found for dispatch key 'ecs-task' in registry for type 'Block'." See Less
m
Ah, a cryptic KeyError! Classic. Let's find out which version of Prefect you're using to dig through the correct docs for you. Which version is it, 2.x or 3.x?
k
2.14.21 @Marvin
m
Based on your Prefect version (2.14.21), it seems this error may be related to ECS tasks and how blocks are registered. To resolve the issue, ensure that the ECS block is correctly defined and registered in your Prefect setup. Here's the ECS guide from Prefect's docs which might be relevant. Verify your ECS task definitions align with Prefect's expectations. For specific steps: 1. Confirm the ECS block is imported and registered correctly in your environment. 2. Ensure necessary configurations for your ECS work pool and task definitions are set. If the problem persists, could you share the code snippet where this issue arises? That might help pinpoint the exact problem.
k
@Marvin raise ValueError( ValueError: Unable to find block document named aws-homolog-credential for block type aws-credentials
m
It looks like the issue is that the AWSCredentials block named
aws-homolog-credential
is not found. Here's how you can create and register this block correctly: 1. Register Block:
Copy code
shell
   prefect block register -m prefect_aws
2. Create Block in UI: - Go to the Prefect UI blocks page. - Click on the "+" to add a new block. - Select
AWS Credentials
from the list. - Enter the necessary values for AWS Access Key ID and Secret Access Key. - Name the block
aws-homolog-credential
. Ensure you have these definitions set correctly, and try running your task again. Here’s the link to the blocks guide. If the issue persists, feel free to share more details!
k
raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.cause prefect.exceptions.PrefectHTTPStatusError: Client error '404 Not Found' for url 'https://api.prefect.cloud/api/accounts/-/workspaces//block_types/slug/aws-credentials/block_documents/name/aws-homolog-credential?include_secrets=true' Response: {'detail': 'Not Found'} @Marvin
m
Seems like there's an HTTP 404 error indicating that the block
aws-homolog-credential
can't be found at the specified URL. This typically means the block either hasn't been created successfully or there's an issue with your Prefect Cloud account/workspace setup. Steps to troubleshoot: 1. Verify Block Registration: Make sure to register the AWS block types using:
Copy code
sh
   prefect block register -m prefect_aws
2. Check Workspace: Ensure your Prefect Cloud account and workspace are correctly set up and you're logged in. You can do this by:
Copy code
sh
   prefect cloud login
3. Create the Block in the Prefect UI: Go to the Prefect UI: - Navigate to the Blocks page and click the "+" button to add a new block. - Select
AWS Credentials
from the list. - Enter the name
aws-homolog-credential
and fill out the necessary fields (Access Key ID and Secret Access Key). 4. Retrieve the Block: Ensure the block can be retrieved using the correct workspace and identifier. If you've verified all the above steps and the error persists, double-check the block's name and your workspace settings in Prefect Cloud to ensure there are no typos or misconfigurations. Let me know if you need more assistance!