gitlab:backup:restore fails with NoMethodError: undefined method `full_path' for nil:NilClass
Summary
NoMethodError: undefined method
full_path' for nil:NilClass` encountered when restoring a backup.
Steps to reproduce
run gitlab-rake gitlab:backup:restore BACKUP=[backup identifier]
Example Project
N/A
What is the current bug behavior?
Restore fails
What is the expected correct behavior?
Restore succeeds
Relevant logs and/or screenshots
* reponame ... rake aborted!
NoMethodError: undefined method `full_path' for nil:NilClass
/opt/gitlab/embedded/service/gitlab-rails/app/models/project.rb:1329:in `ensure_dir_exist'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/repository.rb:78:in `block in restore'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/repository.rb:73:in `restore'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:83:in `block (4 levels) in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:56:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:22:in `load'
/opt/gitlab/embedded/bin/bundle:22:in `<main>'
Tasks: TOP => gitlab:backup:repo:restore
(See full trace by running task with --trace)
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 14.04 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.13.0 Sidekiq Version:5.0.0 Go Version: unknownGitLab information Version: 9.4.0 Revision: 9bbe2ac Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://appsgit.bethel.jw.org HTTP Clone URL: https://appsgit.bethel.jw.org/some-group/some-project.git SSH Clone URL: git@appsgit.bethel.jw.org:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.3.1 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
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
Some of the output from this command contains PII that cannot be shared here. And some checks fail because of the incomplete restore, which is the very issue with this bug.