goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.93k stars 4.74k forks source link

install.sh starts harbor-log container only. #20949

Closed hylowaker closed 3 weeks ago

hylowaker commented 3 weeks ago

Expected behavior and actual behavior:

Expected:
Running install.sh creates and starts all the containers.

Actual:
It throws failed to initialize logging driver: dial tcp [::1]:1514: connect: connection refused error, and only starts harbor-log container.

The error message may look same with https://github.com/goharbor/harbor/issues/9382. Though, while #9382 is caused by permission problem, this issue seems to be caused by dependencies/timing between containers.

Steps to reproduce the problem:

OS: macOS Sonoma 14.6 Machine: MacBook Air 2024 (M3 chip)

  1. Set bind mount location for log to somewhere that does not have permission issue.
# harbor.yml

# Log configurations
log:
  # options are debug, info, warning, error, fatal
  level: info
  # configs for logs in local storage
  local:
    # Log files are rotated log_rotate_count times before being removed. If count is 0, old versions are removed rather than rotated.
    rotate_count: 50
    # Log files are rotated only if they grow bigger than log_rotate_size bytes. If size is followed by k, the size is assumed to be in kilobytes.
    # If the M is used, the size is in megabytes, and if G is used, the size is in gigabytes. So size 100, size 100k, size 100M and size 100G
    # are all valid.
    rotate_size: 200M
    # The directory on your host that store log
    location: /tmp/harbor-log
  1. Run install.sh. The error failed to create task for container: failed to initialize logging driver: dial tcp [::1]:1514: connect: connection refused shows up.
$ ./install.sh

...

[Step 4]: starting Harbor ...
WARN[0000] /Users/jaeheunghan/Downloads/harbor/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Running 14/19
 ✔ Network harbor_harbor                                                                                                                                      Created                              0.0s 
 ✔ Container harbor-log                                                                                                                                       Started                              0.2s 
 ! log The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                              0.0s 
 ⠹ Container harbor-db                                                                                                                                        Starting                             0.3s 
 ⠹ Container registry                                                                                                                                         Starting                             0.3s 
 ⠹ Container redis                                                                                                                                            Starting                             0.3s 
 ⠹ Container registryctl                                                                                                                                      Starting                             0.3s 
 ⠹ Container harbor-portal                                                                                                                                    Startin...                           0.3s 
 ! portal The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                           0.0s 
 ! redis The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                            0.0s 
 ! postgresql The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                       0.0s 
 ! registry The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                         0.0s 
 ✔ Container harbor-core                                                                                                                                      Created                              0.0s 
 ! registryctl The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                      0.0s 
 ! core The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                             0.0s 
 ✔ Container harbor-jobservice                                                                                                                                Cre...                               0.0s 
 ✔ Container nginx                                                                                                                                            Created                              0.0s 
 ! jobservice The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                       0.0s 
 ! proxy The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                            0.0s 
Error response from daemon: failed to create task for container: failed to initialize logging driver: dial tcp [::1]:1514: connect: connection refused
  1. Check docker containers with docker ps. You can see only harbor-log is running.
$ docker ps -a
CONTAINER ID   IMAGE                                 COMMAND                  CREATED         STATUS                   PORTS                       NAMES
b5fc7052a34a   goharbor/harbor-jobservice:v2.11.1    "/harbor/entrypoint.…"   3 minutes ago   Created                                              harbor-jobservice
7fc7afcfb38c   goharbor/nginx-photon:v2.11.1         "nginx -g 'daemon of…"   3 minutes ago   Created                                              nginx
c93e2179eb63   goharbor/harbor-core:v2.11.1          "/harbor/entrypoint.…"   3 minutes ago   Created                                              harbor-core
a2dc8a5cd4e9   goharbor/registry-photon:v2.11.1      "/home/harbor/entryp…"   3 minutes ago   Created                                              registry
5c23e6c8d34e   goharbor/redis-photon:v2.11.1         "redis-server /etc/r…"   3 minutes ago   Created                                              redis
04e02aeda75f   goharbor/harbor-registryctl:v2.11.1   "/home/harbor/start.…"   3 minutes ago   Created                                              registryctl
847cfdf08ecb   goharbor/harbor-portal:v2.11.1        "nginx -g 'daemon of…"   3 minutes ago   Created                                              harbor-portal
5233cd206507   goharbor/harbor-db:v2.11.1            "/docker-entrypoint.…"   3 minutes ago   Created                                              harbor-db
680b39238d91   goharbor/harbor-log:v2.11.1           "/bin/sh -c /usr/loc…"   3 minutes ago   Up 3 minutes (healthy)   127.0.0.1:1514->10514/tcp   harbor-log
  1. harbor-log container shows no logs.
$ docker logs harbor-log
  1. Run docker-compose up manually.
$ docker-compose up
...
...
...
  1. Check containers again. Now all the containers are running fine.
$ docker ps        
CONTAINER ID   IMAGE                                 COMMAND                  CREATED          STATUS                    PORTS                       NAMES
9489253c333c   goharbor/nginx-photon:v2.11.1         "nginx -g 'daemon of…"   49 seconds ago   Up 48 seconds (healthy)   0.0.0.0:5000->8080/tcp      nginx
3f59ed55c709   goharbor/harbor-jobservice:v2.11.1    "/harbor/entrypoint.…"   49 seconds ago   Up 46 seconds (healthy)                               harbor-jobservice
2649010ec4f5   goharbor/harbor-core:v2.11.1          "/harbor/entrypoint.…"   49 seconds ago   Up 48 seconds (healthy)                               harbor-core
b48041958502   goharbor/redis-photon:v2.11.1         "redis-server /etc/r…"   49 seconds ago   Up 48 seconds (healthy)                               redis
a495e947aa6b   goharbor/registry-photon:v2.11.1      "/home/harbor/entryp…"   49 seconds ago   Up 48 seconds (healthy)                               registry
53fffbc6a3cc   goharbor/harbor-registryctl:v2.11.1   "/home/harbor/start.…"   49 seconds ago   Up 48 seconds (healthy)                               registryctl
86912632d18d   goharbor/harbor-portal:v2.11.1        "nginx -g 'daemon of…"   49 seconds ago   Up 48 seconds (healthy)                               harbor-portal
afef73d6aba2   goharbor/harbor-db:v2.11.1            "/docker-entrypoint.…"   49 seconds ago   Up 48 seconds (healthy)                               harbor-db
680b39238d91   goharbor/harbor-log:v2.11.1           "/bin/sh -c /usr/loc…"   8 minutes ago    Up 8 minutes (healthy)    127.0.0.1:1514->10514/tcp   harbor-log

Versions:

Please specify the versions of following systems.

stonezdj commented 3 weeks ago

You can not install amd64 Harbor on arm arch machine.

hylowaker commented 3 weeks ago

Rosetta allows me to run amd64 Harbor on my laptop. I installed it and saw it working with just one additional docker-compose up.

After install.sh starts the log container, then the following docker-compose up command starts the remaining containers.

290760647 commented 3 weeks ago

https://github.com/goharbor/harbor/issues/7008#issuecomment-968370395 this workaround help me to solved the issue