AWS Kendra's post extract Lambda not working on big collection

62 views Asked by At

I just created Lambda for Kendra to enrich post extract metadata - calling bedrock to get summary from document, category and add to metadata. It's working fine for 1 or couple documents. But when I call it for index that have over 140 documents, it's stop working after 20-30 documents and some documents fail. I know maximum running time for document enrichment is 60 sec for one lambda running, so I don't know, Kendra isn't calling lambda for every single document instead use this 60 sec for all documents ? Has anyone have an answer for that ? Thanks,

Response from kendra (just one document, fails 110) log:

"ErrorMessage":"Custom Document Enrichment faced failure of \"There was error executing your lambda function: arn:aws:xxxxxxxxx\", please fix corresponding configuration and try again","ErrorCode":"400"}
@timestamp  
1700829218711
DocumentId  
xxxxxxx
ErrorCode   
400
ErrorMessage    
Custom Document Enrichment faced failure of "There was error executing your lambda function: arn:aws:lambda:xxxxxxxxxx", please fix corresponding configuration and try again

No single error in lambda logs.

Java code for lambda:

  @Bean
  public Function<LambdaRequest, LambdaResponse> postHook(PostHookService postHookService) {
    return (s) -> postHookService.process(s.s3Bucket(), s.s3ObjectKey());
  }
0

There are 0 answers