aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
456 stars 115 forks source link

Unable to clone repo (403) at Build step #572

Closed F-JJTH closed 4 years ago

F-JJTH commented 4 years ago

Hi, using AWS Amplify Console App I try to deploy an app with the built-in «Provision, Build, Deploy, Verify» feature.

Unfortunately the Build step fails with the log below. I already «re-connected the repository» twice then re-launch build but it still fails.

How can I get the «Build» step successfully clone my codecommit repository ?

[INFO]: # Cloning repository: https://git-codecommit.eu-west-1.amazonaws.com/v1/repos/xyz-my-repository [INFO]: Cloning into 'xyz-my-repository'... [INFO]: fatal: unable to access 'https://git-codecommit.eu-west-1.amazonaws.com/v1/repos/xyz-my-repository/': The requested URL returned error: 403 [ERROR]: !!! Unable to clone repository. [INFO]: # Starting environment caching... [INFO]: # Environment caching completed Terminating logging...

Regards,

ihao8 commented 4 years ago

Hi @F-JJTH , I can't reproduce your issue. Would you mind re-connect your app? If that doesn't work, would you mind provide your appId and region? (App Setting => General => App ARN => arn:aws:amplify:${region}:xxxxxx:apps/${appId})

F-JJTH commented 4 years ago

@Joycehao19 , I clicked the «Reconnect repository» button and followed the procedure but the build still fails. However I can't see «Reconnect app» button, am I looking at the wrong place ?

Workspace 1_087

My region is : eu-west-1 My appID is : d22wnu0es6yoja

ihao8 commented 4 years ago

Thank you for providing your appId and region. Sorry, I mean that if you could go to All apps, click Connect app, the AWS CodeCommit to re-build a new app.

F-JJTH commented 4 years ago

All right, I clicked Connect app and followed the procedure, now git clone works

... after a couple of minutes my application is now deployed :-)

Thanks for your efficient help

trungegd commented 4 years ago

I have same problem. 2020-07-17T09:55:07.190Z [INFO]: # Cloning repository: https://git-codecommit.us-east-1.amazonaws.com/v1/repos/myApp 2020-07-17T09:55:07.664Z [INFO]: Cloning into 'myApp'... 2020-07-17T09:55:14.362Z [INFO]: fatal: unable to access 'https://git-codecommit.us-east-1.amazonaws.com/v1/repos/myApp/': The requested URL returned error: 403 2020-07-17T09:55:14.365Z [ERROR]: !!! Unable to clone repository. 2020-07-17T09:55:14.457Z [INFO]: # Starting environment caching... 2020-07-17T09:55:14.459Z [INFO]: # Environment caching completed Terminating logging...

My App ARN is: arn:aws:amplify:us-east-1:751062960773:apps/d1a6rku7rwx15v

Please support for me this problem. Thanks in advance!

linfiesto commented 4 years ago

I also can't clone repository but has a different error. I've reckon it's a permission issue but don't know how to proceed, I've already made sure I have AdministratorAccess on my IAM account.

It says [ERROR]: !!! Unable to assume specified IAM Role. Please ensure the selected IAM Role has sufficient permissions and the Trust Relationship is configured correctly.

image

thanhnv2210 commented 4 years ago

You should try to add Service role to have permission to accept codecommit image this is sample about policy: image

codingme commented 4 years ago

I tried this and it worked! Adding a Service Role to the Amplify Console When You Connect an App So it is the role problem.

dbtrnl commented 3 years ago

Had the same issue. I deployed an app in the wrong region and had to delete it. But the role it created remained.

Solved by deleting the previous role (IAM Dashboard > Roles > AWSAmplifyExecutionRole-[instanceID]), as it was pointing to the wrong instance, then let AWS create a new role by selecting "Read-only access to your repository with a new service role".

mjza commented 3 years ago

I had the same problem. We had already a AmplifyConsoleServiceRole-AmplifyRole role. I moved to IAM Management Console and then selected roles from the side menu.

Then in the list looked for AmplifyConsoleServiceRole-AmplifyRole role and pressed on the Change boundary button and in the list searched and selected AWSCodeCommitReadOnly. This helped me to pass this error.

MiqueiasGFernandes commented 3 years ago

I had same issue, any solution or AWS team answer?

josimarz commented 3 years ago

Hello, If you are facing this problem, check if the Service Role associated with your app has permission to access the desired repository in AWS CodeCommit.

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.