Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install.sh Fail to generate key file #2920

Closed
StephenPCG opened this issue Jul 30, 2017 · 18 comments
Closed

install.sh Fail to generate key file #2920

StephenPCG opened this issue Jul 30, 2017 · 18 comments

Comments

@StephenPCG
Copy link

I'm installing v1.1.2 on a fresh debian 9, install.sh failed with the following output:

$ sudo ./install.sh

[Step 0]: checking installation environment ...

Note: docker version: 17.06.0

Note: docker-compose version: 1.14.0

[Step 1]: loading Harbor images ...
Loaded image: vmware/harbor-jobservice:v1.1.2
Loaded image: vmware/nginx:1.11.5-patched
Loaded image: photon:1.0
Loaded image: vmware/notary-photon:server-0.5.0
Loaded image: vmware/notary-photon:signer-0.5.0
Loaded image: vmware/harbor-adminserver:v1.1.2
Loaded image: vmware/harbor-ui:v1.1.2
Loaded image: vmware/harbor-log:v1.1.2
Loaded image: vmware/harbor-db:v1.1.2
Loaded image: vmware/registry:2.6.1-photon
Loaded image: vmware/harbor-notary-db:mariadb-10.1.10


[Step 2]: preparing environment ...
Generated and saved secret to file: /data/secretkey
Generated configuration file: ./common/config/nginx/nginx.conf
Generated configuration file: ./common/config/adminserver/env
Generated configuration file: ./common/config/ui/env
Generated configuration file: ./common/config/registry/config.yml
Generated configuration file: ./common/config/db/env
Generated configuration file: ./common/config/jobservice/env
Generated configuration file: ./common/config/jobservice/app.conf
Generated configuration file: ./common/config/ui/app.conf
Fail to generate key file: ./common/config/ui/private_key.pem, cert file: ./common/config/registry/root.crt

After reading the prepare script and added some debugging print() calls, I found the following command failed:

$ sudo openssl  req -new -x509 -key ./common/config/ui/private_key.pem -out ./common/config/registry/root.crt -days 3650 -subj '/C=/ST=/L=/O=/CN=
/'
problems making Certificate Request
139925692761344:error:0D07A098:asn1 encoding routines:ASN1_mbstring_ncopy:string too short:../crypto/asn1/a_mbstr.c:102:minsize=2

I changed empty_subj to / and successfully run ./prepare.

openssl version is:

$ openssl version
OpenSSL 1.1.0f  25 May 2017
@steven-zou
Copy link
Contributor

@wy65701436
Please help to take a look at this issue to confirm if there is an issue existing.

@sdandroid
Copy link

sdandroid commented Aug 11, 2017

debian 9 same issue,the issue maby OpenSSL not allow empty subject.

@kelu27
Copy link

kelu27 commented Sep 8, 2017

same issue on debian9 with v1.2.0-rc5

@wy65701436
Copy link
Contributor

I will have a reproduce on debian 9.

1 similar comment
@corentin59
Copy link

I will have a reproduce on debian 9.

@pppoke
Copy link

pppoke commented Dec 1, 2017

same issue on on deepin linux 4.9.29-4.

@yuxingxin
Copy link

The same issue happend to me , my OS is also debian 9, I replace the default key and certificate. Assume that you key and certificate are in the directory /root/cert, following are what you should do:

$ cd config/ui
$ cp /root/cert/private_key.pem private_key.pem
$ cp /root/cert/root.crt ../registry/root.crt

then using following command:

  $ docker-compose down
  $ docker-compose up -d

well done!

@bweston92
Copy link

Same on Debian Buster. Thing is I'm not even using SSL so why is it even attempting to generate them?

@teknologist
Copy link

to fix this on Debian 9 just edit prepare script and change:
empty_subj = "/C=/ST=/L=/O=/CN=/"
to
empty_subj = "/"

works like a charm here

@sangrealest
Copy link

Same on Fedora 28. Followed @teknologist 's comment, it works.

@jouve
Copy link
Contributor

jouve commented May 14, 2018

the issue is also present in the latest ubuntu LTS (18.04).

@ahbrosha
Copy link

the issue appears also on ArchLinux. @teknologist advise fixed it! Thanks 👍

@KeithTt
Copy link

KeithTt commented May 31, 2018

@teknologist Thanks, fixed it!

@yalinyee
Copy link

yalinyee commented Aug 7, 2018

I have zhe same problem on Ubuntu18.04,Harbor version v1.5.1
openssl version is:
OpenSSL 1.1.0g 2 Nov 2017

how to solve this problem???

@liran
Copy link

liran commented Nov 10, 2018

I currently use Harbor version v1.5 at Ubuntu18.04 and have this problem. #5260

@trustbyte
Copy link

trustbyte commented Jun 11, 2019

i have this one also:

root@:~/harbor/harbor# docker-compose --verbose version docker-compose version 1.25.0-rc1, build 8552e8e2 docker-py version: 4.0.1 CPython version: 3.7.3 OpenSSL version: OpenSSL 1.1.0j 20 Nov 2018
root@:~/harbor/harbor# ./prepare --with-notary --with-clair
prepare base dir is set to /root/harbor/harbor
Traceback (most recent call last):
File "main.py", line 62, 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 31, in main
config_dict = parse_yaml_config(conf)
File "/usr/src/app/utils/configs.py", line 55, in parse_yaml_config
configs = yaml.load(f)
File "/usr/lib/python3.6/site-packages/yaml/init.py", line 73, in load
return loader.get_single_data()
File "/usr/lib/python3.6/site-packages/yaml/constructor.py", line 35, in get_single_data
node = self.get_single_node()
File "/usr/lib/python3.6/site-packages/yaml/composer.py", line 36, in get_single_node
document = self.compose_document()
File "/usr/lib/python3.6/site-packages/yaml/composer.py", line 55, in compose_document
node = self.compose_node(None, None)
File "/usr/lib/python3.6/site-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/usr/lib/python3.6/site-packages/yaml/composer.py", line 127, in compose_mapping_node
while not self.check_event(MappingEndEvent):
File "/usr/lib/python3.6/site-packages/yaml/parser.py", line 98, in check_event
self.current_event = self.state()
File "/usr/lib/python3.6/site-packages/yaml/parser.py", line 439, in parse_block_mapping_key
"expected , but found %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a block mapping
in "/input/harbor.yml", line 5, column 1
expected , but found ''
in "/input/harbor.yml", line 13, column 2

@barryz
Copy link
Contributor

barryz commented Jul 18, 2019

the issue is also present in the latest ubuntu LTS (18.04).

the workaroud same as the answer who @teknologist replied.

@yinjunfa
Copy link

解决这个问题Debian的9只编辑准备的脚本和变化:
empty_subj = "/C=/ST=/L=/O=/CN=/"

empty_subj = "/"

在这里像魅力一样工作

very good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests