gitlab:backup:restore does not clean tmp directory in backups directory

Summary

We run two instances of gitlab. An active and a passive instance. The passive instance restores a backup from the active instance every night. Since 10.7.2 the backups/tmp directory is not deleted anymore. We got an disk-full alert after 4 days.

Steps to reproduce

Run "gitlab-rake gitlab:backup:restore BACKUP=...".

What is the current bug behavior?

backups/tmp not deleted.

What is the expected correct behavior?

backups/tmp should be deleted after successfull restore.

Relevant logs and/or screenshots

Logs look the same as before:

ok: down: unicorn: 0s, normally up
ok: down: sidekiq: 1s, normally up
Unpacking backup ... done
Cleaning the database ... 
done
Restoring database ... 
Restoring PostgreSQL database gitlabhq_production ... SET
SET
[...]
Deleting tmp directories ... done
done
done
done
done
done
done
done
DELETE 154
ok: run: unicorn: (pid 26183) 0s
ok: run: sidekiq: (pid 26212) 1s

See the "Deleting tmp directories ... done"

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:		Debian 8.10
Current User:	git
Using RVM:	no
Ruby Version:	2.3.6p384
Gem Version:	2.6.13
Bundler Version:1.13.7
Rake Version:	12.3.0
Redis Version:	3.2.11
Git Version:	2.14.3
Sidekiq Version:5.0.5
Go Version:	unknown

GitLab information Version: 10.7.2 Revision: 4628694 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://SERVERNAME HTTP Clone URL: https://SERVERNAME/some-group/some-project.git SSH Clone URL: ssh://git@SERVERNAME/some-group/some-project.git Using LDAP: yes Using Omniauth: yes Omniauth Providers: cas3

GitLab Shell Version: 7.1.2 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...

GitLab Shell version >= 7.1.2 ? ... OK (7.1.2) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... [...]Thousands of "ok"[...] Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Reply by email is disabled in config/gitlab.yml Checking LDAP ...

Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) [...]Hundreds of our users[...] Checking LDAP ... Finished

Checking GitLab ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... no Try fixing it: sudo chown -R git /var/opt/gitlab/gitlab-rails/uploads sudo find /var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} ; sudo find /var/opt/gitlab/gitlab-rails/uploads -type d -not -path /var/opt/gitlab/gitlab-rails/uploads -exec chmod 0700 {} ; For more information see: doc/install/installation.md in section "GitLab" Please fix the error above and rerun the checks. Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... [...]Thousands of yes[...] Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.6) Git version >= 2.9.5 ? ... yes (2.14.3) Git user has default SSH configuration? ... yes Active users: ... 787

Checking GitLab ... Finished