前戏

prepare base dir is set to /apps/harbor

Traceback (most recent call last):

File "/usr/src/app/main.py", line 15, in <module>

cli()

File "/usr/lib/python3.10/site-packages/click/core.py", line 1137, in __call__

return self.main(*args, **kwargs)

File "/usr/lib/python3.10/site-packages/click/core.py", line 1062, in main

rv = self.invoke(ctx)

File "/usr/lib/python3.10/site-packages/click/core.py", line 1668, in invoke

return _process_result(sub_ctx.command.invoke(sub_ctx))

File "/usr/lib/python3.10/site-packages/click/core.py", line 1404, in invoke

return ctx.invoke(self.callback, **ctx.params)

File "/usr/lib/python3.10/site-packages/click/core.py", line 763, in invoke

return __callback(*args, **kwargs)

File "/usr/src/app/commands/prepare.py", line 37, in prepare

config_dict = parse_yaml_config(conf, with_notary=with_notary, with_trivy=with_trivy, with_chartmuseum=with_chartmuseum)

File "/usr/src/app/utils/configs.py", line 122, in parse_yaml_config

config_dict['hostname'] = configs["hostname"]

TypeError: 'NoneType' object is not subscriptable

root@d-server2:/apps/harbor# python -v


Command 'python' not found, did you mean:
command 'python3' from deb python3
command 'python' from deb python-is-python3

报错原因

配置文件​harbor.yml​ 文件格式错误

解决方法

自信查看 ​harbor.yml ​文件并将错误纠正