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.