Expired artifacts not deleted

Problem to solve

Hello everyone, I’m having an issue with expired artifacts not being deleted from disk and still downloadable. I have setup artifacts expiration and activated the cron in gitlab.rb file following the documentation, artifacts are correctly expired but they are still downloadable and using storage space. I don’ know if I am missing something or if it’s a bug, I have found this issue (Expired artifacts are not deleted although they should have been (#429909) · Issues · GitLab.org / GitLab · GitLab) but I have verified sideqik cron and it seems good :

Here is an example of expired artifact still available :

Steps to reproduce

Checked artifacts expiration settings : seems OK
Checked cron activation : cron exist and is enabled
Global gitlab check : no errors

Configuration

Versions

Please select whether options apply, and add the version information.

Versions

System information
System:
Proxy: http_proxy: http://myproxyip:3128
https_proxy: http://myproxyip:3128
no_proxy: localhost,mydomain.local,172.16.0.0/16,192.168.0.0/16,10.0.0.0/16
Current User: git
Using RVM: no
Ruby Version: 3.1.4p223
Gem Version: 3.5.5
Bundler Version:2.5.5
Rake Version: 13.0.6
Redis Version: 7.0.15
Sidekiq Version:7.1.6
Go Version: unknown

GitLab information
Version: 16.9.0-ee
Revision: 76326ae8b89
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 14.10
URL: https://gitlab.mydomain.local
HTTP Clone URL: https://gitlab.mydomain.local/some-group/some-project.git
SSH Clone URL: git@gitlab.mydomain.local:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: yes
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version: 14.33.0
Repository storages:

  • default: unix:/var/opt/gitlab/gitaly/gitaly.socket
    GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell

Gitaly

  • default Address: unix:/var/opt/gitlab/gitaly/gitaly.socket
  • default Version: 16.9.0
  • default Git Version: 2.43.0

Up

Anyone can help on this topic please ?

Is this the latest pipeline? If that’s the case it would be expected for the artifacts to stay even after expiry.

I have disable keeping last pipeline artifacts, but I’m still able to download expired artifacts :confused:

The artifacts which were created with the option enabled have to be manually cleaned up.

You can clean them up in the following ways -

  1. Manually delete them via the UI.
  2. Use Gitlab API to delete the artifacts using a script.
  3. From /var/opt/gitlab/gitlab-data/shared/artifacts/<YOUR_PROJECT_HASH> delete artifacts.zip & metadata.gz. Then sync these changes with the DB as mentioned here.

PS - You can obtain the project path from the Admin Panel.