Action execution failed

0

I create the pipline in aws, i get a error during build stage, i.e. Action execution failed, i check my code build it shows below "CLIENT_ERROR: authorization failed for primary source and source version 8808534c43ab2489731ef9f4a9b0678c6853e95a" so what is my next step to solve this?

Anthu
asked a year ago1083 views
2 Answers
0

https://stackoverflow.com/questions/64300151/aws-codebuild-failed-client-error-authorization-failed-for-primary-source-and-s

you can follow these steps for the solution

Ensure CodeBuild role has the necessary permissions: The CodeBuild role needs to have permission to access and use the CodePipeline connection​.

Reauthenticate with GitHub: It's possible that reauthenticating with GitHub could resolve the issue. You can do this by disconnecting and then re-authenticating to GitHub in the CodeBuild settings of your job. Be sure that you still have access to the access token used to connect to GitHub before disconnecting​.

Check CodeBuild and CodePipeline IAM Roles: In AWS CodePipeline, the CodeBuild Project uses a different IAM Role than the CodePipeline itself. If your CodeBuild Project is getting the source from an S3 bucket which was pulled by CodePipeline in the previous stage (this depends on your settings), then the CodeBuild Role needs to have both CodeStar and S3 permissions. If your source is coming from GitHub, you'll need to ensure that the CodeBuild Role has 'codestar-connections:*' permission. You might need to add more policies for the CodeBuild Role. To know the clear root cause, you can refer to the CloudTrail > Event History. It shows which event and sources occurred issues​.

profile picture
EXPERT
answered a year ago
  • I commit the code from bitbucket repo. and connect the bitbucket in aws pipline, so i have the error "Action execution failed", i check my code build it shows below "CLIENT_ERROR: authorization failed for primary source and source version 8808534c43ab2489731ef9f4a9b0678c6853e95a, so how to connect bitbucket to aws pipline properly, and how to solve this?

  • I have added another step by step guide please check hope it works for you

0

https://docs.aws.amazon.com/codepipeline/latest/userguide/connections-bitbucket.html

It seems like the error you're facing is related to the authorization between Bitbucket and AWS CodePipeline. Here are the steps you should follow to properly connect your Bitbucket repository to your AWS CodePipeline:

  1. Ensure you have created an account with the provider of the third-party repository, in this case, Bitbucket.
  2. You must have already created a third-party code repository, such as a Bitbucket repository.
  3. Bitbucket connections only provide access to repositories owned by the Bitbucket account that was used to create the connection.
  4. If the application is being installed in a Bitbucket workspace, you need Administer workspace permissions. Otherwise, the option to install the app will not display.

You can establish this connection either using the AWS Management Console or the AWS CLI:

Using AWS Console:

  1. Sign in to the CodePipeline console and create or edit your pipeline.
  2. Choose Bitbucket as the Source Provider.
  3. Under Connection, if you have not already created a connection to your provider, choose 'Connect to Bitbucket'. If you have already created a connection to your provider, choose the connection.
  4. On the Connect to Bitbucket settings page, enter your connection name and choose 'Connect to Bitbucket'. Under Bitbucket apps, choose an app installation or choose 'Install a new app' to create one.
  5. If you are using a Bitbucket workspace, change the 'Authorize for' option to the workspace. Only workspaces where you have administrator access will display. Choose 'Grant access'.
  6. In Repository name, choose the name of your third-party repository. In Branch name, choose the branch where you want your pipeline to detect source changes.
  7. In Output artifact format, you must choose the format for your artifacts. To store output artifacts from the Bitbucket action using the default method, choose 'CodePipeline default'.
  8. Choose 'Next' on the wizard or 'Save' on the Edit action page​.

Using AWS CLI:

  1. Open a terminal (Linux, macOS, or Unix) or command prompt (Windows). Use the AWS CLI to run the create-connection command, specifying the --provider-type and --connection-name for your connection. In this example, the third-party provider name is Bitbucket and the specified connection name is MyConnection.
aws codestar-connections create-connection --provider-type Bitbucket --connection-name MyConnection
  1. Use the console to complete the connection. After you create a connection with the CLI, its status is PENDING by default. Use the console to edit the connection to make its status AVAILABLE​.

Remember that connections can only be created to a Bitbucket Cloud repository. Installed Bitbucket provider types, such as Bitbucket Server, are not supported.

profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions