`gitlab-rake gitlab:cleanup:orphan_job_artifact_files DRY_RUN=false` is not removing artifacts
Summary
When the DRY_RUN=false
flag is specified, a job should remove the orphaned artifacts. The rake task is successful but the artifacts are not being removed.
Steps to reproduce
- Create an artifact 6 folders deep, in this case
mkdir -p /var/opt/gitlab/gitlab-rails/shared/artifacts/test/test/test/test/test/test && chown git:root /var/opt/gitlab/gitlab-rails/shared/artifacts/test/test/test/test/test/test
- Run
gitlab-rake gitlab:cleanup:orphan_job_artifact_files DRY_RUN=false
. - File is still there, even though the rake task said that the file would be cleaned up.
- Run
gitlab-rake gitlab:cleanup:orphan_job_artifact_files DRY_RUN=false
again, an orphan is still being found.
Example Project
What is the current bug behavior?
The rake task reports the orphan but does not remove it.
What is the expected correct behavior?
If the DRY_RUN=false
flag is specified, it should find and remove the orphan.
Relevant logs and/or screenshots
root@adamm-support:/var/opt/gitlab/gitlab-rails/shared/artifacts# gitlab-rake gitlab:cleanup:orphan_job_artifact_files DRY_RUN=false
I, [2019-09-23T00:34:32.281363 #28044] INFO -- : Looking for orphan job artifacts to clean up
I, [2019-09-23T00:34:32.281649 #28044] INFO -- : find command: '/usr/bin/ionice --class Best-effort find -L /var/opt/gitlab/gitlab-rails/shared/artifacts -mindepth 6 -maxdepth 6 -type d'
I, [2019-09-23T00:34:32.331085 #28044] INFO -- : Processed 1 job artifacts to find and clean 1 orphans.
root@adamm-support:/var/opt/gitlab/gitlab-rails/shared/artifacts# gitlab-rake gitlab:cleanup:orphan_job_artifact_files DRY_RUN=false
I, [2019-09-23T00:38:30.432025 #28547] INFO -- : Looking for orphan job artifacts to clean up
I, [2019-09-23T00:38:30.432249 #28547] INFO -- : find command: '/usr/bin/ionice --class Best-effort find -L /var/opt/gitlab/gitlab-rails/shared/artifacts -mindepth 6 -maxdepth 6 -type d'
I, [2019-09-23T00:38:30.480219 #28547] INFO -- : Processed 1 job artifacts to find and clean 1 orphans.
Output of checks
Results of GitLab environment info
Results of GitLab application Check
Possible fixes
Links
Edited by Adam Mulvany