summaryrefslogtreecommitdiff
path: root/doc/administration/raketasks/check.md
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /doc/administration/raketasks/check.md
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'doc/administration/raketasks/check.md')
-rw-r--r--doc/administration/raketasks/check.md31
1 files changed, 30 insertions, 1 deletions
diff --git a/doc/administration/raketasks/check.md b/doc/administration/raketasks/check.md
index 15014fffd01..bdccd6d5fe9 100644
--- a/doc/administration/raketasks/check.md
+++ b/doc/administration/raketasks/check.md
@@ -148,9 +148,38 @@ above.
for the affected project(s).
If the issue persists, try triggering `gc` via the
-[Rails Console](../troubleshooting/navigating_gitlab_via_rails_console.md#starting-a-rails-console-session):
+[Rails Console](../operations/rails_console.md#starting-a-rails-console-session):
```ruby
p = Project.find_by_path("project-name")
Projects::HousekeepingService.new(p, :gc).execute
```
+
+### Delete references to missing remote uploads
+
+`gitlab-rake gitlab:uploads:check VERBOSE=1` detects remote objects that do not exist because they were
+deleted externally but their references still exist in the GitLab database.
+
+Example output with error message:
+
+```shell
+$ sudo gitlab-rake gitlab:uploads:check VERBOSE=1
+Checking integrity of Uploads
+- 100..434: Failures: 2
+- Upload: 100: Remote object does not exist
+- Upload: 101: Remote object does not exist
+Done!
+```
+
+To delete these references to remote uploads that were deleted externally, open the [GitLab Rails Console](../operations/rails_console.md#starting-a-rails-console-session) and run:
+
+```ruby
+uploads_deleted=0
+Upload.find_each do |upload|
+ next if upload.retrieve_uploader.file.exists?
+ uploads_deleted=uploads_deleted + 1
+ p upload ### allow verification before destroy
+ # p upload.destroy! ### uncomment to actually destroy
+end
+p "#{uploads_deleted} remote objects were destroyed."
+```