goharbor / harbor

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

retention job: get processor for algorithm: : no processor registered with algorithm #20156

Closed gwendollyn closed 5 months ago

gwendollyn commented 8 months ago

Expected behavior and actual behavior: I added retention policy like this.

image

but I kept getting errors: [ERROR] [/pkg/retention/job.go:235]: retention job: get processor for algorithm: : no processor registered with algorithm:

Versions:

Additional context: /var/log/harbor/jobservice.log

Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [INFO] [/jobservice/worker/cworker/c_worker.go:76]: Job incoming: {"name":"RETENTION","id":"30da6916dd66d7b5fa3c5907","t":1711126983,"args":null}
Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [INFO] [/jobservice/worker/cworker/c_worker.go:76]: Job incoming: {"name":"RETENTION","id":"b40a4ab02989e282408916e8","t":1711126983,"args":null}
Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [INFO] [/pkg/config/rest/rest.go:47]: get configuration from url: http://core:8080/api/v2.0/internalconfig
Mar 23 01:03:05 192.168.64.1 jobservice[999]: message repeated 3 times: [ 2024-03-22T17:03:05Z [INFO] [/pkg/config/rest/rest.go:47]: get configuration from url: http://core:8080/api/v2.0/internalconfig]
Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [INFO] [/pkg/retention/job.go:83]: Run retention process.
Mar 23 01:03:05 192.168.64.1 jobservice[999]:  Repository: juancash-financeservice/juancash-financeservice-rel 
Mar 23 01:03:05 192.168.64.1 jobservice[999]:  Rule Algorithm:  
Mar 23 01:03:05 192.168.64.1 jobservice[999]:  Dry Run: false
Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [INFO] [/pkg/retention/job.go:83]: Run retention process.
Mar 23 01:03:05 192.168.64.1 jobservice[999]:  Repository: juancash-financeservice/juancash-financeservice-dev 
Mar 23 01:03:05 192.168.64.1 jobservice[999]:  Rule Algorithm:  
Mar 23 01:03:05 192.168.64.1 jobservice[999]:  Dry Run: false
Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [INFO] [/pkg/retention/job.go:98]: Load 6 candidates from repository juancash-financeservice/juancash-financeservice-dev
Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [ERROR] [/pkg/retention/job.go:235]: retention job: get processor for algorithm: : no processor registered with algorithm: 
Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [ERROR] [/jobservice/runner/redis.go:122]: Job 'RETENTION:b40a4ab02989e282408916e8' exit with error: run error: retention job: get processor for algorithm: : no processor registered with algorithm: 
Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [INFO] [/pkg/retention/job.go:98]: Load 18 candidates from repository juancash-financeservice/juancash-financeservice-rel
Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [ERROR] [/pkg/retention/job.go:235]: retention job: get processor for algorithm: : no processor registered with algorithm: 
Mar 23 01:03:05 192.168.64.1 jobservice[999]: 2024-03-22T17:03:05Z [ERROR] [/jobservice/runner/redis.go:122]: Job 'RETENTION:30da6916dd66d7b5fa3c5907' exit with error: run error: retention job: get processor for algorithm: : no processor registered with algorithm: 
stonezdj commented 8 months ago

Can you please try to reproduce the issue in the latest harbor? for example: https://demo.goharbor.io

gwendollyn commented 8 months ago

Can you please try to reproduce the issue in the latest harbor? for example: https://demo.goharbor.io

image
stonezdj commented 8 months ago

It seems that you created this rule through API and the algorithm field is missed. default it should be "algorithm":"or" the backend API should validate the input first or use the default value

gwendollyn commented 8 months ago

@stonezdj Thanks for the answer. But I got same errors even if I manually created another new retention policy on the project.

github-actions[bot] commented 6 months 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.

github-actions[bot] commented 5 months ago

This issue was closed because it has been stalled for 30 days with no activity. If this issue is still relevant, please re-open a new issue.