Bedrock Knowledge base - Delete unsuccessful

0

Hello, I need help deleting a knowledge base.

Here is the setup. I have a knowledge base with a Data source pointing to Amazon S3 and the Vector database in Amazon OpenSearch Serverless. My mistake during deletion was to first delete the vector database, and now the knowledge base won't delete.

I have tried to change the Data deletion policy from Delete to Retain, however, I get this error "Error undefined The policy is attached to 0 entities but it must be attached to a single role". I have also tried to recreate the vector database in Amazon OpenSearch Serverless with the same name, however, the issue persists. I also gave the knowledge base role "AmazonBedrockExecutionRoleForKnowledgeBase_mwi7s" full access in IAM via the AdministratorAccess policy, but still no luck.

$ aws bedrock-agent delete-knowledge-base --knowledge-base-id ZEZMU36L77 { "knowledgeBaseId": "ZEZMU36L77", "status": "DELETING" }

$ aws bedrock-agent get-knowledge-base --knowledge-base-id ZEZMU36L77 { "knowledgeBase": { "createdAt": "2024-05-23T13:26:14.221173+00:00", "failureReasons": [ "Unable to delete data from vector store for data source with ID LNZRBILGCR. Check your vector store configurations and permissions and retry your request. If the issue persists, consider updating the dataDeletionPolicy of the data source to RETAIN and retry your request." ], "knowledgeBaseArn": "arn:aws:bedrock:us-west-2:xxxxxxxxxxxx:knowledge-base/ZEZMU36L77", "knowledgeBaseConfiguration": { "type": "VECTOR", "vectorKnowledgeBaseConfiguration": { "embeddingModelArn": "arn:aws:bedrock:us-west-2::foundation-model/amazon.titan-embed-text-v1" } }, "knowledgeBaseId": "ZEZMU36L77", "name": "knowledge-base-quick-start-mwi7s", "roleArn": "arn:aws:iam::xxxxxxxxxxxx:role/service-role/AmazonBedrockExecutionRoleForKnowledgeBase_mwi7s", "status": "DELETE_UNSUCCESSFUL", "storageConfiguration": { "opensearchServerlessConfiguration": { "collectionArn": "arn:aws:aoss:us-west-2:xxxxxxxxxxxx:collection/nwqjke9vs8jsi3n1t2zi", "fieldMapping": { "metadataField": "AMAZON_BEDROCK_METADATA", "textField": "AMAZON_BEDROCK_TEXT_CHUNK", "vectorField": "bedrock-knowledge-base-default-vector" }, "vectorIndexName": "bedrock-knowledge-base-default-index" }, "type": "OPENSEARCH_SERVERLESS" }, "updatedAt": "2024-05-23T20:59:55.814904+00:00" } }

  • I am happy to share that I finally managed to delete my knowledge base. If you ask me how I managed to delete it this time, I cannot tell you. I did the same steps I followed before, but this time it worked, it got deleted, I was even surprised. By the way, AWS was not able to assist me when I logged a case with them.

    I have a suspicion that AWS might have done something in the background in the past few months because it didn't make sense that I was not able to delete the data source within my knowledge base due to a deleted vector database.

    If you have a similar issue, I will urge you to try to delete again and follow the procedure of deleting the data source with dataDeletionPolicy as RETAIN. If this works for many of you as well, my suspicion that AWS did something will be true.

    All the best, and keep building.

8 Answers
2

Hello.

Will it not be deleted even after some time?
In the worst case scenario, you can reduce the cost by deleting only OpenSearch Serverless, so I recommend deleting only this first.
https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html#serverless-delete

It is possible that the problem is on the AWS side, so I recommend that you open a case with AWS Support under "Account and billing".
Inquiries under "Account and billing" can be made free of charge.
https://docs.aws.amazon.com/awssupport/latest/user/case-management.html

profile picture
EXPERT
answered a year ago
1

Hello,

I was in same situation and fixed by doing:

  1. Delete OpenSearch collection

  2. Update data deletion policy: Consider changing the dataDeletionPolicy of the data source to RETAIN instead of DELETE. This can be done by editing the advanced settings of your knowledge base.(Go to amazon Bedrock console > knowledge base, select the knowledge base you want to delete and click on Edit)

  3. Delete data source while the dataDeletionPolicy was in DELETE

  4. After deleting data source , delete knowledge base with dataDeletionPolicy in RETAIN

Enter image description here

answered 10 months ago
1

Have you managed to delete it yet? I have the same problem.

answered 10 months ago
0

The problem here is on the AWS side, and the solutions suggested by support are flimsy and incomplete.

Changing the dataDeletionPolicy to RETAIN does work. But ONLY if your knowledge base doesn't get stuck in a deletion state (mine has been stuck for over a week).

answered 7 months ago
0

Maybe due to root-user authentication, the knowledge base got stuck in a deletion state. I switched from the root user to another admin user and was finally able to delete all the resources in the knowledge base using vianney01's method.

answered 7 months ago
0

I am happy to share that I finally managed to delete my knowledge base. If you ask me how I managed to delete it this time, I cannot tell you. I did the same steps I followed before, but this time it worked, it got deleted, I was even surprised. By the way, AWS was not able to assist me when I logged a case with them.

I have a suspicion that AWS might have done something in the background in the past few months because it didn't make sense that I was not able to delete the data source within my knowledge base due to a deleted vector database.

If you have a similar issue, I will urge you to try to delete it again and follow the procedure of deleting the data source with dataDeletionPolicy as RETAIN. If this works for many of you as well, my suspicion that AWS did something will be true.

All the best, and keep building.

answered 7 months ago
0

I encountered the same issue and wrote a bug report about it. In the end, switching the AWS Console language to English resolved the problem.

https://repost.aws/ko/questions/QUVFQSxtdyR_e1S68CIJ5bWQ/bug-report-the-issue-of-being-unable-to-delete-bedrock-knowledge-resources-depending-on-the-language

answered 7 months ago
0
  • if you are still searching for this, open the data source under knowledge bases
  • click edit
  • additional settings
  • Change data Retention to retain ( it will be at default)
  • Save
  • Delete data source
  • wait 3-5 mins
  • Delete Knowledge Bases
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions