0xOX0X
Cloud & SaaS

Fixing AWS Bedrock Knowledge Base Sync and OpenSearch Errors

Quick Answer

Amazon Bedrock Knowledge Base sync failures are usually resolved by validating the execution role separately from its S3, KMS, and OpenSearch Serverless permissions. Put `bedrock.amazonaws.com` in the role trust policy, grant the role data access through IAM and applicable resource policies, and allow Bedrock in the OpenSearch Serverless network and data access policies.

By Devon ReedUpdated 2026-11-246 min read
3D isometric visualization of an AWS Bedrock RAG data ingestion pipeline showing S3 and vector database connectivity.

Diagnose Amazon Bedrock Knowledge Base Ingestion Job Failures

IAM Trust Relationship and service principal flow diagram for AWS Bedrock.

Start with the ingestion job record rather than elapsed time. A failed job can result from role assumption, S3 or KMS authorization, OpenSearch Serverless configuration, document parsing, or service quotas; job duration alone does not identify the cause.

Use the job status, failureReasons, and document statistics as the primary evidence:

bash
aws bedrock-agent get-ingestion-job \
  --knowledge-base-id KB_ID \
  --data-source-id DATA_SOURCE_ID \
  --ingestion-job-id INGESTION_JOB_ID

A FAILED status with populated failureReasons identifies the service-level failure. For COMPLETE jobs, review the returned document counts, including scanned, new, modified, deleted, metadata-modified, and failed documents. A completed job does not by itself prove that every source document was indexed.

Log / Error MessageWhat It MeansNext Check
AccessDenied or an assume-role failureBedrock cannot assume the execution role, or the role lacks access to a dependent resourceInspect the role trust policy, then its IAM policies and resource policies
S3 or KMS access-denied detailThe execution role cannot list, read, or decrypt source objectsCheck s3:ListBucket, s3:GetObject, bucket policy conditions, and KMS key policy
Vector index or collection validation errorThe OpenSearch Serverless collection, index, mapping, or Knowledge Base configuration does not matchConfirm a vector-search collection and the configured index and field names
OpenSearch authorization errorIAM permission, OpenSearch Serverless data access policy, or both are missingCheck aoss:APIAccessAll and the collection/index data access rules
Throttling or quota errorA documented service limit or dependent-service limit was reachedReview the exact error, service quotas, and OpenSearch Serverless capacity information

Verify the Bedrock Execution Role, S3 Access, and KMS Decryption

Symptom: The ingestion job reports an access-denied or role-assumption error.

Verification command:

bash
aws iam get-role --role-name YOUR_BEDROCK_KNOWLEDGE_BASE_ROLE

Output meaning: The trust relationship must allow the Bedrock service principal to call sts:AssumeRole. bedrock.amazonaws.com belongs in this trust policy; it is not an S3 permission.

Next fix: Grant S3 access to the execution role with an IAM identity policy. If the bucket policy is restrictive, it must also allow that role ARN. At minimum, the role normally needs s3:ListBucket on the bucket and s3:GetObject on the source-object prefix. Bucket-policy conditions such as organization IDs, VPC endpoint IDs, source IP addresses, or explicit denies can still block the role.

For SSE-KMS encrypted objects, verify both the role policy and the KMS key policy. The role needs permissions appropriate for reading the encrypted objects, commonly including kms:Decrypt; KMS key policy permissions or grants must permit the role as well. Do not assume that KMS denial always produces a successful job with zero chunks. Instead, inspect ingestion-job document failure statistics and failureReasons, then review relevant CloudWatch, CloudTrail, S3, and KMS service logs.

Configure OpenSearch Serverless Network and Data Access for Bedrock

Symptom: S3 access succeeds, but the job reports OpenSearch authorization, connectivity, index, or internal ingestion errors.

Verification command:

bash
aws opensearchserverless list-collections --collection-filters name=YOUR_COLLECTION_NAME

Output meaning: The collection used by a Bedrock Knowledge Base must be a vector search collection. Confirm that the collection is active and that the Knowledge Base configuration references the intended collection, index, vector field, text field, and metadata field.

Next fix: OpenSearch Serverless requires both IAM authorization and a data access policy. The execution role generally needs IAM permission to access the OpenSearch Serverless API, including aoss:APIAccessAll, while the OpenSearch Serverless data access policy must name that role as a principal and grant the required collection and index permissions.

A Bedrock Knowledge Base is not configured with customer VPC subnets or security groups. Do not create a supposed Bedrock-to-OpenSearch security-group path or rely on an inbound port-443 rule from a Bedrock security group. Instead, configure the OpenSearch Serverless network access policy for the collection to permit the Bedrock service through its supported service source, bedrock.amazonaws.com, when using private access. If public access is acceptable for the collection, evaluate that choice against your security requirements; a network policy can allow public access instead. Apply the policy to the collection endpoint required by the Knowledge Base.

The following is a complete OpenSearch Serverless data access policy example. Replace every YOUR_... value before use.

json
[
  {
    "Description": "Bedrock Knowledge Base access to the vector collection and index",
    "Principal": [
      "arn:aws:iam::YOUR_ACCOUNT_ID:role/YOUR_BEDROCK_KNOWLEDGE_BASE_ROLE"
    ],
    "Rules": [
      {
        "ResourceType": "collection",
        "Resource": [
          "collection/YOUR_COLLECTION_NAME"
        ],
        "Permission": [
          "aoss:CreateCollectionItems",
          "aoss:DeleteCollectionItems",
          "aoss:UpdateCollectionItems",
          "aoss:DescribeCollectionItems"
        ]
      },
      {
        "ResourceType": "index",
        "Resource": [
          "index/YOUR_COLLECTION_NAME/*"
        ],
        "Permission": [
          "aoss:CreateIndex",
          "aoss:DeleteIndex",
          "aoss:UpdateIndex",
          "aoss:DescribeIndex",
          "aoss:ReadDocument",
          "aoss:WriteDocument"
        ]
      }
    ]
  }
]

Select Amazon Bedrock Knowledge Base Chunking for the Data Source

Symptom: Ingestion completes, but retrieval quality, document counts, storage use, or ingestion time is unexpected.

Verification command: Review the data source's parsing and chunking configuration in the Bedrock console or its configured API definition, then compare it with the ingestion-job document statistics.

Output meaning: Available chunking choices depend on the data source and document-processing configuration. Supported options can include default chunking, fixed-size chunking, hierarchical chunking, semantic chunking, and no chunking. Custom transformation workflows may also alter documents before ingestion.

Next fix: Select a strategy based on document structure and retrieval needs. The commonly documented default chunking behavior is approximately 300 tokens with a 20% overlap for applicable default processing, but it is not a universal guarantee for every parser, source type, or configuration. Use fixed-size settings when explicit chunk boundaries are needed, hierarchical chunking for parent-child retrieval patterns, semantic chunking for content-driven boundaries, and no chunking only when each source object should remain a single unit.

For large files, clean source content and split unwieldy documents before upload when that improves document structure. If errors explicitly indicate OpenSearch Serverless capacity or quota pressure, review collection capacity and account quotas rather than adding client-side retry logic without evidence.

Verify Bedrock Knowledge Base Retrieval After a Successful Sync

Symptom: The ingestion job completes, but queries return no useful results.

Verification command: Run representative queries in the Bedrock Knowledge Base test interface or call the retrieval API, then compare citations and retrieved chunks with known source content.

Output meaning: Empty or irrelevant results can indicate that no eligible documents were indexed, metadata filters exclude the documents, the index field configuration is incorrect, or chunking does not fit the content.

Next fix: Confirm that the configured vector, text, and metadata field names match the OpenSearch index mapping. Review document-level ingestion failures, source prefixes, metadata filters, and retrieval results before changing embedding models or capacity. Record application-side retrieval latency and result quality with your own observability metrics; do not rely on an assumed CloudWatch relevanceScore metric. Investigate model-inference throttling only when API responses or service metrics specifically show it, because it is separate from Knowledge Base ingestion and OpenSearch retrieval configuration.

Share this article

Frequently Asked Questions

Can I use a different vector database instead of OpenSearch Serverless?

Yes, AWS Bedrock Knowledge Bases support Amazon Aurora (pgvector), Pinecone, MongoDB Atlas, and Redis Enterprise Cloud. Each requires its own specific IAM and network configuration, but the S3 ingestion logic remains the same.

How do I handle incremental updates in the S3 bucket?

Bedrock Knowledge Bases automatically handle incremental updates. When you trigger a sync, the service compares the S3 bucket state with the existing index and only processes new or modified files. Deleted files in S3 are also removed from the vector index during the next sync.

Why does my sync fail with 'KMS Key Not Found'?

This usually happens when the S3 bucket is encrypted with a customer-managed key (CMK) and the Bedrock execution role does not have the `kms:DescribeKey` permission. Ensure the role is added to the KMS Key Policy as a user.

Free Weekly Dispatch

Get the Weekly SMB AI & SaaS Brief

Practical software benchmarks, prompt templates, and ROI breakdowns delivered every Tuesday. No fluff, unsubscribe anytime.