vms icon indicating copy to clipboard operation
vms copied to clipboard

[Harbor] /etc/core/key does not meet correct key lenght size

Open HSoulat opened this issue 1 year ago • 6 comments

Platform

Azure

bndiagnostic ID know more about bndiagnostic ID

none

bndiagnostic output

No response

bndiagnostic was not useful. Could you please tell us why?

Not related to Habor configuration

Describe your issue as much as you can

Encryption key lenght in /etc/core/key should be 16 bits long. Bitnami image is generating 64 bits long key.

This difference trigger the following error when we try to add external registry with credentials. 2023-05-15T14:31:25+02:00 [ERROR] [/lib/http/error.go:56]: {"errors":[{"code":"UNKNOWN","message":"unknown: crypto/aes: invalid key size 64"}]}

Here the linked issues / pull request on goharbor project

https://github.com/goharbor/harbor-operator/issues/326 https://github.com/goharbor/harbor-operator/pull/404

HSoulat avatar May 15 '23 12:05 HSoulat

Hi @HSoulat.

Thanks for using Bitnami and for reporting this issue. I have created a new internal task for our engineering team to work on a fix for this. I'm also moving the ticket to "on-hold" status so the stale bot doesn't close it due to inactivity.

gongomgra avatar May 17 '23 09:05 gongomgra

bumped into an exact same issue with Bitnami Harbor v2.10.0-6abb4ea - it prevents us from adding external registry endpoints. The error is exactly the same mentioned in the original issue comment

mpostelnicu avatar Mar 06 '24 16:03 mpostelnicu

Hi @mpostelnicu,

Thanks for using Bitnami. Unfortunately, our engineering team didn't have time to work on this yet, but I will ping them. We will keep you posted.

gongomgra avatar Mar 07 '24 08:03 gongomgra

Platform

Azure

bndiagnostic ID know more about bndiagnostic IDgm-socrates

none

bndiagnostic output

No response

bndiagnostic was not useful. Could you please tell us why?

Not related to Habor configuration

Describe your issue as much as you can

Encryption key lenght in /etc/core/key should be 16 bits long. Bitnami image is generating 64 bits long key.

This difference trigger the following error when we try to add external registry with credentials. 2023-05-15T14:31:25+02:00 [ERROR] [/lib/http/error.go:56]: {"errors":[{"code":"UNKNOWN","message":"unknown: crypto/aes: invalid key size 64"}]}

Here the linked issues / pull request on goharbor project

goharbor/harbor-operator#326 goharbor/harbor-operator#404

Hello,

Thanks for sharing this issue. I am also facing this but i can't fund any ideas how to overcome this. If you got the solution please help.

Best regards, florence023

florence0239 avatar Jul 10 '24 06:07 florence0239

Hi, same problem harbor-core | 2024-08-13T10:22:36.958880690Z 2024-08-13T10:22:36Z [ERROR] [/lib/http/error.go:57]: {"errors":[{"code":"UNKNOWN","message":"unknown: crypto/aes: invalid key size 17"}]} I cant connect any repository with authentication. With this problem i cant use harbor :(

Thanks, Bj

kash1983 avatar Aug 13 '24 10:08 kash1983

@kash1983 @florence0239 I understand you should be able to workaround this by manually setting a valid key size into the file and then you restart all services. You can try the next command to populate it (notice you may need sudo privileges)

head -n "256" /dev/urandom | tr -dc "a-zA-Z0-9" | head -c "17" > /etc/core/key

Hope it helps!

gongomgra avatar Aug 19 '24 15:08 gongomgra