aws-samples / serverless-pdf-chat

LLM-powered document chat using Amazon Bedrock and AWS Serverless
https://aws.amazon.com/blogs/compute/building-a-serverless-document-chat-with-aws-lambda-and-amazon-bedrock/
MIT No Attribution
228 stars 206 forks source link

Issues deploying Amplify CREATE_FAILED #11

Closed joao-d-oliveira closed 11 months ago

joao-d-oliveira commented 11 months ago

Issues deploying the app in amplify. Getting errors when deploying sam with "sam deploy --guided". I believe the issue lies on the AWS Secrets... but not sure. If that's the case, perhaps we could specify better the instructions.

Errors

CREATE_FAILED                            AWS::Amplify::App                        AmplifyApp                               Resource handler returned message:     
                                                                                                                           "Invalid request provided: Repository  
                                                                                                                           provider not supported. (Service:      
                                                                                                                           Amplify, Status Code: 400, Request ID: 
                                                                                                                           xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx)" 
                                                                                                                           (RequestToken:                         
                                                                                                                           xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx,  
                                                                                                                           HandlerErrorCode: InvalidRequest)      
UPDATE_ROLLBACK_IN_PROGRESS              AWS::CloudFormation::Stack               serverless-bedrock-goatai-chat           The following resource(s) failed to    
                                                                                                                           create: [AmplifyApp]. 

Steps created

  1. Linked Amplify with my repository
  2. Deployed in amplify the repository
  3. Added a secret in: AWS Secrets Manager > Secrets > Store a new secret
    • Choose Other type of secret
    • Tried different things:
      • Key/Value (github_pat_T2wyo:rs0Pp) (it show in plaintext: {"github_pat_T2wyo":"rs0Pp"})
      • Plaintext: 'github_pat_T2wyo------------------------------------------------------------------------rs0Pp'
  4. Try to deploy the backend sam deploy --guided
pbv0 commented 11 months ago

Hi Joao, just to make sure:

joao-d-oliveira commented 11 months ago

hi @pbv0 thanks for replying!

By did you create your own GitHub fine-grained access token? if you mean connect Amplify with my GitHub repo and provided access then yes I have done so. If you mean something else, than that might be the missing piece.

All the other steps I have done. It does find the secret (I had initially named something else and got a different error).

joao-d-oliveira commented 11 months ago

I realised that I hadn't created a Fine-grained personal access tokens, only connected AWS to GH repo.

So now I tried to:

Still I get the same error:

CREATE_FAILED                            AWS::Amplify::App                        AmplifyApp                               Resource handler returned message:     
                                                                                                                           "Invalid request provided: Repository  
                                                                                                                           provider not supported. (Service:      
                                                                                                                           Amplify, Status Code: 400, Request ID: 
                                                                                                                           xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx)" 
                                                                                                                           (RequestToken:                         
                                                                                                                           xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx,  
                                                                                                                           HandlerErrorCode: InvalidRequest)      
UPDATE_ROLLBACK_IN_PROGRESS              AWS::CloudFormation::Stack               serverless-bedrock-goatai-chat           The following resource(s) failed to    
                                                                                                                           create: [AmplifyApp]. 
pbv0 commented 11 months ago

The error message points to Amplify not recognizing the repository provider which should be GitHub. This could be if the URL to the repository is wrong but if you are using https://github.com/joao-d-oliveira/serverless-pdf-chat that would be correct. Are you using https in the URL?

joao-d-oliveira commented 11 months ago

@pbv0 thanks for your patience... I realised when you meant on the script "repository" you meant the GitHub link to the repository... I thought that I was supposed to create a amplify app already with the repository and link to the AWS amplify...

So I was providing the script with the Amplify https... instead of the GH repository, I understood now that the SAM created the app, ...

Sorry for the trouble and thanks once again!

pbv0 commented 11 months ago

No worries, thanks for documenting what the issue was.