본문 바로가기

Data Engineering/Cloud

[AWS] Troubleshooting Kendra indexing Error

문제 출처

AWS Kendra Data source 진행 중에 30개의 index 문서 중 27개의 문서만 동기화가 완료됐다.

나머지 일부분에 대해서 Added가 되지 않고 루프가 도는 상황 발생..

2일 정도 켄드라를 켜놨는데 동기화되는 document가 왔다갔다 하는 현상을 발견했다.

계속 인덱싱이 진행됐고, 원래대로라면 2시간 이내로 인덱싱 작업이 끝났어야 했다.

Cloudwatch를 뜯어보니, 

DocumentFailedToIndex라는 에러가 발생하였고,

Failed to process the document because another newer document revision is currently being processed

 

라는 에러메시지를 확인했다.

다음은 AWS 공식문서에 나와있는 내용이다

해결방법

https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html#iam-roles-ds

 

IAM access roles for Amazon Kendra - Amazon Kendra

IAM access roles for Amazon Kendra When you create an index, data source, or an FAQ, Amazon Kendra needs access to the AWS resources required to create the Amazon Kendra resource. You must create a AWS Identity and Access Management (IAM) policy before you

docs.aws.amazon.com

1. IAM data source s3에 대해 권한 추가

{
    "Version": "2012-10-17",
    "Statement": [
         {
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::bucket-name/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::bucket-name"
            ],
            "Effect": "Allow"
        },
        {
            "Effect": "Allow",
            "Action": [
                "kendra:BatchPutDocument",
                "kendra:BatchDeleteDocument"
            ],
            "Resource": [
                "arn:aws:kendra:your-region:your-account-id:index/index-id"
            ]
        }
    ]
}

 

 

위 방법으로 진행했더니, 28개의 데이터만 Added가 됐음을 확인

 

2. 문서 쪼개기

확인해보니 문서의 데이터가 가장 많이 들어가있는 Top 문서 2개임을 확인했고, 이를 문서 3개씩으로 쪼개서 인덱싱 진행했다.

 

모두 Succeded가 됐음을 확인했다.

 

기타사항

뭔가 kendra 내에서 들어올 수 있는 데이터, 혹은 (한글)바이트 양이 정해져서 그 이후로 들어가게되면 루프가 도는것 같다..

반응형