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 · 15 comments

Comments

Projects
None yet
@StephenPCG
Copy link

StephenPCG commented Jul 30, 2017

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 steven-zou added the kind/bug label Aug 1, 2017

@steven-zou

This comment has been minimized.

Copy link
Contributor

steven-zou commented Aug 1, 2017

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

@sdandroid

This comment has been minimized.

Copy link

sdandroid commented Aug 11, 2017

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

@kelu27

This comment has been minimized.

Copy link

kelu27 commented Sep 8, 2017

same issue on debian9 with v1.2.0-rc5

@wy65701436

This comment has been minimized.

Copy link
Contributor

wy65701436 commented Nov 13, 2017

I will have a reproduce on debian 9.

1 similar comment
@corentin59

This comment has been minimized.

Copy link

corentin59 commented Nov 18, 2017

I will have a reproduce on debian 9.

@pppoke

This comment has been minimized.

Copy link

pppoke commented Dec 1, 2017

same issue on on deepin linux 4.9.29-4.

@yuxingxin

This comment has been minimized.

Copy link

yuxingxin commented Dec 15, 2017

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

This comment has been minimized.

Copy link

bweston92 commented Jan 4, 2018

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

@teknologist

This comment has been minimized.

Copy link

teknologist commented Jan 26, 2018

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

This comment has been minimized.

Copy link

sangrealest commented May 9, 2018

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

@jouve

This comment has been minimized.

Copy link
Contributor

jouve commented May 14, 2018

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

@ahbrosha

This comment has been minimized.

Copy link

ahbrosha commented May 14, 2018

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

@KeithTt

This comment has been minimized.

Copy link

KeithTt commented May 31, 2018

@teknologist Thanks, fixed it!

@yalinyee

This comment has been minimized.

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???

@RanQiwu

This comment has been minimized.

Copy link

RanQiwu commented Nov 10, 2018

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

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