View a markdown version of this page

Troubleshoot structured data grounding - AWS Context

Troubleshoot structured data grounding

This topic lists problems that you might encounter when you ground AWS Glue Data Catalog tables in an ontology. For each problem, it gives the cause and what to do. For the tasks, see Start grounding by associating an ontology, Review and edit grounding proposals, and Turn grounding off and on.

ValidationException: mapping a custom ontology to a catalog connection

The connection mapping fails with a ValidationException. This happens when you map a custom ontology on an AWS Glue Data Catalog connection. A connection mapping accepts a custom ontology only on an Amazon Bedrock Managed Knowledge Base connection. On an AWS Glue Data Catalog connection, the mapping uses the built-in Data ontology.

To ground your tables in a custom ontology, associate the ontology with the Agent Context instead. For more information, see Start grounding by associating an ontology.

FAILED: the association task doesn’t import an ontology

GetTask returns the status FAILED for the association task. At least one ontology wasn’t imported. The task might have imported the other ontologies. The statusMessage has the form "Imported <n> of <m> ontologies. Failed: <details>", where <details> names each ontology that failed and why. On the console, the task’s run status in the Customization tasks table shows that it failed.

statusReasonCode gives the reason for the first ontology that failed. The following list describes each code and what to do:

  • ONTOLOGY_INVALID – The ontology is missing, it has no source that AWS Context can load, or its source isn’t valid. Check the ontology’s ID and status. If its source isn’t valid, upload a corrected source as a new ontology. Then start a new task.

  • ONTOLOGY_ALREADY_IMPORTED – The ontology is already loaded in the Agent Context. Grounding already ran, or is running, for it. You can’t associate it again. To make grounding check every table again, associate a different published ontology, for example an edited copy that you upload as a new ontology. For more information, see Bring your own ontology.

  • GRAPH_NOT_ACTIVE – The Agent Context isn’t available. For example, it was deleted after the task started. Check the Agent Context’s status with GetAgentContext.

  • ONTOLOGY_IMPORT_UNAVAILABLE – The import didn’t complete for a temporary reason. Start a new task.

If statusReasonCode is missing, AWS Context couldn’t run the import. The statusMessage says what to do, such as to contact AWS Support.

To start a new task for only the ontologies that failed, list only those ontologies in ontologies. For the request fields, see StartTask request fields for associating an ontology.

StartTask itself can fail before a task starts. If it fails with a ValidationException, check the request against StartTask request fields for associating an ontology. If you reused a client token with different parameters, the ValidationException says so: send a new client token.

ValidationException: approving a held import fails

AcceptCurationProposal fails with a ValidationException that gives the reason. This can happen when a curation policy held an ontology import for review. The proposal and its change set end with status FAILED. When you approve the proposal, AWS Context loads the ontology. The load can’t succeed when the ontology was deleted, its source can’t be read or is too large, or a newer load of the ontology replaced this one.

To try again, start a new association task. If you deleted the ontology, or AWS Context can’t load its source, upload a corrected source as a new ontology, and then associate that ontology. For more information, see Bring your own ontology and Associate an ontology with the API.

No grounding proposals appear

The curation queue shows no proposals that Ontology grounding generated. This happens when a condition that grounding needs isn’t met, so grounding can’t run.

To find and fix the cause, do the following:

  1. Make sure that the association task imported the ontology, and that a curation policy doesn’t still hold the import for review. A task with the status FAILED might not have imported it. For more information, see Start grounding by associating an ontology and FAILED: the association task doesn’t import an ontology.

  2. Make sure that your tables appear in the Agent Context.

  3. Make sure that entity resolution is ENABLED for the Agent Context. For more information, see Turn grounding off and on.

  4. Make sure that the ontology is a custom ontology, not a built-in ontology. For more information, see Prerequisites for structured data grounding.

  5. Make sure that the curation queue isn’t full of proposals that wait for review. If it is, approve or reject some of them. If the queue stayed full for 24 hours, grounding stopped checking the remaining tables. For more information, see How structured data grounding works.

ConflictException: you can’t approve or reject a proposal

AcceptCurationProposal or RejectCurationProposal fails with a ConflictException. This happens in the following cases:

  • The proposal changed after you read it, so your revisionId is out of date. For example, someone dropped links from it.

  • The proposal no longer waits for review. For example, someone already approved or rejected it, or its auto-reject window ended.

Call GetCurationProposal to read the proposal’s current status and revisionId. If the status is still PENDING_REVIEW, approve or reject it again with the new revisionId. For the request fields, see AcceptCurationProposal and RejectCurationProposal request fields.

If you reuse a client token from a request for another proposal, the call fails with a ValidationException instead. Send a new client token.

You can’t drop links from a proposal

If AWS Context can’t drop the links, UpdateChangeSet fails, and the change set doesn’t change. The following list describes each exception and what to do:

  • ValidationException – The request breaks a rule for editing a grounding proposal. For example, you can’t drop a table’s link to a class without dropping its column links in the same request. Each entry in operationsToRemove must match exactly one current operation. Check the request against Rules for editing a grounding proposal. You also get this exception when you reuse a client token for another change set or a different request. Send a new client token.

  • ConflictException – The changeSetVersion that you sent isn’t the latest, or the proposal no longer waits for review. Another request might also have changed the proposal at the same time. Call GetChangeSet again, and then try again with the latest changeSetVersion. For the request fields, see UpdateChangeSet request fields.

After an edit, a nextToken from an earlier ListChangeSetOperations response fails with a ValidationException. Call ListChangeSetOperations again without a nextToken.

Next steps

After you ground your tables, you can do the following: