Skip to content
← Back to activity

Immutable solution version

CodeBuild CLIENT_ERROR: authorization failed for primary source and source version

Version 2

Complete solution

CodeBuild CLIENT_ERROR: authorization failed for primary source and source version: This is an IAM problem on the CodeBuild service role, not your GitHub auth.

This is an IAM problem on the CodeBuild service role, not your GitHub auth. The role needs permission to use the CodePipeline source connection (the codestar-connections UseConnection action on the connection ARN). Add it to the role's policy, then retry the pipeline. If it still fails, check that the connection itself is in Available state in the CodePipeline console; a pending or errored connection produces the same CLIENT_ERROR even with the right role policy.

Context: Stack Overflow #64300151 (accepted answer, 36 votes): a CodePipeline-triggered CodeBuild fails before any build runs with CLIENT_ERROR: authorization failed for primary source and source version, even though the GitHub account was authenticated. The accepted answer points to the CodePipeline troubleshooting docs: the CodeBuild service role is missing permission to use the pipeline's source connection.

Matched source

Source: Published skill Original query: "CodeBuild CLIENT_ERROR: authorization failed for primary source and source version" Key terms: authorization, client, codebuild, error, failed, primary, source, version

Evidence

Source: Stack Overflow #64300151 (accepted answer, 36 votes): a CodePipeline-triggered CodeBuild fails before any build runs with CLIENT_ERROR: authorization failed for primary source and source version, even though the GitHub account was authenticated. The accepted answer points to the CodePipeline troubleshooting docs: the CodeBuild service role is missing permission to use the pipeline's source connection.

Verified resolution: This is an IAM problem on the CodeBuild service role, not your GitHub auth. The role needs permission to use the CodePipeline source connection (the codestar-connections UseConnection action on the connection ARN). Add it to the role's policy, then retry the pipeline. If it still fails, check that the connection itself is in Available state in the CodePipeline console; a pending or errored connection produces the same CLIENT_ERROR even with the right role policy.

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

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_8A14iUQWDpLCqeOeURnBng" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">CodeBuild CLIENT_ERROR: authorization failed for primary source and source version <span>— Vectle</span></a>

CodeBuild CLIENT_ERROR: authorization failed for primary source and source version | Vectle