Problem login to registry. Get "https://registry.example:443/v2/": unavailable: registry not enabled

  • GitLab (Hint: /help): 13.12.1
  • Runner (Hint: /admin/runners): 14.5.2
  • Add the CI configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml)
stages:
    - build
    - staging
    - release


variables:
  TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
  RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
  REGISTRY: registry.example.com:443


before_script:
  - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $REGISTRY

# This file is a template, and might need editing before it works on your project.
docker-build-master:
  # Official docker image.
  image: docker:latest
  stage: build
  services:
    - docker:dind
  before_script:
    - echo "$CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $REGISTRY" 
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $REGISTRY
  script:
    - docker build --pull -t "$TEST_IMAGE" -f docker/Dockerfile .
    - docker push "$TEST_IMAGE"
#  only:
#    - master
#  when:
#    - manual
  tags:
     - sysadm_test

release-image:
  stage: release
  script:
    - docker pull $TEST_IMAGE
    - docker tag $TEST_IMAGE $RELEASE_IMAGE
    - docker push $RELEASE_IMAGE
  only:
    - master
  when: manual
version: '3'
services:
   registry:
     image: registry:2
     container_name: registry
     restart: always
     network_mode: bridge
     volumes:
       - "./certs:/certs:ro"
       - "./data:/registry"
     environment:
       REGISTRY_LOG_LEVEL: debug
       REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /registry
       REGISTRY_HTTP_SECRET: *****
       REGISTRY_AUTH: token
       REGISTRY_AUTH_TOKEN_REALM: https://git.example.com/jwt/auth
       REGISTRY_AUTH_TOKEN_SERVICE: container_registry
       REGISTRY_AUTH_TOKEN_ISSUER: omnibus-gitlab-issuer
       REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE: /certs/gitlab-registry.crt
       REGISTRY_STORAGE_DELETE_ENABLED: 'true'
       VIRTUAL_HOST: registry.example.com
       VIRTUAL_PORT: 5000
   nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    network_mode: bridge
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "127.0.0.1:8888:8888"
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/timezone:/etc/timezone:ro"
      - "./certs:/etc/nginx/certs:ro"
      - "./nginx/conf.d/vhost.d:/etc/nginx/vhost.d"
      - "./nginx/conf.d/custom.conf:/etc/nginx/conf.d/custom.conf:ro"
      - "./nginx/www_data:/usr/share/nginx/html"
      - "./nginx/conf.d:/etc/nginx/conf.d:rw"
      - "/var/run/docker.sock:/tmp/docker.sock:ro"
    environment:
      - DEFAULT_HOST=registry.example.com

gitlab.rb

# registry_external_url 'https://registry.example.com:443'
# gitlab_rails['registry_enabled'] = true
# gitlab_rails['registry_api_url'] = "https://registry.example.com" 
# gitlab_rails['registry_key_path'] = "/var/opt/gitlab/gitlab-rails/certificate.key"
# gitlab_rails['registry_issuer'] = "omnibus-gitlab-issuer"

can me help?

Hi,

I have similar error, but with another version of gitlab.

I have installed gitlab on-premise, with omnibus installation. Version gitlab: 15.6

gitlab01pre:/etc/gitlab# cat gitlab.rb | grep registry
registry_external_url ‘https://gitlabpre.xxx.yyy.es:5050
registry[‘enable’]=true
gitlab_rails[‘registry_path’] = “/mnt/registry”

gitlab01pre:/etc/gitlab# gitlab-ctl status
run: alertmanager: (pid 17774) 172563s; run: log: (pid 2427) 182657s
run: gitaly: (pid 17786) 172562s; run: log: (pid 2429) 182657s
run: gitlab-exporter: (pid 17802) 172562s; run: log: (pid 2434) 182657s
run: gitlab-kas: (pid 17923) 172551s; run: log: (pid 2417) 182657s
run: gitlab-workhorse: (pid 17936) 172551s; run: log: (pid 2423) 182657s
run: grafana: (pid 17945) 172551s; run: log: (pid 2439) 182657s
run: logrotate: (pid 29813) 3349s; run: log: (pid 2430) 182657s
run: nginx: (pid 31781) 169028s; run: log: (pid 2442) 182657s
run: node-exporter: (pid 18058) 172523s; run: log: (pid 2421) 182657s
run: postgres-exporter: (pid 18066) 172522s; run: log: (pid 2420) 182657s
run: postgresql: (pid 18076) 172522s; run: log: (pid 2419) 182657s
run: prometheus: (pid 18086) 172522s; run: log: (pid 2422) 182657s
run: puma: (pid 18102) 172521s; run: log: (pid 2428) 182657s
run: redis: (pid 18108) 172520s; run: log: (pid 2441) 182657s
run: redis-exporter: (pid 18114) 172520s; run: log: (pid 2426) 182657s
run: registry: (pid 20984) 17395s; run: log: (pid 13481) 173363s
run: sidekiq: (pid 18140) 172517s; run: log: (pid 2418) 182657s

gitlab01pre:/etc/gitlab# netstat -antp | grep 5050
tcp 0 0 0.0.0.0:5050 0.0.0.0:* LISTEN 31781/nginx: master
gitlab01pre:/etc/gitlab# netstat -antp | grep 5000
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 20984/registry

#docker login gitlabpre.xxx.yyy.es:5050/stic/listas-manager
Username: jregueir
Password:
Error response from daemon: Get “https://gitlabpre.xxx.yyy.es:5050/v2/”: unavailable: registry not enabled

Best Regards.

Hi,

I have a similar problem. I have the version 15.6 in a on-premise installation with omnibus.

gitlab01pre:/etc/gitlab# cat gitlab.rb | grep registry
registry_external_url ‘https://gitlabpre.xxx.yyy.es:5050
registry[‘enable’]=true
gitlab_rails[‘registry_path’] = “/mnt/registry”
gitlab01pre:/etc/gitlab# cat gitlab.rb | grep registry
registry_external_url ‘https://gitlabpre.xxx.yyy.es:5050
registry[‘enable’]=true
gitlab_rails[‘registry_path’] = “/mnt/registry”

gitlab01pre:/etc/gitlab# gitlab-ctl status
run: alertmanager: (pid 17774) 172563s; run: log: (pid 2427) 182657s
run: gitaly: (pid 17786) 172562s; run: log: (pid 2429) 182657s
run: gitlab-exporter: (pid 17802) 172562s; run: log: (pid 2434) 182657s
run: gitlab-kas: (pid 17923) 172551s; run: log: (pid 2417) 182657s
run: gitlab-workhorse: (pid 17936) 172551s; run: log: (pid 2423) 182657s
run: grafana: (pid 17945) 172551s; run: log: (pid 2439) 182657s
run: logrotate: (pid 29813) 3349s; run: log: (pid 2430) 182657s
run: nginx: (pid 31781) 169028s; run: log: (pid 2442) 182657s
run: node-exporter: (pid 18058) 172523s; run: log: (pid 2421) 182657s
run: postgres-exporter: (pid 18066) 172522s; run: log: (pid 2420) 182657s
run: postgresql: (pid 18076) 172522s; run: log: (pid 2419) 182657s
run: prometheus: (pid 18086) 172522s; run: log: (pid 2422) 182657s
run: puma: (pid 18102) 172521s; run: log: (pid 2428) 182657s
run: redis: (pid 18108) 172520s; run: log: (pid 2441) 182657s
run: redis-exporter: (pid 18114) 172520s; run: log: (pid 2426) 182657s
run: registry: (pid 20984) 17395s; run: log: (pid 13481) 173363s
run: sidekiq: (pid 18140) 172517s; run: log: (pid 2418) 182657s

gitlab01pre:/etc/gitlab# netstat -antp | grep 5050
tcp 0 0 0.0.0.0:5050 0.0.0.0:* LISTEN 31781/nginx: master
gitlab01pre:/etc/gitlab# netstat -antp | grep 5000
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 20984/registry

docker login gitlabpre.xxx.yyy.es:5050/stic/listas-manager
Username: jregueir
Password:
Error response from daemon: Get “https://gitlabpre.stic.ull.es:5050/v2/”: unavailable: registry not enabled

Thanks. Best Regards.

Hi,

I don’t have problem with the registry if I “Configure Container Registry under its own domain”[1] instead “Configure Container Registry under an existing GitLab domain” [2]

Best Regards.

[1] GitLab Container Registry administration | GitLab
[2] GitLab Container Registry administration | GitLab