aws-samples / bedrock-claude-chat

AWS-native chatbot using Bedrock + Claude (+Mistral)
MIT No Attribution
688 stars 232 forks source link

[BUG] Get conversation does not find the conversationId #349

Closed PolicarpoDi closed 2 weeks ago

PolicarpoDi commented 3 weeks ago

Describe the bug

I published the api, and sent the post according to the documentation, thus generating conversationId and messageId. Then, I tried to test the Get Conversation endpoint, however, when passing the conversationId, it returns 404, as it says that the id I passed was not found.

To Reproduce

  1. According to the api created, I pass the body according to the documentation, and return the conversationId and messageId

postmessage

  1. With the conversationId in hand, I go to the get conversation endpoint

getconversation

but, as it appears on the screen, it gives a 404 error stating that it was not found.

  1. I checked the log of this request on coludwatch, but I didn't find anything that could help me solve this error.

Captura de tela 2024-06-06 170300

I saw that the chats are saved in dynamo, but I tried to search for this messageid or conversationId through Athena but I didn't find anything.

I would like to know where this data from the published api is saved (conversationId and messageId) and fix this bug so that I can have the response from the provided endpoints.

Thank you for your help.

statefb commented 3 weeks ago

Thank you for reporting this issue. To investigate, could you check dynamodb client's response and the primary keys?

PolicarpoDi commented 3 weeks ago

I checked on Dynamo, and I found the chat bot keys, but the one from the api has no record.

PolicarpoDi commented 3 weeks ago

however, in cloudwatc I found this error below. Would that be permission?

Captura de tela 2024-06-07 103402

PolicarpoDi commented 3 weeks ago

Sorted out.

It was a permission issue even for the referenced function.

After permission, the API is responding normally.

khchan123 commented 3 weeks ago

Also see the same issue, it is fixed after adding the permission manually to ApiPublishmentStackXXXX-HandlerRoleXXX.

        {
            "Action": [
                "secretsmanager:GetSecretValue"
            ],
            "Resource": [
                "arn:aws:secretsmanager:{REGION}:{ACCOUNT}:secret:VectorStoreClusterSecret{XXX}-{XXXX}"
            ],
            "Effect": "Allow"
        },