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

unauthorized to list catalog #81

Open
badsmoke opened this issue Sep 6, 2022 · 2 comments
Open

unauthorized to list catalog #81

badsmoke opened this issue Sep 6, 2022 · 2 comments

Comments

@badsmoke
Copy link

badsmoke commented Sep 6, 2022

Hello I get a "unauthorized to list catalog",

i want to sync images from a harbor instance, the login is correct (checked several times, i can push to it with the same credentials), the link works too.

level=error msg="error getting catalog page: GET https://hub.domain.com/v2/_catalog?last=&n=100: UNAUTHORIZED: unauthorized to list catalog"

to the config:

i would like to syncronize two namespaces with the help of regex, harbor itself offers this possibility only very limited.

?last=&n=100
what still surprises me is that the number of tags to be retrieved is set to 100, even though 1000 is set in the config.

i use the latest xelalex/dregsy docker image version

in another sync job, i push to the same harbor instance, that works.

But with the list there are problems

I hope you can help me

@xelalexv
Copy link
Owner

Sorry for the late reply! I'm not familiar with Harbor, and don't have an instance available for testing right now. In general, push&pull authorization may not necessarily be the same as authorization for listing catalogs. It's also possible that Harbor doesn't fully implement v2/_catalog, or does it in a slightly different way.

Could you try to retrieve the catalog with curl using the URL from the error message? We need to find out whether Harbor's implementation of the v2/_catalog API possibly requires a bearer token for authentication. dregsy currently uses basic auth by default, and bearer token only for GCR registries. You will probably have to experiment a little to get the right bearer token into the curl request.

?last=&n=100
what still surprises me is that the number of tags to be retrieved is set to 100, even though 1000 is set in the config.

The n=100 is just the page size. If you set lister.maxItems to 1000, then at most 10 pages will be retrieved.

@badsmoke
Copy link
Author

badsmoke commented Nov 8, 2022

now i have lost sight of it myself.

with basic auth i can get everything without problems

curl https://user:password@hub.zigpos.com/v2/_catalog?last=&n=1000

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

No branches or pull requests

2 participants