testdriven.io flask react AWS course chapter 9 codebuild error. All phases pass except the post_build phase

195 Views Asked by At

There are log snips:

[Container] 2020/09/02 16:36:03 Running command docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/test-driven-users:prod
no basic auth credentials
COMMAND_EXECUTION_ERROR: Error while executing command: docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/test-driven-users:prod. Reason: exit status 1
[Container] 2020/09/02 16:36:03 Phase complete: POST_BUILD State: FAILED

Why is it using basic auth instead of tokens? How do I address this error?

1

There are 1 best solutions below

0
On

The errors were a bit misleading. The actual failure is with the buildspec.yml post_build commands. Commenting out these commands out "fixed" the build. These commands were supplied by the tutorial:

docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/test-driven-users:prod
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/test-driven-client:builder
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/test-driven-client:prod

Running them from the command line I get this: The push refers to repository [###########.dkr.ecr.us-west-1.amazonaws.com/test-driven-users]

6f23####16de: Layer already exists 
5317####098c: Layer already exists 
...

So I guess if it already exists it's a "failure."