goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.85k stars 4.74k forks source link

Harbor Retention Policy Rules Fails for Multiple Wildcards Repositories #20610

Open dinukarajapaksha opened 3 months ago

dinukarajapaksha commented 3 months ago

Harbor Helm Version: 1.12.0

When multiple wildcards are added to the Harbor retention rules repositories there is an 500 Internal Server Error when executed dry-run

For an example if repositories are configured as respository1/**, respository2/** in the retention rules it will fail with an Internal Server Error when dry-run is executed.

image

Endpoint: /api/v2.0/retentions/3/executions
Response: {"errors":[{"code":"UNKNOWN","message":"internal server error"}]}
x-request-id: 043f77ce03b62e6b54807946a3795fec

No specific logs are found from the server side

image

Appreciate your help on this matter. Thanks in advance.

MinerYang commented 3 months ago

Hi @dinukarajapaksha ,

Could you provide harbor-core and jobservice logs while you creating the policy?

zyyw commented 3 months ago

Could you please try respository1/**,respository2/** (no space after ,) in the tag retention rule?

dinukarajapaksha commented 3 months ago

Could you please try respository1/**,respository2/** (no space after ,) in the tag retention rule?

I tried that but didn't work

Hi @dinukarajapaksha ,

Could you provide harbor-core and jobservice logs while you creating the policy?

There are no logs from the job service. There are couple from the core service but not sure if it is related to the execution.


Jun 24 20:20:40.138  | harbor-core | /usr/local/go/src/net/http/server.go:2122, net/http.HandlerFunc.ServeHTTP
-- | -- | -- | --
  | Jun 24 20:20:40.138  | harbor-core | /harbor/src/server/middleware/artifactinfo/artifact_info.go:62, github.com/goharbor/harbor/src/server/middleware/artifactinfo.Middleware.func1.1
  | Jun 24 20:20:40.138 | harbor-core | /usr/local/go/src/net/http/server.go:2122, net/http.HandlerFunc.ServeHTTP
  | Jun 24 20:20:40.138  | harbor-core | /harbor/src/vendor/github.com/beego/beego/v2/server/web/router.go:1002, github.com/beego/beego/v2/server/web.(*ControllerRegister).ServeHTTP
  | Jun 24 20:20:40.138  | harbor-core | /usr/local/go/src/net/http/server.go:2122, net/http.HandlerFunc.ServeHTTP
  | Jun 24 20:20:40.138  | harbor-core | /usr/local/go/src/net/http/server.go:2122, net/http.HandlerFunc.ServeHTTP
  | Jun 24 20:20:40.138  | harbor-core | /harbor/src/server/v2.0/restapi/operations/retention/trigger_retention_execution.go:21, github.com/goharbor/harbor/src/server/v2.0/restapi/operations/retention.TriggerRetentionExecutionHandlerFunc.Handle
  | Jun 24 20:20:35.265  | harbor-core | 2024-06-24T14:50:35Z [WARNING] [/pkg/systeminfo/imagestorage/filesystem/driver.go:51]: The path /data is not found, will return zero value of capacity

@zyyw @MinerYang I edited the comment above as this occur when dry-run is executed

github-actions[bot] commented 1 month ago

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.