Backup to NFS share won't release registry.tar.gz
Summary
(Summarize the bug encountered concisely) I run a Gitlab Omnibus installation that back-ups to our QNAP NAS via a NFS share every night. I've set this up according to the documentation, but I'm running into an issue where it won't release the files after creating the backup. It appears to create registry.tar.gz, but never actually releasing it. Causing it to trigger a 'silly rename', eventually filling up our NAS with 'garbage'.
I've tried to remove the files, but I get "device or resource busy", so it appears Gitlab is not releasing them.
Steps to reproduce
- Set up Gitlab to back-up to a NFS share. I use the following settings:
/etc/gitlab/gitlab.rb
gitlab_rails['backup_keep_time'] = 604800
gitlab_rails['backup_upload_connection'] = {
:provider => 'Local',
:local_root => '/mnt/nas/gitlab-server/backups'
}
gitlab_rails['backup_upload_remote_directory'] = '.'
And the following cronjob as follow:
0 2 * * * /opt/gitlab/bin/gitlab-backup create CRON=1
\
- Let it back-up the registries
- Wait for another back-up to trigger, a .nfsXXXXX file will appear
What is the current bug behavior?
The registry.tar.gz
back-up will not be released, causing a silly rename to occur on the next back-up.
What is the expected correct behavior?
The file handle on the registry.tar.gz
gets closed so that upon creating the next back-up, the old one can be removed.
Relevant logs and/or screenshots
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info
)System information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.6.3p62 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.22.0 Sidekiq Version:5.2.7 Go Version: unknown GitLab information Version: 12.3.6 Revision: 82ff748612c Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.9 URL: https://git.demonsters.com HTTP Clone URL: https://git.demonsters.com/some-group/some-project.git SSH Clone URL: git@git.demonsters.com:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 10.0.0 Repository storage paths: - default: /mnt/nas/gitlab-server/data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)Checking GitLab subtasks ... Checking GitLab Shell ... GitLab Shell: ... GitLab Shell version >= 10.0.0 ? ... OK (10.0.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK gitlab-shell self-check successful Checking GitLab Shell ... Finished Checking Gitaly ... Gitaly: ... default ... OK Checking Gitaly ... Finished Checking Sidekiq ... Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1 Checking Sidekiq ... Finished Checking Incoming Email ... Incoming Email: ... Reply by email is disabled in config/gitlab.yml Checking Incoming Email ... Finished Checking LDAP ... LDAP: ... LDAP is disabled in config/gitlab.yml Checking LDAP ... Finished Checking GitLab App ... 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? ... yes 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: ... 2/3 ... yes 2/4 ... yes 2/7 ... yes 2/8 ... yes 2/9 ... yes 2/10 ... yes 6/11 ... yes 2/12 ... yes 3/13 ... yes 2/15 ... yes 13/17 ... yes 13/18 ... yes 13/19 ... yes 13/20 ... yes 13/21 ... yes 2/22 ... yes 14/23 ... yes 14/24 ... yes 2/25 ... yes 2/26 ... yes 2/27 ... yes 2/28 ... yes 2/29 ... yes 2/30 ... yes 2/31 ... yes 2/32 ... yes 2/33 ... yes 2/34 ... yes 14/35 ... yes 2/36 ... yes 2/37 ... yes 14/38 ... yes 14/39 ... yes 2/40 ... yes 2/41 ... yes 2/42 ... yes 2/43 ... yes 2/44 ... yes 2/45 ... yes 2/46 ... yes 2/47 ... yes 2/48 ... yes 4/49 ... yes 2/50 ... yes 2/51 ... yes 2/52 ... yes 2/53 ... yes 2/54 ... yes 2/55 ... yes 2/56 ... yes 14/57 ... yes 14/58 ... yes 2/59 ... yes 2/60 ... yes 2/61 ... yes 2/62 ... yes 2/63 ... yes 2/64 ... yes 2/65 ... yes 2/66 ... yes 2/67 ... yes 14/68 ... yes 16/69 ... yes 4/71 ... yes 16/72 ... yes 16/73 ... yes 14/74 ... yes 13/75 ... yes 2/76 ... yes 2/77 ... yes 2/78 ... yes 2/79 ... yes 2/80 ... yes 13/81 ... yes 9/82 ... yes 4/83 ... yes 7/84 ... yes 2/85 ... yes 3/86 ... yes 2/87 ... yes 4/88 ... yes 23/89 ... yes 2/90 ... yes 24/91 ... yes 24/92 ... yes 4/93 ... yes 14/94 ... yes 9/95 ... yes 4/96 ... yes 3/97 ... yes 2/99 ... yes 3/100 ... yes 4/101 ... yes 27/102 ... yes 24/103 ... yes 2/104 ... yes 24/105 ... yes 27/106 ... yes 2/107 ... yes 2/108 ... yes 2/109 ... yes 2/110 ... yes 14/111 ... yes 2/112 ... yes 24/113 ... yes 2/114 ... yes 2/115 ... yes 14/116 ... yes 2/117 ... yes 2/118 ... yes 9/119 ... yes 2/120 ... yes 2/121 ... yes 2/122 ... yes 3/123 ... yes 2/124 ... yes 2/125 ... yes 14/130 ... yes 14/131 ... yes 2/132 ... yes 2/133 ... yes 2/134 ... yes 2/135 ... yes 2/136 ... yes 9/137 ... yes 2/138 ... yes 2/139 ... yes 2/140 ... yes 2/141 ... yes 2/142 ... yes 2/143 ... yes 2/144 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.22.0 ? ... yes (2.22.0) Git user has default SSH configuration? ... yes Active users: ... 22 Is authorized keys file accessible? ... yes Checking GitLab App ... Finished Checking GitLab subtasks ... Finished