Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Error occurs when I upgrade harbor from '2.11.1' to '2.12.1' #21372

Closed
bkkoli opened this issue Jan 3, 2025 · 3 comments
Closed

The Error occurs when I upgrade harbor from '2.11.1' to '2.12.1' #21372

bkkoli opened this issue Jan 3, 2025 · 3 comments

Comments

@bkkoli
Copy link

bkkoli commented Jan 3, 2025

If you are reporting a problem, please make sure the following information are provided:

Expected behavior and actual behavior:
A clear and concise description of what you expected to happen and what's the actual behavior. If applicable, add screenshots to help explain your problem.

Migration Procedure from '2.11.1' to '2.12.1' is compeleted successfully.

Steps to reproduce the problem:
Please provide the steps to reproduce this problem.

I did migration according to the guide written by Harbor Official Docs

  1. docker compose down
cd harbor
docker compose down
  1. Back up Harbor’s current files
mv harbor /my_backup_dir/harbor
  1. Back up the database
cp -r /data/database /my_backup_dir/
  1. Get the latest Harbor release package from https://github.com/goharbor/harbor/releases and extract it.

  2. Unarchive offline installer package

tar zxf <offline package>
docker image load -i harbor/harbor.[version].tar.gz
  1. Copy the /path/to/old/harbor.yml to harbor.yml and upgrade it.
docker run -it --rm -v /:/hostfs goharbor/prepare:[tag] migrate -i ${path to harbor.yml}
  1. In the ./harbor directory, run the ./install.sh script to install the new Harbor instance.

  2. The error occurs as follows.

[Step 0]: checking if docker is installed ...

Note: docker version: 20.10.5

[Step 1]: checking docker-compose is installed ...

Note: docker-compose version: 1.25.5

[Step 2]: loading Harbor images ...
Loaded image: goharbor/harbor-core:v2.12.1
Loaded image: goharbor/harbor-log:v2.12.1
Loaded image: goharbor/harbor-db:v2.12.1
Loaded image: goharbor/harbor-jobservice:v2.12.1
Loaded image: goharbor/harbor-registryctl:v2.12.1
Loaded image: goharbor/harbor-exporter:v2.12.1
Loaded image: goharbor/nginx-photon:v2.12.1
Loaded image: goharbor/harbor-portal:v2.12.1
Loaded image: goharbor/trivy-adapter-photon:v2.12.1
Loaded image: goharbor/redis-photon:v2.12.1
Loaded image: goharbor/registry-photon:v2.12.1
Loaded image: goharbor/prepare:v2.12.1


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /<HARBOR_BASE_DIR>/harbor
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/portal/nginx.conf
Clearing the configuration file: /config/jobservice/config.yml
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registry/passwd
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/db/env
Generated configuration file: /config/portal/nginx.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /data/secret/keys/secretkey
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir


Note: stopping existing Harbor instance ...
ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for networks: 'harbor'
Unsupported config option for services: 'log'

docker-compose.yml content is

services:
  log:
    image: goharbor/harbor-log:v2.12.1
    container_name: harbor-log
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - DAC_OVERRIDE
      - SETGID
      - SETUID
    volumes:
      - /var/log/harbor/:/var/log/docker/:z
      - type: bind
        source: ./common/config/log/logrotate.conf
        target: /etc/logrotate.d/logrotate.conf
      - type: bind
        source: ./common/config/log/rsyslog_docker.conf
        target: /etc/rsyslog.d/rsyslog_docker.conf
    ports:
      - 127.0.0.1:1514:10514
    networks:
      - harbor
  registry:
    image: goharbor/registry-photon:v2.12.1
    container_name: registry
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    volumes:
      - <DATA_BASE_DIR>/data/registry:/storage:z
      - ./common/config/registry/:/etc/registry/:z
      - type: bind
        source: <DATA_BASE_DIR>/data/secret/registry/root.crt
        target: /etc/registry/root.crt
      - type: bind
        source: ./common/config/shared/trust-certificates
        target: /harbor_cust_cert
    networks:
      - harbor
    depends_on:
      - log
    logging:
      driver: "syslog"
      options:
        syslog-address: "tcp://localhost:1514"
        tag: "registry"
  registryctl:
    image: goharbor/harbor-registryctl:v2.12.1
    container_name: registryctl
    env_file:
      - ./common/config/registryctl/env
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    volumes:
      - <DATA_BASE_DIR>/data/registry:/storage:z
      - ./common/config/registry/:/etc/registry/:z
      - type: bind
        source: ./common/config/registryctl/config.yml
        target: /etc/registryctl/config.yml
      - type: bind
        source: ./common/config/shared/trust-certificates
        target: /harbor_cust_cert
    networks:
      - harbor
    depends_on:
      - log
    logging:
      driver: "syslog"
      options:
        syslog-address: "tcp://localhost:1514"
        tag: "registryctl"
  postgresql:
    image: goharbor/harbor-db:v2.12.1
    container_name: harbor-db
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - DAC_OVERRIDE
      - SETGID
      - SETUID
    volumes:
      - <DATA_BASE_DIR>/data/database:/var/lib/postgresql/data:z
    networks:
      harbor:
    env_file:
      - ./common/config/db/env
    depends_on:
      - log
    logging:
      driver: "syslog"
      options:
        syslog-address: "tcp://localhost:1514"
        tag: "postgresql"
    shm_size: '1gb'
  core:
    image: goharbor/harbor-core:v2.12.1
    container_name: harbor-core
    env_file:
      - ./common/config/core/env
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - SETGID
      - SETUID
    volumes:
      - <DATA_BASE_DIR>/data/ca_download/:/etc/core/ca/:z
      - <DATA_BASE_DIR>/data/:/data/:z
      - ./common/config/core/certificates/:/etc/core/certificates/:z
      - type: bind
        source: ./common/config/core/app.conf
        target: /etc/core/app.conf
      - type: bind
        source: <DATA_BASE_DIR>/data/secret/core/private_key.pem
        target: /etc/core/private_key.pem
      - type: bind
        source: <DATA_BASE_DIR>/data/secret/keys/secretkey
        target: /etc/core/key
      - type: bind
        source: ./common/config/shared/trust-certificates
        target: /harbor_cust_cert
    networks:
      harbor:
    depends_on:
      - log
      - registry
      - redis
      - postgresql
    logging:
      driver: "syslog"
      options:
        syslog-address: "tcp://localhost:1514"
        tag: "core"
  portal:
    image: goharbor/harbor-portal:v2.12.1
    container_name: harbor-portal
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
      - NET_BIND_SERVICE
    volumes:
      - type: bind
        source: ./common/config/portal/nginx.conf
        target: /etc/nginx/nginx.conf
    networks:
      - harbor
    depends_on:
      - log
    logging:
      driver: "syslog"
      options:
        syslog-address: "tcp://localhost:1514"
        tag: "portal"

  jobservice:
    image: goharbor/harbor-jobservice:v2.12.1
    container_name: harbor-jobservice
    env_file:
      - ./common/config/jobservice/env
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    volumes:
      - <DATA_BASE_DIR>/data/job_logs:/var/log/jobs:z
      - type: bind
        source: ./common/config/jobservice/config.yml
        target: /etc/jobservice/config.yml
      - type: bind
        source: ./common/config/shared/trust-certificates
        target: /harbor_cust_cert
    networks:
      - harbor
    depends_on:
      - core
    logging:
      driver: "syslog"
      options:
        syslog-address: "tcp://localhost:1514"
        tag: "jobservice"
  redis:
    image: goharbor/redis-photon:v2.12.1
    container_name: redis
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    volumes:
      - <DATA_BASE_DIR>/data/redis:/var/lib/redis
    networks:
      harbor:
    depends_on:
      - log
    logging:
      driver: "syslog"
      options:
        syslog-address: "tcp://localhost:1514"
        tag: "redis"
  proxy:
    image: goharbor/nginx-photon:v2.12.1
    container_name: nginx
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
      - NET_BIND_SERVICE
    volumes:
      - ./common/config/nginx:/etc/nginx:z
      - <DATA_BASE_DIR>/data/secret/cert:/etc/cert:z
      - type: bind
        source: ./common/config/shared/trust-certificates
        target: /harbor_cust_cert
    networks:
      - harbor
    ports:
      - 8001:8080
      - 8443:8443
    depends_on:
      - registry
      - core
      - portal
      - log
    logging:
      driver: "syslog"
      options:
        syslog-address: "tcp://localhost:1514"
        tag: "proxy"
networks:
  harbor:
    external: false

When I compare '2.11.1' and '2.12.1', I found the changes about omit of version in docker-compose.yml.

Is this the cause of the error?

Versions:
Please specify the versions of following systems.

  • harbor version: [2.12.1]
  • docker engine version: [20.10.5]
  • docker-compose version: [1.25.5]

Additional context:

  • Harbor config files: You can get them by packaging harbor.yml and files in the same directory, including subdirectory.
  • Log files: You can get them by package the /var/log/harbor/ .
@stonezdj
Copy link
Contributor

stonezdj commented Jan 3, 2025

Docker version should be 2.10.10.
https://goharbor.io/docs/2.12.0/install-config/installation-prereqs/

@bkkoli
Copy link
Author

bkkoli commented Jan 6, 2025

@stonezdj

Docker version should be 2.10.10.

Thank you for your advice. I'll test it with upgraded docker version.

@bkkoli
Copy link
Author

bkkoli commented Jan 6, 2025

@stonezdj
As you said, after upgrading my docker engine, The upgrade is successful. Thank you!!!

@bkkoli bkkoli closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants