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

GC doesn't work in the next run after click on stop button #21416

Open
PrzemekZglinicki opened this issue Jan 14, 2025 · 2 comments
Open

GC doesn't work in the next run after click on stop button #21416

PrzemekZglinicki opened this issue Jan 14, 2025 · 2 comments
Assignees
Labels
area/gc more-info-needed The issue author need to provide more details and context to the issue

Comments

@PrzemekZglinicki
Copy link

PrzemekZglinicki commented Jan 14, 2025

I want to run Garbage Collection form web UI. I started it but in the same time I read somewhere in the internet that it removed all images for someone, so I decided to stop it, pull locally the most important images to have backups and run it again. In the next run GC didn't detect any blobs and manifests to remove.

GC didn't removed any blobs and manifests in the first run which was stopped, and didn't detect any blobs and manifests to remove in the next run.

Expected behavior and actual behavior:
Stop button shouldn't impact next runs of the GC.

Steps to reproduce the problem:
Set up retention policy, observe that size showed in the general projects and inside project are different - due to run of retention policy and remaining garbage blobs and manifests, run GC, stop it in the meantime, run GC again.

Versions:
Please specify the versions of following systems.

  • harbor version: 2.12.1
  • docker engine version: 27.1.2
  • docker-compose version: 1.29.21

Additional context:
harbor_log_and_config.zip

@stonezdj
Copy link
Contributor

stonezdj commented Jan 15, 2025

From the jobservice logs, we can find two GC execution did free space.

Jan 14 10:34:10 misc jobservice[938]: 2025-01-14T10:34:10Z [INFO] [/jobservice/job/impl/gc/garbage_collection.go:480]: 14 blobs and 3 manifests are actually deleted
Jan 14 10:34:10 misc jobservice[938]: 2025-01-14T10:34:10Z [INFO] [/jobservice/job/impl/gc/garbage_collection.go:481]: The GC job actual frees up 140 MB space.

Jan 14 11:09:12 misc jobservice[938]: 2025-01-14T11:09:12Z [INFO] [/jobservice/job/impl/gc/garbage_collection.go:480]: 38 blobs and 10 manifests are actually deleted
Jan 14 11:09:12 misc jobservice[938]: 2025-01-14T11:09:12Z [INFO] [/jobservice/job/impl/gc/garbage_collection.go:481]: The GC job actual frees up 2515 MB space. 

@wy65701436
Copy link
Contributor

If the issue you're referring to is this one, it has already been resolved. This issue only occurred in specific edge cases, as explained in this comment.

Regarding the second execution, based on the logs you attached, the first execution that was stopped has already completed successfully and removed all the candidates. That’s why there are no remaining candidates to be removed. Please try creating more candidates and then retry the GC process.

@wy65701436 wy65701436 added the more-info-needed The issue author need to provide more details and context to the issue label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gc more-info-needed The issue author need to provide more details and context to the issue
Projects
Status: No status
Development

No branches or pull requests

3 participants