hackoregon / devops-17

deployment tools for Hack Oregon projects
4 stars 3 forks source link

Docker Login: Error response from daemon: login attempt to [URL] failed with status: 403 Forbidden #43

Closed MikeTheCanuck closed 7 years ago

MikeTheCanuck commented 7 years ago

Problem

At the point of the push.sh script where it calls docker login..., this Travis build for the backend-service-pattern reports the following error:

Error response from daemon: login attempt to https://845828040396.dkr.ecr.us-west-2.amazonaws.com/v2/ failed with status: 403 Forbidden

In the Raw Log further down from that request, we also see the log entry:

no basic auth credentials

I'm also seeing the first error for the attempted deploy of the Budget backend.

Analysis

The second message may be unrelated to the first, but the first message is a definite error.

Question is, does this error mean that the subsequent docker push command doesn't succeed, and the ecs-deploy.sh script is re-using an old container image?

Or is the "403 Forbidden" error a false negative, and the docker push is still succeeding (and we're deploying the updated container)?

MikeTheCanuck commented 7 years ago

On the basis of my latest build, I have to believe that this error is getting in the way of my deploy.

In Travis build 216 on line 432-444, I see no other errors until "ERROR: New task definition not running within 90 seconds", and until I have evidence otherwise, I'd guess this is because we're not actually successfully upload the new container image, so that when the ECS script attempts to deploy, there's nothing in the AWS container registry for us to deploy.

MikeTheCanuck commented 7 years ago

This specific commit resolved the issue.

It turns out that from what @pdxdiver found out, "login token expires after 12 hours".

So he researched the options and came up with this more durable solution.

Thanks Dan!