Unable to restore from backup file

Summary

I encounter an issue while trying to restore GitLab from backup file. It is failing while restoring uploads.

It seems to be related to tar options "--unlink-first --recursive-unlink" passed in files.rb. Backup file of uploads directory includes ".". As options "--unlink-first --recursive-unlink" are used to extract the archive, it first try to remove recursively the directory ".".

My system :

  • GitLab 10.8.0
  • Red Hat Enterprise Linux Server release 6.6
  • tar (GNU tar) 1.23

Steps to reproduce

Backup GitLab (with or without repositories), then try to restore from backup file.

Relevant logs and/or screenshots

gitlab-rake gitlab:backup:restore BACKUP=1527520530_2018_05_28_10.8.0-ee force=yes

Unpacking backup ... done

Cleaning the database ...

done

Restoring database ...

...........

[DONE]

done

Restoring uploads ...

tar: .: Cannot mkdir: No such file or directory

tar: Exiting with failure status due to previous errors

Backup failed

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: RedHatEnterpriseServer 6.6 Proxy: no Current User: git Using RVM: no Ruby Version: 2.3.7p456 Gem Version: 2.6.14 Bundler Version:1.13.7 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.16.3 Sidekiq Version:5.0.5 Go Version: unknown

GitLab information Version: 10.8.0-ee Revision: caa6172 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.8 URL: https://sdy0xg01.sf.intra.laposte.fr HTTP Clone URL: https://sdy0xg01.sf.intra.laposte.fr/some-group/some-project.git SSH Clone URL: git@sdy0xg01.sf.intra.laposte.fr:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: no

GitLab Shell Version: 7.1.2 Repository storage paths:

  • default: /travail/gitlab-repositories/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

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: ... 9/52 ... ok 9/53 ... ok 9/54 ... ok ......................... 687/1370 ... ok 699/1371 ... 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 not verifying SSL hostname of LDAPS server '*******************:636' LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) .................................

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? ... 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: ... 9/52 ... yes 9/53 ... yes .................. 687/1370 ... yes 699/1371 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.7) Git version >= 2.9.5 ? ... yes (2.16.3) Git user has default SSH configuration? ... yes Active users: ... 484 Elasticsearch version 5.1 - 5.5? ... skipped (elasticsearch is disabled)

Checking GitLab ... Finished