Restoring a Backup Doesn't Work

Summary

Cannot restore a GitLab backup

Steps to reproduce

Copy backup tar to /var/opt/gitlab/backups and run sudo gitlab-rake gitlab:backup:restore BACKUP=1505552032_2017_09_16_10.0.0-rc2-ee

What is the current bug behavior?

rake aborted!
NameError: undefined local variable or method `current_application_settings' for main:Object
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/shell.rake:135:in `ensure_write_to_authorized_keys_is_enabled'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/shell.rake:105:in `setup'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/shell.rake:72:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:63:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:shell:setup
(See full trace by running task with --trace)

What is the expected correct behavior?

Backup should restore

Results of GitLab environment info

System information
System:		Ubuntu 16.04
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	2.3.3p222
Gem Version:	2.6.13
Bundler Version:1.13.7
Rake Version:	12.0.0
Redis Version:	3.2.5
Git Version:	2.13.5
Sidekiq Version:5.0.4
Go Version:	unknown

GitLab information
Version:	10.0.0-rc2-ee
Revision:	7bc1644
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	postgresql
DB Version:	9.6.3
URL:		http://gitlab.c.gt8-tooling.internal
HTTP Clone URL:	http://gitlab.c.gt8-tooling.internal/some-group/some-project.git
SSH Clone URL:	git@gitlab.c.gt8-tooling.internal:some-group/some-project.git
Elasticsearch:	no
Geo:		no
Using LDAP:	no
Using Omniauth:	no

GitLab Shell
Version:	5.9.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
Hooks:		/opt/gitlab/embedded/service/gitlab-shell/hooks
Git:		/opt/gitlab/embedded/bin/git
Assignee Loading
Time tracking Loading