Everything has been working fine for several months until a few hours ago. Here are the logs:
2022-09-26T16:41:41Z #6 FROM docker.io/private/app-common:latest
2022-09-26T16:41:41Z #6 resolve docker.io/private/app-common:latest 0.0s done
2022-09-26T16:41:41Z #6 ERROR: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
2022-09-26T16:41:41Z
2022-09-26T16:41:41Z #7 [internal] load build context
2022-09-26T16:41:41Z #7 transferring context: 482.35kB 0.0s done
2022-09-26T16:41:41Z #7 CANCELED
2022-09-26T16:41:41Z ------
2022-09-26T16:41:41Z > FROM docker.io/private/app-common:latest:
2022-09-26T16:41:41Z ------
2022-09-26T16:41:41Z ERROR: failed to solve: failed to load cache key: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
2022-09-26T16:41:41Z Build failed using Buildkit (1)
docker.io/private/app-common:latest is a private repo within the same organization. I wonder why authorization fails all of a sudden considering that it worked for quite some time until now (as you can see in the screenshot).
I have rebuilt one of my automated builds to see if it works. It worked. I also checked that message about dockercfg, because I remembered I have met a similar message before but in my case it was āwill be removedā not āhas been removedā.
When I first recognized something was wrong with the virtual machine versions, I reported it on GitHub
It looks like docker in your VM has changed somehow, but the configuration file is still there.
Please, report it as a bug in the hub-feedback repository
I tried to search for similar isues, but before you open the issue, do the same. Maybe you find something that I could not. There was an issue long time ago in 2016
but the message āhas been removedā is suspicious.
I also checked the status page of the Docker services, and I donāt see any known issue there
I am subscribed to that page to get notification when something happens, but I didnāt get anything recently.
Thank you for your reply! I managed to get the autobuilds working again by explicitly creating an access token and inside hooks/pre_build doing a docker login that uses the access token. The private docker image Iām pulling from and hosted in the same organization is found now and the pulling error is gone.
I think there was an update today on docker hub because the build logs look different from 12+ hours ago and now, e.g. each line is timestamped.
Here is my solution:
Create an access token:
Go to Docker Hub (Account Settings ā Security) and create a new access token. Put the access token in a file e.g. hooks/token
Make a pre_build hook where you authenticate first:
Here are the contents of my hooks/pre_build file:
Thank you for sharing. I made one change, instead of storing the token in your code you can create a Build Environment Variable and put it there. I used TOKEN. Then modify the code like this.
Yes, Iām recently seeing the same issues. Thanks for your solution. A bit of clarificationā¦ where is the hooks/pre_build file? Is it in the repo from github that you link to the dockerhub image?
I got it workingā¦ many thanks for the help!!! Would have been nice for dockerhub to mention this ahead of time
The hooks/pre_build file goes into the git repo. I would also recommend storing the token in a build environment rather than in a file in the git repo. Unfortunately I cannot edit my answer above.
Weāve changed our setup to have images built from github using github actions and local github runners. That way, you can use secrets in github to hold the personal access token and you donāt need to manually use āDocker loginā as there are github actions for that purpose. We then push the resulting image to docker hub, rendering it merely as a registry. I hope this bug gets resolved quickly. For now, we didnāt get any response on our supportrequest yet.