goharbor / harbor

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

Cache Clearance Causing 404 Havoc #20417

Open suning-li opened 2 months ago

suning-li commented 2 months ago

Hello Harbor Team,

I've encountered a recurring issue with image caching. Specifically, after the cache is cleared, any requests to access images return a 404 error until the cache is eventually repopulated. This issue resolves itself after some time, but it does disrupt the normal flow of operations.

Steps to Reproduce:

GET https://xxxxx.com/v2/etscache/library/nextcloud/manifests/latest: NOT_FOUND: artifact etscache/library/nextcloud:latest not found

Wait about half an hour, get it again, and you can download it

Expected Behavior: I would expect that there would be a mechanism to either prevent this issue or handle it more gracefully, rather than directly returning a 404 error to the client.

Additional Information:

I understand that this might be due to the cache rebuilding process, but any guidance on how to mitigate this issue or improve the experience would be greatly appreciated.

Thank you for your assistance and the great work you do!

Best regards, Suning

wy65701436 commented 2 months ago

when you refer to cache, are you specifically addressing the cache layer outlined in the harbor yaml? https://github.com/goharbor/harbor/blob/main/make/harbor.yml.tmpl#L300

suning-li commented 1 month ago

You mentioned the Settings, we did not make any changes, the only difference is We are using create a project as a proxy to get all the official file packages. As shown in the figure。 WeChat2fe049ef05f68a5744c77ef5ab574dcd

yexia553 commented 1 month ago

Hi harbor team, I am the same team with suning-li, our issue is that we created an proxy cache to https://hub.docker.com. and our internal developer will pull imgaes from it. but we found that we get below error sometimes:

GET https://xxxxx.com/v2/xxx/library/nextcloud/manifests/latest: NOT_FOUND: artifact etscache/library/nextcloud:latest not found

we will could download it just wait for a while without any other action. I guess it related with proxy cache mechanism, but I didn't find any documents about it in https://goharbor.io/docs

This issue does not only occur with the Nextcloud image; it happens with any image.

thank you