Artifact usage is inaccurate and unable to refresh through Rails Console
Summary
Since September we've had a few cases where artifact usage is not being calculated properly, especially after using our API endpoints to remove artifacts.
- https://gitlab.com/gitlab-com/support/internal-requests/-/issues/24729
- https://gitlab.com/gitlab-com/support/internal-requests/-/issues/24771
- https://gitlab.com/gitlab-com/support/internal-requests/-/issues/24670
- https://gitlab.com/gitlab-com/support/internal-requests/-/issues/24691
- https://gitlab.com/gitlab-com/support/internal-requests/-/issues/25041
- https://gitlab.com/gitlab-com/support/internal-requests/-/issues/24986
- https://gitlab.com/gitlab-com/support/internal-requests/-/issues/25193
This issue is being opened to track and discuss inaccuracies and issues with updating project statistics for builds and artifacts.
We've tried using Projects::BuildArtifactsSizeRefresh in an attempt to refresh statistics, but we've seen stats set/stuck to 0 and not being recalculated.
Steps to reproduce
Not able to reproduce directly, but we have multiple example projects in the internal issues.
What is the current bug behavior?
After removing artifacts, usage quotas are not changing and reflecting the removal of artifacts.
What is the expected correct behavior?
Artifact usage quotas should be updated within a reasonable amount of time once artifacts have been removed.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: \\\`sudo gitlab-rake gitlab:env:info\\\`) (For installations from source run and paste the output of: \\\`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\\\`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of: \`sudo gitlab-rake gitlab:check SANITIZE=true\`) (For installations from source run and paste the output of: \`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true\`) (we will only investigate if the tests are passing)
Possible fixes
Investigate why the Rails Console workaround has stopped working.