Docker login fails, unauthorized: incorrect username or password

docker login fails, unauthorized: incorrect username or password

Since yesterday our CI/CD deployment is broken. GitLab attempt to login to docker results in error “unauthorized: incorrect username or password”

  • We are using Gitlab.com (GitLab Enterprise Edition 16.0.0-pre 0f2d3fd110e) with shared runners
  • .gitlab-ci.yml was not changed between deployments
  • *Pipeline fails at step “docker login -u $CI_REGISTRY_USER -p $CI_BUILD_TOKEN $CI_REGISTRY

As I understand, it is GitLab who controls values of variables $CI_REGISTRY_USER, $CI_BUILD_TOKEN, $CI_REGISTRY

If anyone could tell me how to fix this pipeline and make docker login work again I would appreciate a lot.

Thanks for taking the time to be thorough in your request, it really helps! :blush:

The password should be CI_REGISTRY_PASSWORD, or CI_JOB_TOKEN instead of CI_BUILD_TOKEN. See here.

But besides that, it is helpful if you provide information like your gitlab version.

Thank you! Changing CI_BUILD_TOKENCI_REGISTRY_PASSWORD did the job!

I updated my original question with gitlab version.