0
votes

I'm trying to trigger multiple builds with CodePipeline (AWS) and when the pipeline trigger a CodeBuild, the CodeBuild fail with the next error:

[Container] 2018/02/07 19:30:20 Waiting for DOWNLOAD_SOURCE

Message: Access Denied

Extra information:

  • The source is coming from Github
  • If I start the CodeBuild manually works perfectly.

enter image description here

enter image description here

3

3 Answers

6
votes

I just discovered this the other day. I'm not sure if it's documented anywhere, but it's definitely not clear in the Code Pipeline UI.

Any CodeBuild project that CodePipeline initiates must have been created through the CodePipeline UI. It cannot be a "standalone" CodeBuild project.

When you create a CodeBuild project from the CodePipeline UI, the "Source Provider" setting is "AWS CodePipeline", which is not an available choice when you create the CodeBuild project yourself.

CodePipeline retrieves it's own source code from GitHub. It then passes that source code to your CodeBuild project. If your project is getting it's own source code from GitHub, then that seems to cause the issue you describe:

[Container] 2018/02/06 14:58:37 Waiting for agent ping
[Container] 2018/02/06 14:58:37 Waiting for DOWNLOAD_SOURCE

To resolve this issue, you must edit your CodePipeline "build" stage, and choose "Create a new build project" under "AWS CodeBuild, Configure Your Project". You can copy most settings from your existing project and reuse the buildspec.yml file in your source code.

2
votes

I had the same exact error. Codebuild worked fine when I ran it alone, but in order to make it work in CodePipeline I had to update my CodePipeline role to allow access to the S3 bucket.

2
votes

The way to resolve this issue was creating the CodeBuild with the CodePipeline Wizard creation. In this way the wizard gives to the CodeBuild the necessary privileges.