Error when login to gitlab container registry in gitlab ci

I have the following gitlab ci job :

image: docker:stable

  - docker:dind

  - debug

Debug registry login:
  stage: debug
    - docker login --username "$CI_REGISTRY_USER" --password "$CI_REGISTRY_PASSWORD"

But the job fails with the following error :

Error response from daemon: 
Get net/http: 
request canceled while waiting for connection 
(Client.Timeout exceeded while awaiting headers)

"$CI_REGISTRY_USER"and "$CI_REGISTRY_PASSWORD" are properly set, I tried to echo them and the right values are shown.

The container registry, the gitlab instance and the runners are all on the same ubuntu server.

If I try to login using the command in the job from my pc or via the serveur which run the job the connexion is successfull.

config of the runner :

  name = "Smooth"
  url = ""
  token = "a5e28f2c95cf5ff887edb535f80e37"
  executor = "docker"
    tls_verify = false
    image = "docker:stable"
    privileged = true
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0

1 answer

  • answered 2018-09-22 18:51 L. Faros

    Turns out deactivating cloudflare's dns for the git subdomain solved the issue. (The cloudflare dns are also off for the registry domain)