Skip to content

The tags API timeout when tags > 2000 #13098

@stonezdj

Description

@stonezdj
  1. Push a image to Harbor and create 2000 tags in this repo.
    2.Try to get the tags
    "https:///api/repositories/library/nginx-photon/tags"
  2. The request is timeout with 504 error
    This issue only ocurr in Harbor version <=1.10.x

It is because the https://github.com/goharbor/harbor/blob/d8336c45496f5139321b08d7a406271185312fa7/src/core/api/repository.go#L654-L653, it send lots of request to the registry and registry need to connect redis to get the tag information. for each request, it needs to open a file, if it reaches the max open file per process, then the redis can not be connected, with the following error:
"error connecting to redis instance redis:6379"

It is not recommended to create tags > 1000 in a single repo when Harbor version <= 1.10.x
This issue can not be reproduced in Harbor 2.x because it doesn't query tags by http request.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions