Harbor: 1.8.3 upgread to 1.9.0 : FileNotFoundError: [Errno 2] No such file or directory: '/hostfs/data/cert/x.pf.abc.com.key'

Created on 19 Sep 2019  ·  5Comments  ·  Source: goharbor/harbor

HI
I get some errs when I upgread harbor from 1.8.3 to 1.9.0 :

prepare base dir is set to /home/work/app/harbortest/harbor
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/log/logrotate.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 64, 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 36, 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:
FileNotFoundError: [Errno 2] No such file or directory: '/hostfs/data/cert/x.pf.abc.com.key'

Is there something be missed in the upgread process & documentation

Thank you

areupgrade

Most helpful comment

We had similar issue on RHEL7 and the solution was to modifiy the file prepare line:53 from

-v /:/hostfs:z \

to

-v $cert_dir:/hostfs:z \

Where $cert_dir is the directory that contain the SSL certificates

and for harbor.yml the https certificate path is set to /

certificate: /server.cer
private_key: /server.key

So far it is working for us

All 5 comments

Where did you put this file
x.pf.abc.com.key

I put this file : "/data/cert/x.pf.abc.com.key" , And the file ”harbor.yml“ is transformed form version 1.8.3。

is any dir in your path is symbal link?

We had similar issue on RHEL7 and the solution was to modifiy the file prepare line:53 from

-v /:/hostfs:z \

to

-v $cert_dir:/hostfs:z \

Where $cert_dir is the directory that contain the SSL certificates

and for harbor.yml the https certificate path is set to /

certificate: /server.cer
private_key: /server.key

So far it is working for us

@alchatti thanks
@ninjadq yes . The dir "/data/cert/" is a symbal link . I change the harbor.yml from

/data/cert/x.pf.abc.com.crt

to

/home/work/data/cert/x.pf.xiaomi.com.crt

and it working for us.

thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

izhichao picture izhichao  ·  3Comments

Hotege picture Hotege  ·  3Comments

Poil picture Poil  ·  3Comments

a-kinder picture a-kinder  ·  3Comments

steveal picture steveal  ·  3Comments