Closed rrayst closed 10 months ago
You are mixing 2 AUTH providers: token
and httpasswd
.
The docs state:
You can configure only one authentication provider.
@rrayst mind closing this as this is a misused configuration case, not an issue with registry.
Bug: registry 2.8.2 sometimes forgets it is configured to do token authentication.
When I say "it forgets to do token auth", I mean that
curl https://myregistry2.example.com/v2/_catalog -v
returnsinstead of
from then on. Only a container restart will fix the problem.
Configuration Details:
We are running the registry:2.8.2 docker image on a Kubernetes cluster. (Everything is infrastructure as code.)
The container has the following environment variables set:
and
/config/
containsso there is nothing fancy there.
The container is started using
/bin/registry serve /config/config.yml
as command.The file
/config/htpasswd
also exists (legacy reasons) and containers 2 users. (But the file should not be considered, asREGISTRY_AUTH=token
is set.)After starting the container, it can run for days without problems (doing token auth). But at some point (after weeks to months), it starts returning
Www-Authenticate: Basic
[...] instead ofWww-Authenticate: Bearer
[...]. At this point, there seems to be no other solution than restarting the container.As a programmer, based on the behaviour described above, I would usually bet on a concurrency issue. With my limited Go experience, I would still say that the code accessing the authentication method seems fine, though.
The bug was already present in the registry:2.7.1 images.