Skip to content

Fix incorrect storage statistics for packages

Summary

We have received a report where The "packages" storage type is showing 6.9 GiB of storage space being utilized. When we go into the Packages and Containers for this project, We are only seeing 1.26 GiB of storage space being utilized.

This is affecting customers as they are reaching the storage limits.

Please note this issue is scheduled for 15.2 as an investigation so we can understand the scope of the problem prior to scheduling a potential fix.

Example Project

  • Project can be found in this customer ticket

What is the current bug behavior?

The statistics are not getting correctly calculated on any recalculation.

What is the expected correct behavior?

It should correctly calculate the repository statistics.

Relevant logs and/or screenshots

[ gprd ] production>  p.packages.count
=> 36
[ gprd ] production> size = p.package_files.sum(:size)
=> 3373182803
[ gprd ] production> include ActionView::Helpers::NumberHelper
=> Object
[ gprd ] production> number_to_human_size(size)
=> "3.14 GB"

id: 15999736,
 project_id:REDACTED,
 namespace_id: REDACTED,
 commit_count: 1593,
 storage_size: 10888325330,
 repository_size: 3313500,
 lfs_objects_size: 0,
 build_artifacts_size: 501122693,
 shared_runners_seconds: 116430,
 shared_runners_seconds_last_reset:
  Sun, 01 May 2022 00:57:41.730469000 UTC +00:00,
 packages_size: 10383298082,
 wiki_size: 0,
 snippets_size: 136314,
 pipeline_artifacts_size: 0,
 uploads_size: 454741,
 container_registry_size: 0

Screenshot_2022-05-19_at_5.15.21_PM

Screenshot_2022-05-19_at_5.15.53_PM

Screenshot_2022-05-19_at_5.16.17_PM

Output of checks

Results of GitLab environment info

Possible fixes

Edited by Tim Rizzi