Harbor: Unable to install Harbor with v1.10.0 Occurred IsADirectoryError

Created on 21 Dec 2019  Â·  6Comments  Â·  Source: goharbor/harbor

installed Harbor with the harbor-offline-installer-v1.10.0.tgz
an error Occurred:
nerated configuration file: /config/log/rsyslog_docker.conf
Traceback (most recent call last):
File "main.py", line 72, in
main()
File "/usr/lib/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(args, *kwargs)
File "/usr/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, *ctx.params)
File "/usr/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(
args, **kwargs)
File "main.py", line 43, in main
prepare_nginx(config_dict)
File "/usr/src/app/utils/nginx.py", line 23, in prepare_nginx
render_nginx_template(config_dict)
File "/usr/src/app/utils/nginx.py", line 56, in render_nginx_template
prepare_nginx_certs(config_dict['cert_key_path'], config_dict['cert_path'])
File "/usr/src/app/utils/nginx.py", line 42, in prepare_nginx_certs
shutil.copy2(host_ngx_cert_key_path, real_key_path)
File "/usr/lib/python3.6/shutil.py", line 257, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.6/shutil.py", line 120, in copyfile
with open(src, 'rb') as fsrc:
IsADirectoryError: [Errno 21] Is a directory: '/hostfs/opt/devops/dev/cert'

using the same harbor.yml, I installed success in v1.9.3.

ENV:
docker version: 19.03.5
docker-compose version: 1.25.0

areinstallation staled

Most helpful comment

i know what's wrong

[root@localhost harbor]# more harbor.yml
# Configuration file of Harbor

# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: registry.harbor.com

# http related config
http:
  # port for http, default is 80. If https enabled, this port will redirect to https port
  port: 80

# https related config
https:
  # https port for harbor, default is 443
  port: 443
  # The path of cert and key files for nginx
  certificate: /data/cert/registry.harbor.com.crt
  private_key: /data/cert/registry.harbor.com.key

this section can't config as path

  certificate: /data/cert/
  private_key: /data/cert/

should be

  certificate: /data/cert/registry.harbor.com.crt
  private_key: /data/cert/registry.harbor.com.key

/data/cert files

[root@localhost harbor]# ll /data/cert/
total 8
-rw-r--r-- 1 root root 2126 Jul 21 23:18 registry.harbor.com.crt
-rw-r--r-- 1 root root 3243 Jul 21 23:18 registry.harbor.com.key

but the harbor.yml say "The path of cert and key files for nginx" ??

finally it ok

[root@localhost harbor]# ./install.sh 

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

Note: docker version: 19.03.12

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

Note: docker-compose version: 1.26.2

[Step 2]: loading Harbor images ...
Loaded image: goharbor/trivy-adapter-photon:v2.0.1
Loaded image: goharbor/harbor-portal:v2.0.1
Loaded image: goharbor/harbor-core:v2.0.1
Loaded image: goharbor/harbor-jobservice:v2.0.1
Loaded image: goharbor/notary-server-photon:v2.0.1
Loaded image: goharbor/harbor-log:v2.0.1
Loaded image: goharbor/registry-photon:v2.0.1
Loaded image: goharbor/notary-signer-photon:v2.0.1
Loaded image: goharbor/clair-photon:v2.0.1
Loaded image: goharbor/chartmuseum-photon:v2.0.1
Loaded image: goharbor/prepare:v2.0.1
Loaded image: goharbor/harbor-db:v2.0.1
Loaded image: goharbor/harbor-registryctl:v2.0.1
Loaded image: goharbor/nginx-photon:v2.0.1
Loaded image: goharbor/redis-photon:v2.0.1
Loaded image: goharbor/clair-adapter-photon:v2.0.1


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /data/packages/harbor
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.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
Generated and saved secret to file: /data/secret/keys/secretkey
Successfully called func: create_root_cert
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir



[Step 5]: starting Harbor ...
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating redis         ... done
Creating registry      ... done
Creating harbor-portal ... done
Creating registryctl   ... done
Creating harbor-db     ... done
Creating harbor-core   ... done
Creating harbor-jobservice ... done
Creating nginx             ... done
✔ ----Harbor has been installed and started successfully.----

All 6 comments

Unfortunately, I also have this problem with centos7.4 and harbor1.10-offline.

[Step 4]: preparing harbor configs ...
prepare base dir is set to /home/xd/img/harbor
Traceback (most recent call last):
  File "main.py", line 72, in <module>
    main()
  File "/usr/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "main.py", line 42, in main
    prepare_log_configs(config_dict)
  File "/usr/src/app/utils/log.py", line 26, in prepare_log_configs
    **config_dict)
  File "/usr/src/app/utils/jinja.py", line 8, in render_jinja
    with open(dest, 'w') as f:
IsADirectoryError: [Errno 21] Is a directory: '/config/log/logrotate.conf'

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.

has anyone see how to fix this? I am receiving the same error now that I am adding certs to the install.

same error in v2.0.1, what is it?

[root@localhost harbor]# ./install.sh 

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

Note: docker version: 19.03.12

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

Note: docker-compose version: 1.26.2

[Step 2]: loading Harbor images ...
4dfc82127cd7: Loading layer [==================================================>]  11.15MB/11.15MB
47b4670d0c8c: Loading layer [==================================================>]  4.096kB/4.096kB
59a86010a270: Loading layer [==================================================>]  3.072kB/3.072kB
8da9cc70d93c: Loading layer [==================================================>]  23.44MB/23.44MB
d29455fc5f40: Loading layer [==================================================>]  9.309MB/9.309MB
40f9cab7875f: Loading layer [==================================================>]  33.57MB/33.57MB
Loaded image: goharbor/trivy-adapter-photon:v2.0.1
f6a133cb2572: Loading layer [==================================================>]  10.28MB/10.28MB
acd2089a7647: Loading layer [==================================================>]  8.488MB/8.488MB
160ddbb834ae: Loading layer [==================================================>]  178.7kB/178.7kB
b93d21b59a32: Loading layer [==================================================>]  157.2kB/157.2kB
b8c931eb34bd: Loading layer [==================================================>]  33.28kB/33.28kB
2e6d494d68eb: Loading layer [==================================================>]  17.41kB/17.41kB
5dedceb07ec6: Loading layer [==================================================>]  15.36kB/15.36kB
bfcc4645a906: Loading layer [==================================================>]  3.584kB/3.584kB
Loaded image: goharbor/harbor-portal:v2.0.1
2fa644b45f81: Loading layer [==================================================>]  12.22MB/12.22MB
d1ad40890fc7: Loading layer [==================================================>]  3.584kB/3.584kB
ce9fad8a1c82: Loading layer [==================================================>]   2.56kB/2.56kB
67b8071f0c5a: Loading layer [==================================================>]  46.52MB/46.52MB
a9620284cd5e: Loading layer [==================================================>]  5.632kB/5.632kB
08026e081903: Loading layer [==================================================>]   51.2kB/51.2kB
455144b92cb5: Loading layer [==================================================>]  47.34MB/47.34MB
5a0b179edfe6: Loading layer [==================================================>]   2.56kB/2.56kB
Loaded image: goharbor/harbor-core:v2.0.1
d793bae4f6cd: Loading layer [==================================================>]  12.22MB/12.22MB
37bc5ee2f872: Loading layer [==================================================>]  3.584kB/3.584kB
78da87a5755a: Loading layer [==================================================>]   2.56kB/2.56kB
6c8f6f3c4ee6: Loading layer [==================================================>]  35.69MB/35.69MB
716fdde605b5: Loading layer [==================================================>]  36.51MB/36.51MB
Loaded image: goharbor/harbor-jobservice:v2.0.1
99a45366ce4e: Loading layer [==================================================>]  8.435MB/8.435MB
d20e5e66643d: Loading layer [==================================================>]  6.317MB/6.317MB
73eb8f38314b: Loading layer [==================================================>]  16.04MB/16.04MB
512b6e175cf0: Loading layer [==================================================>]  28.25MB/28.25MB
d9dc0e504aed: Loading layer [==================================================>]  22.02kB/22.02kB
be53af8f5ad0: Loading layer [==================================================>]   50.6MB/50.6MB
Loaded image: goharbor/notary-server-photon:v2.0.1
0eadd51ada25: Loading layer [==================================================>]  49.89MB/49.89MB
18b13e8a8839: Loading layer [==================================================>]  3.584kB/3.584kB
e2755348bd4b: Loading layer [==================================================>]  3.072kB/3.072kB
a62d077cd0fe: Loading layer [==================================================>]   2.56kB/2.56kB
9c98500bf643: Loading layer [==================================================>]  3.072kB/3.072kB
33d51c5e29bb: Loading layer [==================================================>]  3.584kB/3.584kB
e9f3f1e2c1cf: Loading layer [==================================================>]  12.29kB/12.29kB
66f402bc9ecf: Loading layer [==================================================>]  5.632kB/5.632kB
Loaded image: goharbor/harbor-log:v2.0.1
ad8d57802e83: Loading layer [==================================================>]  8.441MB/8.441MB
e1ed8500fea6: Loading layer [==================================================>]  4.096kB/4.096kB
8490b02320fa: Loading layer [==================================================>]  3.072kB/3.072kB
e153d67d6e37: Loading layer [==================================================>]  20.94MB/20.94MB
51c195249ffd: Loading layer [==================================================>]  21.76MB/21.76MB
Loaded image: goharbor/registry-photon:v2.0.1
818525ddd265: Loading layer [==================================================>]  8.435MB/8.435MB
eb29d444582b: Loading layer [==================================================>]  6.317MB/6.317MB
9ac7c150b0aa: Loading layer [==================================================>]  14.61MB/14.61MB
118de7396af0: Loading layer [==================================================>]  28.25MB/28.25MB
7f58a60c50a0: Loading layer [==================================================>]  22.02kB/22.02kB
66d4cfbdcf31: Loading layer [==================================================>]  49.17MB/49.17MB
Loaded image: goharbor/notary-signer-photon:v2.0.1
950b2585869c: Loading layer [==================================================>]  116.1MB/116.1MB
90ac3291b314: Loading layer [==================================================>]  12.15MB/12.15MB
01fac6521224: Loading layer [==================================================>]  3.072kB/3.072kB
b12eaa59458a: Loading layer [==================================================>]  49.15kB/49.15kB
194e8fedab1e: Loading layer [==================================================>]  4.096kB/4.096kB
4308b3ef3b0d: Loading layer [==================================================>]  13.03MB/13.03MB
Loaded image: goharbor/clair-photon:v2.0.1
4261ed016572: Loading layer [==================================================>]   8.44MB/8.44MB
6858af1d1e26: Loading layer [==================================================>]   67.5MB/67.5MB
11194ef05958: Loading layer [==================================================>]  3.072kB/3.072kB
cabc2fa0c773: Loading layer [==================================================>]  4.096kB/4.096kB
0a914324569b: Loading layer [==================================================>]  68.33MB/68.33MB
Loaded image: goharbor/chartmuseum-photon:v2.0.1
Loaded image: goharbor/prepare:v2.0.1
3c574d52ca8f: Loading layer [==================================================>]  63.57MB/63.57MB
110d0675acf1: Loading layer [==================================================>]  65.19MB/65.19MB
7e9e0b5f83b2: Loading layer [==================================================>]  5.632kB/5.632kB
cc62802e9fac: Loading layer [==================================================>]   2.56kB/2.56kB
e7b41679bdb2: Loading layer [==================================================>]   2.56kB/2.56kB
b834aea1a9b5: Loading layer [==================================================>]   2.56kB/2.56kB
adbd713a6478: Loading layer [==================================================>]   2.56kB/2.56kB
fb7d245b830e: Loading layer [==================================================>]  10.75kB/10.75kB
Loaded image: goharbor/harbor-db:v2.0.1
ee2e0b1d599f: Loading layer [==================================================>]  8.441MB/8.441MB
e0d7d18a67f9: Loading layer [==================================================>]  4.096kB/4.096kB
675f3bebc4a9: Loading layer [==================================================>]  20.94MB/20.94MB
ae865bc6f2e9: Loading layer [==================================================>]  3.072kB/3.072kB
90b7ec2096a3: Loading layer [==================================================>]  8.721MB/8.721MB
a01119f3dc08: Loading layer [==================================================>]  30.48MB/30.48MB
Loaded image: goharbor/harbor-registryctl:v2.0.1
b51080ad06a0: Loading layer [==================================================>]  10.28MB/10.28MB
Loaded image: goharbor/nginx-photon:v2.0.1
6877651d3dad: Loading layer [==================================================>]  39.45MB/39.45MB
d669ab31064d: Loading layer [==================================================>]  3.072kB/3.072kB
2bfec584ce57: Loading layer [==================================================>]   59.9kB/59.9kB
4a2b47a7af21: Loading layer [==================================================>]  61.95kB/61.95kB
Loaded image: goharbor/redis-photon:v2.0.1
b3f687a8426d: Loading layer [==================================================>]  8.441MB/8.441MB
5ccbc18d5052: Loading layer [==================================================>]  4.096kB/4.096kB
ee6594efb4ec: Loading layer [==================================================>]  3.072kB/3.072kB
d10a03922272: Loading layer [==================================================>]   9.71MB/9.71MB
4b45e21e42b6: Loading layer [==================================================>]  10.53MB/10.53MB
Loaded image: goharbor/clair-adapter-photon:v2.0.1


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /data/packages/harbor
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Traceback (most recent call last):
  File "main.py", line 15, in <module>
    cli()
  File "/usr/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/src/app/commands/prepare.py", line 47, in prepare
    prepare_nginx(config_dict)
  File "/usr/src/app/utils/nginx.py", line 23, in prepare_nginx
    render_nginx_template(config_dict)
  File "/usr/src/app/utils/nginx.py", line 56, in render_nginx_template
    prepare_nginx_certs(config_dict['cert_key_path'], config_dict['cert_path'])
  File "/usr/src/app/utils/nginx.py", line 42, in prepare_nginx_certs
    shutil.copy2(host_ngx_cert_key_path, real_key_path)
  File "/usr/lib/python3.6/shutil.py", line 263, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.6/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
IsADirectoryError: [Errno 21] Is a directory: '/hostfs/data/cert'

i know what's wrong

[root@localhost harbor]# more harbor.yml
# Configuration file of Harbor

# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: registry.harbor.com

# http related config
http:
  # port for http, default is 80. If https enabled, this port will redirect to https port
  port: 80

# https related config
https:
  # https port for harbor, default is 443
  port: 443
  # The path of cert and key files for nginx
  certificate: /data/cert/registry.harbor.com.crt
  private_key: /data/cert/registry.harbor.com.key

this section can't config as path

  certificate: /data/cert/
  private_key: /data/cert/

should be

  certificate: /data/cert/registry.harbor.com.crt
  private_key: /data/cert/registry.harbor.com.key

/data/cert files

[root@localhost harbor]# ll /data/cert/
total 8
-rw-r--r-- 1 root root 2126 Jul 21 23:18 registry.harbor.com.crt
-rw-r--r-- 1 root root 3243 Jul 21 23:18 registry.harbor.com.key

but the harbor.yml say "The path of cert and key files for nginx" ??

finally it ok

[root@localhost harbor]# ./install.sh 

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

Note: docker version: 19.03.12

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

Note: docker-compose version: 1.26.2

[Step 2]: loading Harbor images ...
Loaded image: goharbor/trivy-adapter-photon:v2.0.1
Loaded image: goharbor/harbor-portal:v2.0.1
Loaded image: goharbor/harbor-core:v2.0.1
Loaded image: goharbor/harbor-jobservice:v2.0.1
Loaded image: goharbor/notary-server-photon:v2.0.1
Loaded image: goharbor/harbor-log:v2.0.1
Loaded image: goharbor/registry-photon:v2.0.1
Loaded image: goharbor/notary-signer-photon:v2.0.1
Loaded image: goharbor/clair-photon:v2.0.1
Loaded image: goharbor/chartmuseum-photon:v2.0.1
Loaded image: goharbor/prepare:v2.0.1
Loaded image: goharbor/harbor-db:v2.0.1
Loaded image: goharbor/harbor-registryctl:v2.0.1
Loaded image: goharbor/nginx-photon:v2.0.1
Loaded image: goharbor/redis-photon:v2.0.1
Loaded image: goharbor/clair-adapter-photon:v2.0.1


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /data/packages/harbor
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.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
Generated and saved secret to file: /data/secret/keys/secretkey
Successfully called func: create_root_cert
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir



[Step 5]: starting Harbor ...
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating redis         ... done
Creating registry      ... done
Creating harbor-portal ... done
Creating registryctl   ... done
Creating harbor-db     ... done
Creating harbor-core   ... done
Creating harbor-jobservice ... done
Creating nginx             ... done
✔ ----Harbor has been installed and started successfully.----

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