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

unknown: crypto/aes: invalid key size 26 when adding new endpoint with access id/secret #20926

Open
NiklasRosenstein opened this issue Sep 15, 2024 · 2 comments
Assignees

Comments

@NiklasRosenstein
Copy link

If you are reporting a problem, please make sure the following information are provided:

Expected behavior and actual behavior:

Saving a new endpoint that uses credentials should succeed after the "Test Connection" was also successful.

Steps to reproduce the problem:

  • Go to Administration > Registries
  • Click + New Endpoint
  • Select "Harbor" or "Docker Registry" as the Provider (behaviour for both is the same)
  • Choose another Harbor instance for the Endpoint URL
  • Set Access ID and Secret to a Robot account of the other Harbor instance
  • Click Test Connection and note how it says "Connection tested successfully."
  • Click Ok to save, but get a red box with "internal server error" instead.

Looking at harbor-core, the corresponding logs say:

2024-09-15T20:55:10Z [ERROR] [/lib/http/error.go:57]: {"errors":[{"code":"UNKNOWN","message":"unknown: crypto/aes: invalid key size 26"}]} 

I've found the following other issues but there was either no resolution or the suggested workaround did not work.

The last one in particular suggests that the Access Secret cannot have a length greater than 16; but how am I supposed to replicate between two Harbor instances then when Robot account passwords are automatically generated and 32 characters in length?

Versions:

  • harbor chart version: 1.15.1
  • harbor version: 2.1.1
@NiklasRosenstein
Copy link
Author

I managed to work around this by manually creating a new user (instead of a Robot account) with a password of 16 characters. This was complicated a bit further by the fact that by source instance was configured to use OIDC, and I couldn't find a way to create a new user as the UI would not allow me to (even after turning off that the OIDC method is the primary authentication method).

@stonezdj
Copy link
Contributor

you need to check the /data/secret/secretkey, make sure it has the right length. or you remove this file and run install again.

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

3 participants