vitorfhc / bob

Bob is an automated tool for building and pushing multiple Docker images in a monorepo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] No useful error message is presented when Docker registry doesn't exist

vitorfhc opened this issue · comments

When running bob push and the image has an inexistent registry Docker retries it several times:

docker push inexistent-repo/image:tag
The push refers to repository [inexistent-repo/image:tag]
64ed87b762b2: Retrying in 1 second 
2c0fb72ca8a6: Retrying in 1 second 
2177fb7bef02: Retrying in 1 second 
3759e3bc07e3: Retrying in 1 second 
81b311630260: Retrying in 1 second 
c85c09c7fd7c: Waiting 
27f852d51452: Waiting 
bb6f8ace7cb4: Waiting 
36ffdceb4c77: Waiting 
EOF

As you can see, at the end it just prints an EOF. Since our build considers only what's returned in the last line, we should improve the log when this happens.

Maybe something like

if lastLine == "EOF" {
  log(better message)
}

I would like to take this one 👍🏽

Hey @michaelc0n, sorry for the late reply but feel free to do it! I'll assign you

@vitorfhc no problem, having a bit of trouble reproducing locally, when tested I get the below:

bob push                             
INFO[0000] Running push command                         
INFO[0000] Pushing image docker.io/inexistent-repo/alpine:3.10  image=docker.io/inexistent-repo/alpine
PANI[0001] Error pushing image                           error="denied: requested access to the resource is denied"
panic: (*logrus.Entry) 0xc000359960

goroutine 1 [running]:

@michaelc0n it's a Docker error because you're trying to push the image to a repository to which you don't have access