Harbor: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

Created on 12 Oct 2019  ·  9Comments  ·  Source: goharbor/harbor

When I unzip harbor-offline-installer-v1.8.1.tgz package and run ./install.sh get this error:
failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

root@xxx#docker logs -f harbor-log
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner
sudo: fatal error, unable to load plugins

....

I searched everywhere for help still failed to solve the problem. Would you please help me fix this problem.
Thanks in Advance

The entire message as below:

./install.sh

Note: docker version: 19.03.2

Note: docker-compose version: 1.24.1

Loaded image: goharbor/harbor-core:v1.8.1
Loaded image: goharbor/harbor-registryctl:v1.8.1
Loaded image: goharbor/redis-photon:v1.8.1
Loaded image: goharbor/notary-server-photon:v0.6.1-v1.8.1
Loaded image: goharbor/chartmuseum-photon:v0.8.1-v1.8.1
Loaded image: goharbor/harbor-db:v1.8.1
Loaded image: goharbor/harbor-jobservice:v1.8.1
Loaded image: goharbor/nginx-photon:v1.8.1
Loaded image: goharbor/registry-photon:v2.7.1-patch-2819-v1.8.1
Loaded image: goharbor/harbor-migrator:v1.8.1
Loaded image: goharbor/prepare:v1.8.1
Loaded image: goharbor/harbor-portal:v1.8.1
Loaded image: goharbor/harbor-log:v1.8.1
Loaded image: goharbor/notary-signer-photon:v0.6.1-v1.8.1
Loaded image: goharbor/clair-photon:v2.0.8-v1.8.1

prepare base dir is set to /work/harbor-offline/harbor
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/core/env
Generated configuration file: /config/log/logrotate.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/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /secret/keys/secretkey
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir

Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating harbor-db ... done
Creating redis ... done
Creating registry ... done
Creating registryctl ... done
Creating harbor-core ... done
Creating harbor-portal ... error
Creating harbor-jobservice ...

Creating harbor-jobservice ... error

ERROR: for harbor-jobservice Cannot start service jobservice: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

ERROR: for portal Cannot start service portal: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

ERROR: for jobservice Cannot start service jobservice: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused
ERROR: Encountered errors while bringing up the project.

docker logs -f harbor-log

sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner
sudo: fatal error, unable to load plugins
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner
sudo: fatal error, unable to load plugins
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner
sudo: fatal error, unable to load plugins
...

staled

Most helpful comment

Same issue: Ubuntu 18.04 with 5.3.18, Docker 19.03.6, compose 1.25.4.

docker-compose ps shows that harbor-log is not started, it's _restarting_ instead.
docker-compose logs log shows a few errors.

1) sudo: setrlimit(RLIMIT_CORE): Operation not permitted
solved by adding the SYS_RESOURCE capability to the log service.
That didn't solve the issue though.

2) rsyslogd: there are no active actions configured. Inputs would run, but no output whatsoever were created. [v8.1910.0 try https://www.rsyslog.com/e/2103 ]; rsyslogd: run failed with error -2103 (see rsyslog.h or try https://www.rsyslog.com/e/2103 to learn what that number means)
This issue boiled down to the log container having no read permission to the common/config/log files. Solved by chowning.

All 9 comments

execuate this can help
```
sudo docker-compose restart
````

@wang-qiang Have you solved it?

Having same problem when restarting VS machine

Same issue: Ubuntu 18.04 with 5.3.18, Docker 19.03.6, compose 1.25.4.

docker-compose ps shows that harbor-log is not started, it's _restarting_ instead.
docker-compose logs log shows a few errors.

1) sudo: setrlimit(RLIMIT_CORE): Operation not permitted
solved by adding the SYS_RESOURCE capability to the log service.
That didn't solve the issue though.

2) rsyslogd: there are no active actions configured. Inputs would run, but no output whatsoever were created. [v8.1910.0 try https://www.rsyslog.com/e/2103 ]; rsyslogd: run failed with error -2103 (see rsyslog.h or try https://www.rsyslog.com/e/2103 to learn what that number means)
This issue boiled down to the log container having no read permission to the common/config/log files. Solved by chowning.

Had a similar issue. Check the file /usr/lib/sudo/sudoers.so in the docker images. docker rmi and reload images if the file's permission is not correct. It works in my case.

Had a similar issue. Solved by https://github.com/goharbor/harbor/issues/9382#issuecomment-611915390

In my issue, I solved it by this.
Just change the harbor-log image tag to goharbor/harbor-log:v1.10.3-dev

使用docker logs -f harbor-log查看harbor-log日志:
WARNING: Error loading config file: /opt/platform/.docker/config.json: open /opt/platform/.docker/config.json: permission denied
rsyslogd: error writing pid file (creation stage)
: Permission denied
rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)
rsyslogd: error writing pid file (creation stage)
: Permission denied
rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)
rsyslogd: error writing pid file (creation stage)
: Permission denied
rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)
rsyslogd: error writing pid file (creation stage)
: Permission denied
rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)
rsyslogd: error writing pid file (creation stage)
: Permission denied
rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)
rsyslogd: error writing pid file (creation stage)
: Permission denied
rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)
rsyslogd: error writing pid file (creation stage)
: Permission denied
rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)
rsyslogd: error writing pid file (creation stage)
: Permission denied
rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)
rsyslogd: error writing pid file (creation stage)
: Permission denied
rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)
rsyslogd: error writing pid file (creation stage)
: Permission denied
rsyslogd: run failed with error -3000 (see rsyslog.h or try https://www.rsyslog.com/e/3000 to learn what that number means)

solution:

导出harbor-log容器

mkdir -p /tmp/harbor-log
cd /tmp/harbor-log
docker export harbor-log -o harbor-log.tar

解压tar包

tar xvfp harbor-log.tar

修改shadow文件的值

sed -i 's/:90:/:99999:/g' /tmp/harbor-log/etc/shadow

将修改后的shadow文件挂载到harbor-log容器内

mkdir -p /opt/harbor-log-etc/
cp /tmp/harbor-log/etc/shadow /opt/harbor-log-etc/shadow

修改docker-composr.yml文件,harbor-log容器的volumes配置,增加以下配置

  - type: bind
    source: /opt/harbor-log-etc/shadow
    target: /etc/shadow

重启harbor即可

docker-compose down
docker-compose up -d

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings